php-src/Zend/tests/bug34767.phpt
Marcus Boerger d3e5026564 - MFH Add E_DEPRECATED (Lars Strojny, Felipe Pena, Marcus)
[DOC] Finally added deprecation messages
2008-02-23 17:06:22 +00:00

34 lines
661 B
PHP
Executable File

--TEST--
Bug #34767 (Zend Engine 1 Compatibility not copying objects correctly)
--INI--
zend.ze1_compatibility_mode=1
error_reporting=E_ALL | E_DEPRECATED | E_STRICT
--FILE--
<?php
$a->y = &new stdClass();
print_r($a);
$b = $a;
$a->y->z = 1;
print_r($b);
?>
--EXPECTF--
Deprecated: Assigning the return value of new by reference is deprecated in %sbug34767.php on line 2
stdClass Object
(
[y] => stdClass Object
(
)
)
Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug34767.php on line 4
stdClass Object
(
[y] => stdClass Object
(
[z] => 1
)
)