iterator_035.phpt 422 B

1234567891011121314151617181920
  1. --TEST--
  2. SPL: ArrayIterator and values assigned by reference
  3. --FILE--
  4. <?php
  5. $tmp = 1;
  6. $a = new ArrayIterator();
  7. $a[] = $tmp;
  8. $a[] = &$tmp;
  9. echo "Done\n";
  10. ?>
  11. --EXPECTF--
  12. Notice: Indirect modification of overloaded element of ArrayIterator has no effect in %s on line %d
  13. Fatal error: Uncaught Error: Cannot assign by reference to an array dimension of an object in %s:%d
  14. Stack trace:
  15. #0 {main}
  16. thrown in %s on line %d