From: Andre Langhorst Date: Wed, 6 Dec 2000 17:56:53 +0000 (+0000) Subject: added $this in constructor test (fails currently) X-Git-Tag: php-4.0.5RC1~994 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45c218968cbe46d5bf89dd73a5c7b90246eb5237;p=php added $this in constructor test (fails currently) --- 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