From 45c218968cbe46d5bf89dd73a5c7b90246eb5237 Mon Sep 17 00:00:00 2001 From: Andre Langhorst Date: Wed, 6 Dec 2000 17:56:53 +0000 Subject: added $this in constructor test (fails currently) --- tests/lang/030.phpt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/lang/030.phpt (limited to 'tests') diff --git a/tests/lang/030.phpt b/tests/lang/030.phpt new file mode 100644 index 0000000000..9215404a4d --- /dev/null +++ b/tests/lang/030.phpt @@ -0,0 +1,33 @@ +--TEST-- +$this in constructor test +--POST-- +--GET-- +--FILE-- +Name = $name; + $GLOBALS['List']->echoName(); } + + function echoName() { + $GLOBALS['names'][]=$this->Name; } } + +function &foo2(&$foo) { + return $foo; } + + +$bar1 = new foo('constructor'); +$bar1->Name = 'outside'; +$bar1->echoName(); + +$bar1 = foo2(new foo('constructor')); +$bar1->Name = 'outside'; +$bar1->echoName(); + +$List->echoName(); + +print ($names==array('constructor','constructor','constructor','constructor','constructor')) ? 'success:':'failure'; +?> +--EXPECT-- +success -- cgit v1.2.1