bug39346.phpt 480 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. Bug #39346 (Unsetting a static variable inside a destructor causes segfault later on)
  3. --FILE--
  4. <?php
  5. class test
  6. {
  7. protected $_id;
  8. static $instances;
  9. public function __construct($id) {
  10. $this->_id = $id;
  11. self::$instances[$this->_id] = $this;
  12. }
  13. function __destruct() {
  14. unset(self::$instances[$this->_id]);
  15. }
  16. }
  17. $test = new test(2);
  18. $test = new test(1);
  19. $test = new test(2);
  20. $test = new test(3);
  21. echo "ok\n";
  22. ?>
  23. --EXPECT--
  24. ok