bug45178.phpt 582 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Bug #45178 memory corruption on assignment result of "new" by reference
  3. --FILE--
  4. <?php
  5. class Foo {
  6. function __construct() {
  7. $this->error = array($this,$this);
  8. }
  9. }
  10. $a =& new Foo();
  11. class Bar {
  12. function __construct() {
  13. $this->_rme2 = $this;
  14. }
  15. }
  16. $b =& new Bar();
  17. $b->_rme2 = 0;
  18. var_dump($b);
  19. ?>
  20. --EXPECTF--
  21. Deprecated: Assigning the return value of new by reference is deprecated in %sbug45178.php on line 7
  22. Deprecated: Assigning the return value of new by reference is deprecated in %sbug45178.php on line 15
  23. object(Bar)#%d (1) {
  24. ["_rme2"]=>
  25. int(0)
  26. }