On Wed, Feb 10, 2016 at 3:51 PM, Yasuo Ohgaki <[email protected]> wrote:
> Behavior regarding array. (a bit off topic, but error level should
> match with new string '{}' errors.)
>
> php > error_reporting(-1);
> php > $v=array();
> php > $v .= 'abc';
>
> Notice: Array to string conversion in php shell code on line 1
> php > var_dump($v);
> string(8) "Arrayabc"
>
> This insane string assignment raises E_NOTICE. PHP may be better to
> raise E_WARNING for this kind of invalid assignments just like
Additional comment on this
php > $v=array(1,2,3);
php > $v .= 'abc';
Notice: Array to string conversion in php shell code on line 1
php > var_dump($v);
string(8) "Arrayabc"
I think $v .= 'abc' should not destroy array variable. It's minor issue, though.
Regards,
--
Yasuo Ohgaki
[email protected]