xref: /PHP-5.3/Zend/tests/bug50261.phpt (revision a83156d5)
1--TEST--
2Bug #50261 (Crash When Calling Parent Constructor with call_user_func())
3--FILE--
4<?php
5
6class testClass {
7	function testClass($x) {
8		echo __METHOD__, " (". $x . ")\n";
9	}
10}
11
12class testClass2 extends testClass {
13	function __construct() {
14		static $x = 0;
15
16		if ($x) {
17			print "Infinite loop...\n";
18		} else {
19			$x++;
20
21			parent::__construct(1);
22			testclass::__construct(2);
23			call_user_func(array('parent', '__construct'), 3);
24			call_user_func(array('testclass', '__construct'), 4);
25			call_user_func(array('testclass', 'testclass'), 5);
26		}
27	}
28}
29
30new testClass2;
31
32?>
33--EXPECT--
34testClass::testClass (1)
35testClass::testClass (2)
36testClass::testClass (3)
37testClass::testClass (4)
38testClass::testClass (5)
39