tempDimFetchByRefError.phpt 288 B

1234567891011121314
  1. --TEST--
  2. Passing a dimension fetch on a temporary by reference is not allowed
  3. --FILE--
  4. <?php
  5. $fn = function(&$ref) {};
  6. $fn([0, 1][0]);
  7. ?>
  8. --EXPECTF--
  9. Fatal error: Uncaught Error: Cannot use temporary expression in write context in %s:%d
  10. Stack trace:
  11. #0 {main}
  12. thrown in %s on line %d