bug62978.phpt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --TEST--
  2. Bug #62987 (Assigning to ArrayObject[null][something] overrides all undefined variables)
  3. --FILE--
  4. <?php
  5. $a = new ArrayObject();
  6. $b = array();
  7. $a[null]['hurr'] = 'durr';
  8. var_dump($a['epic_magic']);
  9. var_dump($b['epic_magic']);
  10. var_dump($c['epic_magic']); // Undefined var!!
  11. $d = array();
  12. var_dump($a['epic_magic']); // more magic!
  13. var_dump($d['epic_magic']);
  14. $e = 'srsly?';
  15. var_dump($a['epic_magic']); // srsly.
  16. var_dump(isset($a['epic_magic']));
  17. $fp = fopen(__FILE__, 'r');
  18. var_dump($a[$fp]);
  19. fclose($fp);
  20. ?>
  21. --EXPECTF--
  22. Warning: Undefined array key "epic_magic" in %s on line %d
  23. NULL
  24. Warning: Undefined array key "epic_magic" in %s on line %d
  25. NULL
  26. Warning: Undefined variable $c in %s on line %d
  27. Warning: Trying to access array offset on value of type null in %s on line %d
  28. NULL
  29. Warning: Undefined array key "epic_magic" in %s on line %d
  30. NULL
  31. Warning: Undefined array key "epic_magic" in %s on line %d
  32. NULL
  33. Warning: Undefined array key "epic_magic" in %s on line %d
  34. NULL
  35. bool(false)
  36. Warning: Resource ID#%d used as offset, casting to integer (%d) in %sbug62978.php on line %d
  37. Warning: Undefined array key 5 in %s on line %d
  38. NULL