dis-bench / src /php /php-src /Zend /tests /exceptions /exception_016.phpt
meddyrat's picture
Replace repository contents with the original corrected artifact
1e94262
Raw History Blame Contribute Delete
491 Bytes
--TEST--
Exceptions on improper usage of $this
--FILE--
<?php
try {
$this->foo();
} catch (Error $e) {
echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
}
$this->foo();
?>
--EXPECTF--
Exception: Using $this when not in object context in %sexception_016.php on line %d
Fatal error: Uncaught Error: Using $this when not in object context in %sexception_016.php:%d
Stack trace:
#0 {main}
thrown in %sexception_016.php on line %d