const_dereference_002.phpt 371 B

1234567891011121314151617
  1. --TEST--
  2. Const string dereference
  3. --FILE--
  4. <?php
  5. error_reporting(E_ALL);
  6. var_dump("foobar"[3]);
  7. var_dump("foobar"[2][0]);
  8. var_dump("foobar"["foo"]["bar"]);
  9. --EXPECTF--
  10. string(1) "b"
  11. string(1) "o"
  12. Warning: Illegal string offset 'foo' in %sconst_dereference_002.php on line %d
  13. Warning: Illegal string offset 'bar' in %sconst_dereference_002.php on line %d
  14. string(1) "f"