xref: /PHP-5.6/Zend/tests/bug39721.phpt (revision 610c7fbe)
1--TEST--
2Bug #39721 (Runtime inheritance causes data corruption)
3--FILE--
4<?php
5class 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
17if (is_object($foo)) {
18	class test2_child extends test2 {
19
20	}
21}
22
23$child = new test2_child();
24
25echo $foo->instance . "\n";
26echo $child->instance . "\n";
27?>
28--EXPECT--
291
302
31