bug43201.phpt 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. Warning: Undefined variable $ref in %s on line %d
  26. Warning: Undefined variable $undef in %s on line %d
  27. Deprecated: chop(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d
  28. Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
  29. Warning: Undefined variable $undef in %s on line %d
  30. Deprecated: chop(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d
  31. Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
  32. Warning: Undefined variable $undef in %s on line %d
  33. Deprecated: chop(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d
  34. Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
  35. Warning: Undefined variable $undef in %s on line %d
  36. Deprecated: chop(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d
  37. Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
  38. Warning: Undefined variable $undef in %s on line %d
  39. Deprecated: chop(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d
  40. Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
  41. Warning: Undefined variable $undef in %s on line %d
  42. Deprecated: chop(): Passing null to parameter #1 ($string) of type string is deprecated in %s on line %d
  43. Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
  44. ok