mirror of
https://github.com/php/php-src.git
synced 2024-10-01 14:56:10 +00:00
f9b8088349
error you get when silently casting an empty variable to an object to an E_WARNING from E_STRICT.
38 lines
594 B
PHP
38 lines
594 B
PHP
--TEST--
|
|
Bug #7515 (weird & invisible referencing of objects)
|
|
--SKIPIF--
|
|
<?php if(version_compare(zend_version(), "2.0.0-dev", '<')) echo "skip Zend Engine 2 needed\n"; ?>
|
|
--INI--
|
|
error_reporting=2039
|
|
--FILE--
|
|
<?php
|
|
class obj {
|
|
function method() {}
|
|
}
|
|
|
|
$o->root=new obj();
|
|
|
|
ob_start();
|
|
var_dump($o);
|
|
$x=ob_get_contents();
|
|
ob_end_clean();
|
|
|
|
$o->root->method();
|
|
|
|
ob_start();
|
|
var_dump($o);
|
|
$y=ob_get_contents();
|
|
ob_end_clean();
|
|
if ($x == $y) {
|
|
print "success";
|
|
} else {
|
|
print "failure
|
|
x=$x
|
|
y=$y
|
|
";
|
|
}
|
|
?>
|
|
--EXPECTF--
|
|
Warning: Creating default object from empty value in %s on line %d
|
|
success
|