Annotation of embedaddon/php/Zend/tests/bug39721.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #39721 (Runtime inheritance causes data corruption)
! 3: --FILE--
! 4: <?php
! 5: class test2 {
! 6: private static $instances = 0;
! 7: public $instance;
! 8:
! 9: public function __construct() {
! 10: $this->instance = ++self::$instances;
! 11: }
! 12:
! 13: }
! 14:
! 15: $foo = new test2();
! 16:
! 17: if (is_object($foo)) {
! 18: class test2_child extends test2 {
! 19:
! 20: }
! 21: }
! 22:
! 23: $child = new test2_child();
! 24:
! 25: echo $foo->instance . "\n";
! 26: echo $child->instance . "\n";
! 27: ?>
! 28: --EXPECT--
! 29: 1
! 30: 2
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>