diff options
author | Dmitry Stogov <dmitry@php.net> | 2008-09-02 09:45:49 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2008-09-02 09:45:49 +0000 |
commit | d5bba04ac5b48d64e056ed98735ad48aa856cf90 (patch) | |
tree | 97522e2246b17802add3fc06d4dd98f2df228d3e | |
parent | 66ebb8019b7cc3232c870557db07eaeca714b681 (diff) | |
download | php-git-d5bba04ac5b48d64e056ed98735ad48aa856cf90.tar.gz |
Fixed Bug #43958 (class name added into the error message)
-rw-r--r-- | main/main.c | 5 | ||||
-rw-r--r-- | tests/lang/bug43958.phpt | 17 |
2 files changed, 20 insertions, 2 deletions
diff --git a/main/main.c b/main/main.c index 9648b04a0a..241cedb799 100644 --- a/main/main.c +++ b/main/main.c @@ -575,8 +575,8 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c char *docref_target = "", *docref_root = ""; char *p; int buffer_len = 0; - char *space; - char *class_name = get_active_class_name(&space TSRMLS_CC); + char *space = ""; + char *class_name = ""; char *function; int origin_len; char *origin; @@ -632,6 +632,7 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c function = "Unknown"; } else { is_function = 1; + class_name = get_active_class_name(&space TSRMLS_CC); } } diff --git a/tests/lang/bug43958.phpt b/tests/lang/bug43958.phpt new file mode 100644 index 0000000000..bc88bcda0f --- /dev/null +++ b/tests/lang/bug43958.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #43958 (class name added into the error message) +--FILE-- +<?php +class MyClass +{ + static public function loadCode($p) { + return include $p; + } +} + +MyClass::loadCode('file-which-does-not-exist-on-purpose.php'); +--EXPECTF-- +Warning: include(file-which-does-not-exist-on-purpose.php): failed to open stream: No such file or directory in %sbug43958.php on line 5 + +Warning: include(): Failed opening 'file-which-does-not-exist-on-purpose.php' for inclusion (include_path='%s') in %sbug43958.php on line 5 + |