php-src/tests/lang/this_assignment.phpt
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

42 lines
561 B
PHP

--TEST--
Test to catch early assignment of $this
--FILE--
<?php
class first {
function me() { echo "first"; }
function who() {
global $a,$b;
$this->me();
$a->me();
$b->me();
$b = new second();
$this->me();
$a->me();
$b->me();
}
}
class second {
function who() {
global $a,$b;
$this->me();
$a->me();
$b->me();
}
function me() { echo "second"; }
}
$a = new first();
$b = &$a;
$a->who();
$b->who();
echo "\n";
?>
--EXPECT--
firstfirstfirstfirstsecondsecondsecondsecondsecond