cvs: php4 /tests/lang 030.phpt
| From: | Andr� Langhorst | Date: | Wed, 06 Dec 2000 17:56:54 +0000 |
| Subject: | cvs: php4 /tests/lang 030.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2973@lists.php.net to get a copy of this message | ||
waldschrott Wed Dec 6 09:56:54 2000 EDT
Added files:
/php4/tests/lang 030.phpt
Log:
added $this in constructor test (fails currently)
Index: php4/tests/lang/030.phpt
+++ php4/tests/lang/030.phpt
--TEST--
$this in constructor test
--POST--
--GET--
--FILE--
<?php
class foo {
function foo($name) {
$GLOBALS['List']= &$this;
$this->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