mirror of
https://github.com/php/php-src.git
synced 2024-09-26 20:37:29 +00:00
17 lines
421 B
PHP
17 lines
421 B
PHP
--TEST--
|
|
Exceptions on improper usage of $this
|
|
--FILE--
|
|
<?php
|
|
try {
|
|
$this->foo();
|
|
} catch (EngineException $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: Using $this when not in object context in %sexception_016.php on line %d
|