summaryrefslogtreecommitdiff
path: root/Zend/tests
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-03-07 02:17:11 +0000
committerFelipe Pena <felipe@php.net>2010-03-07 02:17:11 +0000
commitf867fadd22a68b2d92c621d522842b285f41e4ad (patch)
tree6b4d88bdadb6c2abfbea294ace3dfa581b38ac82 /Zend/tests
parent4149bb3dfd9c4fa67164099959feb8b819ae81da (diff)
downloadphp-git-f867fadd22a68b2d92c621d522842b285f41e4ad.tar.gz
- Fixed bug #50383 (Exceptions thrown in __call / __callStatic do not include file and line in trace)
Diffstat (limited to 'Zend/tests')
-rw-r--r--Zend/tests/bug50383.phpt130
1 files changed, 130 insertions, 0 deletions
diff --git a/Zend/tests/bug50383.phpt b/Zend/tests/bug50383.phpt
new file mode 100644
index 0000000000..2210c4bc35
--- /dev/null
+++ b/Zend/tests/bug50383.phpt
@@ -0,0 +1,130 @@
+--TEST--
+Bug #50383 (Exceptions thrown in __call / __callStatic do not include file and line in trace)
+--FILE--
+<?php
+
+class myClass {
+ public static function __callStatic($method, $args) {
+ throw new Exception("Missing static method '$method'\n");
+ }
+ public function __call($method, $args) {
+ throw new Exception("Missing method '$method'\n");
+ }
+}
+
+function thrower() {
+ myClass::ThrowException();
+}
+function thrower2() {
+ $x = new myClass;
+ $x->foo();
+}
+
+try {
+ thrower();
+} catch(Exception $e) {
+ print $e->getMessage();
+ print_r($e->getTrace());
+}
+
+try {
+ thrower2();
+} catch (Exception $e) {
+ print $e->getMessage();
+ print_r($e->getTrace());
+}
+
+?>
+--EXPECTF--
+Missing static method 'ThrowException'
+Array
+(
+ [0] => Array
+ (
+ [file] => %s
+ [line] => 13
+ [function] => __callStatic
+ [class] => myClass
+ [type] => ::
+ [args] => Array
+ (
+ [0] => ThrowException
+ [1] => Array
+ (
+ )
+
+ )
+
+ )
+
+ [1] => Array
+ (
+ [file] => %s
+ [line] => 13
+ [function] => ThrowException
+ [class] => myClass
+ [type] => ::
+ [args] => Array
+ (
+ )
+
+ )
+
+ [2] => Array
+ (
+ [file] => %s
+ [line] => 21
+ [function] => thrower
+ [args] => Array
+ (
+ )
+
+ )
+
+)
+Missing method 'foo'
+Array
+(
+ [0] => Array
+ (
+ [file] => %s
+ [line] => 17
+ [function] => __call
+ [class] => myClass
+ [type] => ->
+ [args] => Array
+ (
+ [0] => foo
+ [1] => Array
+ (
+ )
+
+ )
+
+ )
+
+ [1] => Array
+ (
+ [file] => %s
+ [line] => 17
+ [function] => foo
+ [class] => myClass
+ [type] => ->
+ [args] => Array
+ (
+ )
+
+ )
+
+ [2] => Array
+ (
+ [file] => %s
+ [line] => 28
+ [function] => thrower2
+ [args] => Array
+ (
+ )
+
+ )
+
+)