bug43201.phpt 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --TEST--
  2. Bug #43201 (Crash on using uninitialized vals and __get/__set)
  3. --FILE--
  4. <?php
  5. class Foo {
  6. function __get($k) {
  7. return null;
  8. }
  9. function __set($k, $v) {
  10. $this->$k = $v;
  11. }
  12. }
  13. $c = new Foo();
  14. $c->arr[0]["k"] = 1;
  15. $c->arr[0]["k2"] = $ref;
  16. for($cnt=0;$cnt<6;$cnt++) {
  17. $ref = chop($undef);
  18. $c->arr[$cnt]["k2"] = $ref;
  19. }
  20. echo "ok\n";
  21. ?>
  22. --EXPECTF--
  23. Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 13
  24. Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 14
  25. Notice: Undefined variable: ref in %sbug43201.php on line 14
  26. Notice: Undefined variable: undef in %sbug43201.php on line 16
  27. Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
  28. Notice: Undefined variable: undef in %sbug43201.php on line 16
  29. Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
  30. Notice: Undefined variable: undef in %sbug43201.php on line 16
  31. Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
  32. Notice: Undefined variable: undef in %sbug43201.php on line 16
  33. Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
  34. Notice: Undefined variable: undef in %sbug43201.php on line 16
  35. Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
  36. Notice: Undefined variable: undef in %sbug43201.php on line 16
  37. Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
  38. ok