summaryrefslogtreecommitdiff
path: root/tests/lang/bug21669.phpt
blob: f81011cf6f0fce894b89b536b14106c6f8cfde10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--TEST--
Bug #21669 ("$obj = new $this->var;" doesn't work)
--FILE--
<?php
class Test {
	function say_hello() {
		echo "Hello world";
	}
}

class Factory {
	var $name = "Test";
	function create() {
		$obj = new $this->name; /* Parse error */
		return $obj;
	}
}
$factory = new Factory;
$test = $factory->create();
$test->say_hello();
?>
--EXPECT--
Hello world