1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 01:32:22 +01:00
Files
archived-php-src/Zend/tests/exception_016.phpt
2015-05-17 17:31:43 -05:00

20 lines
485 B
PHP

--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