Edit report at https://bugs.php.net/bug.php?id=64955&edit=1
ID: 64955 Updated by: ras...@php.net Reported by: matteosistisette at gmail dot com Summary: "array to string conversion" notice should contain more information -Status: Open +Status: Not a bug Type: Bug Package: *General Issues PHP Version: 5.4.15 Block user comment: N Private report: N New Comment: That's actually surprisingly difficult to do given how bison (the parser generator) works. You can do it quite easily in userspace though. Just break up the line you are having trouble with over multiple lines and the line number will tell you which variable it is. Previous Comments: ------------------------------------------------------------------------ [2013-06-01 15:23:05] matteosistisette at gmail dot com Description: ------------ The "Array to string conversion" notice message should at the very least include the name of the array variable that is being converted to string. A line of code may contain a lot of variables, so figuring out which one is the unexpected array can be a pain in the ass. Even the backtrace won't contain enough information since it only gives the line but not the position within the line. Test script: --------------- $string1="foo"; $string2="bar"; $string3=array("Whoops, this is an array"); $string4="bla bla"; echo $string1.$string2.$string3.$string4. Expected result: ---------------- PHP NOTICE at /path/to/file.php (6): Array to string conversion for variable 'string3' Actual result: -------------- PHP NOTICE at /path/to/file.php (6): Array to string conversion ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=64955&edit=1