engine_assignExecutionOrder_007.phpt 852 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --TEST--
  2. Check key execution order with &new.
  3. --FILE--
  4. <?php
  5. $a[2][3] = 'stdClass';
  6. $a[$i=0][++$i] =& new $a[++$i][++$i];
  7. print_r($a);
  8. $o = new stdClass;
  9. $o->a =& new $a[$i=2][++$i];
  10. $o->a->b =& new $a[$i=2][++$i];
  11. print_r($o);
  12. ?>
  13. --EXPECTF--
  14. Deprecated: Assigning the return value of new by reference is deprecated in %s.php on line 3
  15. Deprecated: Assigning the return value of new by reference is deprecated in %s.php on line 7
  16. Deprecated: Assigning the return value of new by reference is deprecated in %s.php on line 8
  17. Array
  18. (
  19. [2] => Array
  20. (
  21. [3] => stdClass
  22. )
  23. [0] => Array
  24. (
  25. [1] => stdClass Object
  26. (
  27. )
  28. )
  29. )
  30. stdClass Object
  31. (
  32. [a] => stdClass Object
  33. (
  34. [b] => stdClass Object
  35. (
  36. )
  37. )
  38. )