]> granicus.if.org Git - php/commit
Silently casting an empty string, null or false into an object by adding a property
authorScott MacVicar <scottmac@php.net>
Fri, 31 Dec 2010 16:57:45 +0000 (16:57 +0000)
committerScott MacVicar <scottmac@php.net>
Fri, 31 Dec 2010 16:57:45 +0000 (16:57 +0000)
commit6144da7e351545158db3fad647b818b1027354f7
treefc988d0b79b3385551482b0f0ca071763a4b8114
parentc9c0de49a8f56b940a4d2142408f19f1f1821f7d
Silently casting an empty string, null or false into an object by adding a property
is pretty non-intuitive. If the same value was 1 or true you get a warning and it halts.

Since we can't break BC completely (yet) lets bump this from E_STRICT.

Also added a new section to UPGRADING for engine changes.

<?php
$x = '';
// $x = null;
// $x = false;
$x->baz = 1;
var_dump($x);

$y = 1;
$y->baz = 1;
var_dump($y);
NEWS
UPGRADING
Zend/tests/026.phpt
Zend/tests/033.phpt
Zend/tests/bug52041.phpt
Zend/tests/bug52614.phpt
Zend/zend_execute.c
ext/dom/tests/bug47430.phpt
ext/reflection/tests/bug40431.phpt
tests/classes/implicit_instantiation_001.phpt