summaryrefslogtreecommitdiff
path: root/Zend/tests/bug32290.phpt
blob: f754275ccff490b103083903b2441a5988932c08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--TEST--
Bug #32290 (calling call_user_func_array() ends in infinite loop within child class)
--FILE--
<?php

class TestA
{
	public function doSomething($i)
	{
		echo __METHOD__ . "($this)\n";
		return --$i;
	}
}

class TestB extends TestA
{
	public function doSomething($i)
	{
		echo __METHOD__ . "($this)\n";
		$i++;
		if ($i >= 5) return 5;
		return call_user_func_array(array("TestA","doSomething"), array($i));
	}
}

$x = new TestB();
var_dump($x->doSomething(1));

?>
===DONE===
--EXPECTF--
TestB::doSomething(Object id #%d)
TestA::doSomething(Object id #%d)
int(1)
===DONE===