bug76713.phpt 552 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --TEST--
  2. Bug #76713 (Segmentation fault caused by property corruption)
  3. --FILE--
  4. <?php
  5. function test($obj) {
  6. return array_column(array($obj), "prop");
  7. }
  8. $obj = new Stdclass();
  9. $obj->prop = str_pad("a", 10, 'a');
  10. test($obj);
  11. test($obj);
  12. test($obj);
  13. var_dump($obj->prop);
  14. class C {
  15. public $name;
  16. public function __get($name) {
  17. return $this->name;
  18. }
  19. }
  20. $obj = new C;
  21. $obj->name = str_pad("b", 10, 'b');
  22. test($obj);
  23. test($obj);
  24. test($obj);
  25. var_dump($obj->prop);
  26. ?>
  27. --EXPECT--
  28. string(10) "aaaaaaaaaa"
  29. string(10) "bbbbbbbbbb"