summaryrefslogtreecommitdiff
path: root/Zend/tests/exception_016.phpt
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-04-01 15:54:03 +0300
committerDmitry Stogov <dmitry@zend.com>2015-04-01 15:54:03 +0300
commit0cad725886dc620632f3aa413c1e944411465cd0 (patch)
tree1afb919bac835888f3b71e9ab08d0c659ce0280e /Zend/tests/exception_016.phpt
parent8c031a3f95442b68625394962fa1b0279d182f62 (diff)
downloadphp-git-0cad725886dc620632f3aa413c1e944411465cd0.tar.gz
Convert fatal errors into EngineExceptions
Diffstat (limited to 'Zend/tests/exception_016.phpt')
-rw-r--r--Zend/tests/exception_016.phpt16
1 files changed, 16 insertions, 0 deletions
diff --git a/Zend/tests/exception_016.phpt b/Zend/tests/exception_016.phpt
new file mode 100644
index 0000000000..ffa0a45b84
--- /dev/null
+++ b/Zend/tests/exception_016.phpt
@@ -0,0 +1,16 @@
+--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