Display TypeExceptions like normal exceptions

We currently don't show the argument at which the error actually
occured in the trace - should probably either add it or don't
display args on incomplete frames altogether, otherwise this'll
probably be confusing.
This commit is contained in:
Nikita Popov 2015-05-17 18:59:34 +02:00
parent 3ae995f03c
commit 440481fb3e
81 changed files with 412 additions and 89 deletions

View File

@ -12,4 +12,8 @@ foo(123);
--EXPECTF--
3
Fatal error: Argument 1 passed to foo() must be of the type array, integer given, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
Fatal error: Uncaught TypeException: Argument 1 passed to foo() must be of the type array, integer given, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php:2
Stack trace:
#0 %s(%d): foo()
#1 {main}
thrown in %sarray_type_hint_001.php on line 2

View File

@ -26,4 +26,8 @@ FooTest(new Foo());
--EXPECTF--
Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line %d and defined in %sbug33996.php on line %d
Hi!
Fatal error: Argument 1 passed to FooTest() must be an instance of Foo, none given, called in %sbug33996.php on line %d and defined in %sbug33996.php on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to FooTest() must be an instance of Foo, none given, called in %sbug33996.php on line %d and defined in %sbug33996.php:%d
Stack trace:
#0 %s(%d): FooTest()
#1 {main}
thrown in %sbug33996.php on line %d

View File

@ -21,4 +21,8 @@ test($obj);
echo "Done\n";
?>
--EXPECTF--
Fatal error: Argument 1 passed to test() must be an instance of OtherClassName, instance of ClassName given, called in %s on line %d and defined in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to test() must be an instance of OtherClassName, instance of ClassName given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): test()
#1 {main}
thrown in %s on line %d

View File

@ -37,4 +37,8 @@ ok
ok
ok
Fatal error: Argument 1 passed to foo\test5() must be an instance of bar, instance of foo\bar given, called in %sbug42802.php on line %d and defined in %sbug42802.php on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to foo\test5() must be an instance of bar, instance of foo\bar given, called in %sbug42802.php on line %d and defined in %sbug42802.php:%d
Stack trace:
#0 %s(%d): foo\test5()
#1 {main}
thrown in %sbug42802.php on line %d

View File

@ -12,4 +12,8 @@ $foo = new foo;
$foo->bar($foo); // Ok!
$foo->bar(new \stdclass); // Error, ok!
--EXPECTF--
Fatal error: Argument 1 passed to foobar\foo::bar() must be an instance of foobar\foo, instance of stdClass given, called in %sbug43332_1.php on line 10 and defined in %sbug43332_1.php on line 5
Fatal error: Uncaught TypeException: Argument 1 passed to foobar\foo::bar() must be an instance of foobar\foo, instance of stdClass given, called in %sbug43332_1.php on line 10 and defined in %sbug43332_1.php:5
Stack trace:
#0 %s(%d): foobar\foo->bar()
#1 {main}
thrown in %sbug43332_1.php on line 5

View File

@ -6,4 +6,8 @@ function f(callable $c) {}
f();
?>
--EXPECTF--
Fatal error: Argument 1 passed to f() must be callable, none given, called in %s on line 3 and defined in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to f() must be callable, none given, called in %s on line 3 and defined in %s:%d
Stack trace:
#0 %s(%d): f()
#1 {main}
thrown in %s on line %d

View File

@ -32,5 +32,9 @@ array(1) {
int(1)
}
Fatal error: Argument 1 passed to a() must be of the type array, null given, called in %s on line %d and defined in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to a() must be of the type array, null given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): a()
#1 {main}
thrown in %s on line %d

View File

@ -28,4 +28,8 @@ Notice: Undefined variable: y in %s on line %d
Warning: Missing argument 1 for {closure}(), called in %s on line %d and defined in %s on line %d
NULL
Fatal error: Argument 1 passed to test() must be an instance of Closure, instance of stdClass given, called in %s on line %d and defined in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to test() must be an instance of Closure, instance of stdClass given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): test()
#1 {main}
thrown in %s on line %d

View File

@ -18,4 +18,8 @@ new bar(new \stdclass);
--EXPECTF--
NULL
Fatal error: Argument 1 passed to foo\bar::__construct() must be of the type array, object given, called in %s on line %d and defined in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to foo\bar::__construct() must be of the type array, object given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): foo\bar->__construct()
#1 {main}
thrown in %s on line %d

View File

@ -30,4 +30,8 @@ object(foo\test)#%d (0) {
}
NULL
Fatal error: Argument 1 passed to foo\bar::__construct() must implement interface foo\foo, instance of stdClass given, called in %s on line %d and defined in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to foo\bar::__construct() must implement interface foo\foo, instance of stdClass given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): foo\bar->__construct()
#1 {main}
thrown in %s on line %d

View File

@ -36,4 +36,8 @@ object(bar)#%d (0) {
object(baz)#%d (0) {
}
Fatal error: Argument 1 passed to foo::testFoo() must be an instance of foo, instance of stdClass given, called in %s on line %d and defined in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to foo::testFoo() must be an instance of foo, instance of stdClass given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): foo->testFoo()
#1 {main}
thrown in %s on line %d

View File

@ -9,4 +9,8 @@ function test1() : array {
test1();
--EXPECTF--
Fatal error: Return value of test1() must be of the type array, none returned in %s on line %d
Fatal error: Uncaught TypeException: Return value of test1() must be of the type array, none returned in %s:%d
Stack trace:
#0 %s(%d): test1()
#1 {main}
thrown in %s on line %d

View File

@ -10,4 +10,8 @@ function test1() : array {
test1();
--EXPECTF--
Fatal error: Return value of test1() must be of the type array, null returned in %s on line %d
Fatal error: Uncaught TypeException: Return value of test1() must be of the type array, null returned in %s:%d
Stack trace:
#0 %s(%d): test1()
#1 {main}
thrown in %s on line %d

View File

@ -9,4 +9,8 @@ function test1() : array {
test1();
--EXPECTF--
Fatal error: Return value of test1() must be of the type array, integer returned in %s on line %d
Fatal error: Uncaught TypeException: Return value of test1() must be of the type array, integer returned in %s:%d
Stack trace:
#0 %s(%d): test1()
#1 {main}
thrown in %s on line %d

View File

@ -10,4 +10,8 @@ function test1() : array {
test1();
--EXPECTF--
Fatal error: Return value of test1() must be of the type array, string returned in %s on line %d
Fatal error: Uncaught TypeException: Return value of test1() must be of the type array, string returned in %s:%d
Stack trace:
#0 %s(%d): test1()
#1 {main}
thrown in %s on line %d

View File

@ -15,4 +15,8 @@ $qux = new qux();
$qux->foo();
--EXPECTF--
Fatal error: Return value of qux::foo() must be an instance of foo, instance of qux returned in %s on line %d
Fatal error: Uncaught TypeException: Return value of qux::foo() must be an instance of foo, instance of qux returned in %s:%d
Stack trace:
#0 %s(%d): qux->foo()
#1 {main}
thrown in %s on line %d

View File

@ -11,4 +11,8 @@ $array = [1, 2, 3];
var_dump(foo($array));
--EXPECTF--
Fatal error: Return value of foo() must be of the type array, null returned in %s on line %d
Fatal error: Uncaught TypeException: Return value of foo() must be of the type array, null returned in %s:%d
Stack trace:
#0 %s(%d): foo(Array)
#1 {main}
thrown in %s on line %d

View File

@ -16,4 +16,8 @@ $baz = new foo();
var_dump($func=$baz->bar(), $func());
--EXPECTF--
Fatal error: Return value of foo::{closure}() must be of the type array, null returned in %s on line %d
Fatal error: Uncaught TypeException: Return value of foo::{closure}() must be of the type array, null returned in %s:%d
Stack trace:
#0 %s(%d): foo->{closure}()
#1 {main}
thrown in %s on line %d

View File

@ -11,4 +11,8 @@ function get_config(): array {
get_config();
--EXPECTF--
Fatal error: Return value of get_config() must be of the type array, integer returned in %s on line %d
Fatal error: Uncaught TypeException: Return value of get_config() must be of the type array, integer returned in %s:%d
Stack trace:
#0 %s(%d): get_config()
#1 {main}
thrown in %s on line %d

View File

@ -10,4 +10,8 @@ function foo(): DateTime {
foo();
--EXPECTF--
Fatal error: Return value of foo() must be an instance of DateTime, null returned in %s on line %d
Fatal error: Uncaught TypeException: Return value of foo() must be an instance of DateTime, null returned in %s:%d
Stack trace:
#0 %s(%d): foo()
#1 {main}
thrown in %s on line %d

View File

@ -11,4 +11,9 @@ require 'weak_include_strict_2.inc';
// calls within that file should stay strict, despite being included by weak file
?>
--EXPECTF--
Fatal error: Argument 1 passed to takes_int() must be of the type integer, float given, called in %sweak_include_strict_2.inc on line 9 and defined in %sweak_include_strict_2.inc on line 5
Fatal error: Uncaught TypeException: Argument 1 passed to takes_int() must be of the type integer, float given, called in %sweak_include_strict_2.inc on line 9 and defined in %sweak_include_strict_2.inc:5
Stack trace:
#0 %s(%d): takes_int()
#1 %s(%d): require('%s')
#2 {main}
thrown in %sweak_include_strict_2.inc on line 5

View File

@ -13,4 +13,8 @@ var_dump(int_val());
?>
--EXPECTF--
Fatal error: Argument 1 passed to int_val() must be of the type integer, string given, called in %s on line %d and defined in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to int_val() must be of the type integer, string given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): int_val()
#1 {main}
thrown in %s on line %d

View File

@ -13,5 +13,9 @@ require 'strict_call_weak_2.inc';
function_declared_in_weak_mode(1.0);
?>
--EXPECTF--
Fatal error: Argument 1 passed to function_declared_in_weak_mode() must be of the type integer, float given, called in %sstrict_call_weak.php on line 10 and defined in %sstrict_call_weak_2.inc on line 5
Fatal error: Uncaught TypeException: Argument 1 passed to function_declared_in_weak_mode() must be of the type integer, float given, called in %sstrict_call_weak.php on line 10 and defined in %sstrict_call_weak_2.inc:5
Stack trace:
#0 %s(%d): function_declared_in_weak_mode()
#1 {main}
thrown in %sstrict_call_weak_2.inc on line 5

View File

@ -13,5 +13,9 @@ require 'strict_call_weak_explicit_2.inc';
function_declared_in_weak_mode(1.0);
?>
--EXPECTF--
Fatal error: Argument 1 passed to function_declared_in_weak_mode() must be of the type integer, float given, called in %sstrict_call_weak_explicit.php on line 10 and defined in %sstrict_call_weak_explicit_2.inc on line 5
Fatal error: Uncaught TypeException: Argument 1 passed to function_declared_in_weak_mode() must be of the type integer, float given, called in %sstrict_call_weak_explicit.php on line 10 and defined in %sstrict_call_weak_explicit_2.inc:5
Stack trace:
#0 %s(%d): function_declared_in_weak_mode()
#1 {main}
thrown in %sstrict_call_weak_explicit_2.inc on line 5

View File

@ -11,4 +11,9 @@ require 'weak_include_strict_2.inc';
// calls within that file should stay strict, despite being included by weak file
?>
--EXPECTF--
Fatal error: Argument 1 passed to takes_int() must be of the type integer, float given, called in %sweak_include_strict_2.inc on line 9 and defined in %sweak_include_strict_2.inc on line 5
Fatal error: Uncaught TypeException: Argument 1 passed to takes_int() must be of the type integer, float given, called in %sweak_include_strict_2.inc on line 9 and defined in %sweak_include_strict_2.inc:5
Stack trace:
#0 %s(%d): takes_int()
#1 %s(%d): require('%s')
#2 {main}
thrown in %sweak_include_strict_2.inc on line 5

View File

@ -33,4 +33,8 @@ array(3) {
}
}
Fatal error: Argument 3 passed to test() must be of the type array, integer given, called in %s on line %d
Fatal error: Uncaught TypeException: Argument 3 passed to test() must be of the type array, integer given, called in %s:%d
Stack trace:
#0 %s(%d): test(Array, Array)
#1 {main}
thrown in %s on line %d

View File

@ -652,6 +652,12 @@ ZEND_METHOD(exception, __toString)
ZVAL_UNDEF(&trace);
}
if (Z_OBJCE_P(exception) == type_exception_ce && strstr(message->val, ", called in ")) {
zend_string *real_message = zend_strpprintf(0, "%s and defined", message->val);
zend_string_release(message);
message = real_message;
}
if (message->len > 0) {
str = zend_strpprintf(0, "%s: %s in %s:" ZEND_LONG_FMT
"\nStack trace:\n%s%s%s",
@ -908,17 +914,13 @@ ZEND_API void zend_exception_error(zend_object *ex, int severity) /* {{{ */
ZVAL_OBJ(&exception, ex);
ce_exception = Z_OBJCE(exception);
EG(exception) = NULL;
if (ce_exception == parse_exception_ce || ce_exception == type_exception_ce) {
if (ce_exception == parse_exception_ce) {
zend_string *message = zval_get_string(GET_PROPERTY(&exception, "message"));
zend_string *file = zval_get_string(GET_PROPERTY_SILENT(&exception, "file"));
zend_long line = zval_get_long(GET_PROPERTY_SILENT(&exception, "line"));
zend_long code = zval_get_long(GET_PROPERTY_SILENT(&exception, "code"));
if (ce_exception == type_exception_ce && strstr(message->val, ", called in ")) {
zend_error_helper(code, file->val, line, "%s and defined", message->val);
} else {
zend_error_helper(code, file->val, line, "%s", message->val);
}
zend_string_release(file);
zend_string_release(message);

View File

@ -37,4 +37,8 @@ Warning: timezone_offset_get() expects exactly 2 parameters, 0 given in %s on li
bool(false)
int(0)
Fatal error: Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, instance of DateTime given in %s
Fatal error: Uncaught TypeException: Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, instance of DateTime given in %s:%d
Stack trace:
#0 %s(%d): timezone_offset_get(Object(DateTime), Object(DateTimeZone))
#1 {main}
thrown in %s on line %d

View File

@ -38,4 +38,8 @@ Warning: intlcal_add() expects exactly 3 parameters, 4 given in %s on line %d
Warning: intlcal_add(): intlcal_add: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_add() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_add() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_add(1, 2, 3)
#1 {main}
thrown in %s on line %d

View File

@ -28,4 +28,8 @@ bool(false)
Warning: intlcal_clear(): intlcal_clear: invalid field in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_clear() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_clear() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_clear(1, 2)
#1 {main}
thrown in %s on line %d

View File

@ -39,4 +39,8 @@ Warning: intlcal_field_difference() expects exactly 3 parameters, 4 given in %s
Warning: intlcal_field_difference(): intlcal_field_difference: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_field_difference() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_field_difference() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_field_difference(1, 0, 1)
#1 {main}
thrown in %s on line %d

View File

@ -41,4 +41,8 @@ Warning: intlcal_get_day_of_week_type() expects parameter 2 to be integer, strin
Warning: intlcal_get_day_of_week_type(): intlcal_get_day_of_week_type: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_get_day_of_week_type() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_get_day_of_week_type() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_day_of_week_type(1, 1)
#1 {main}
thrown in %s on line %d

View File

@ -23,4 +23,8 @@ Warning: IntlCalendar::getErrorCode() expects exactly 0 parameters, 1 given in %
Warning: IntlCalendar::getErrorCode(): intlcal_get_error_code: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_get_error_code() must be an instance of IntlCalendar, null given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_get_error_code() must be an instance of IntlCalendar, null given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_error_code(NULL)
#1 {main}
thrown in %s on line %d

View File

@ -23,4 +23,8 @@ Warning: IntlCalendar::getErrorMessage() expects exactly 0 parameters, 1 given i
Warning: IntlCalendar::getErrorMessage(): intlcal_get_error_message: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_get_error_message() must be an instance of IntlCalendar, null given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_get_error_message() must be an instance of IntlCalendar, null given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_error_message(NULL)
#1 {main}
thrown in %s on line %d

View File

@ -29,4 +29,8 @@ Warning: intlcal_get_first_day_of_week() expects exactly 1 parameter, 2 given in
Warning: intlcal_get_first_day_of_week(): intlcal_get_first_day_of_week: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_get_first_day_of_week() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_get_first_day_of_week() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_first_day_of_week(1)
#1 {main}
thrown in %s on line %d

View File

@ -39,4 +39,8 @@ Warning: intlcal_get_locale() expects exactly 2 parameters, 1 given in %s on lin
Warning: intlcal_get_locale(): intlcal_get_locale: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_get_locale() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_get_locale() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_locale(1)
#1 {main}
thrown in %s on line %d

View File

@ -29,4 +29,8 @@ Warning: intlcal_get_minimal_days_in_first_week() expects exactly 1 parameter, 2
Warning: intlcal_get_minimal_days_in_first_week(): intlcal_get_minimal_days_in_first_week: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_get_minimal_days_in_first_week() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_get_minimal_days_in_first_week() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_minimal_days_in_first_week(1)
#1 {main}
thrown in %s on line %d

View File

@ -44,4 +44,8 @@ Warning: intlcal_get_repeated_wall_time_option() expects exactly 1 parameter, 2
Warning: intlcal_get_repeated_wall_time_option(): intlcal_get_repeated_wall_time_option: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_get_skipped_wall_time_option() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_get_skipped_wall_time_option() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_skipped_wall_time_option(1)
#1 {main}
thrown in %s on line %d

View File

@ -29,4 +29,8 @@ Warning: intlcal_get_time_zone() expects exactly 1 parameter, 2 given in %s on l
Warning: intlcal_get_time_zone(): intlcal_get_time_zone: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_get_time_zone() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_get_time_zone() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_time_zone(1)
#1 {main}
thrown in %s on line %d

View File

@ -28,4 +28,8 @@ Warning: intlcal_get_time() expects exactly 1 parameter, 2 given in %s on line %
Warning: intlcal_get_time(): intlcal_get_time: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_get_time() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_get_time() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_time(1)
#1 {main}
thrown in %s on line %d

View File

@ -29,4 +29,8 @@ Warning: intlcal_get_type() expects exactly 1 parameter, 2 given in %s on line %
Warning: intlcal_get_type(): intlcal_get_type: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_get_type() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_get_type() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_type(1)
#1 {main}
thrown in %s on line %d

View File

@ -41,4 +41,8 @@ Warning: intlcal_get_weekend_transition() expects exactly 2 parameters, 1 given
Warning: intlcal_get_weekend_transition(): intlcal_get_weekend_transition: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_get_weekend_transition() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_get_weekend_transition() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_get_weekend_transition(1, 1)
#1 {main}
thrown in %s on line %d

View File

@ -29,4 +29,8 @@ Warning: intlcal_in_daylight_time() expects exactly 1 parameter, 2 given in %s o
Warning: intlcal_in_daylight_time(): intlcal_in_daylight_time: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_in_daylight_time() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_in_daylight_time() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_in_daylight_time(1)
#1 {main}
thrown in %s on line %d

View File

@ -29,4 +29,8 @@ Warning: intlcal_is_lenient() expects exactly 1 parameter, 2 given in %s on line
Warning: intlcal_is_lenient(): intlcal_is_lenient: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_is_lenient() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_is_lenient() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_is_lenient(1)
#1 {main}
thrown in %s on line %d

View File

@ -39,4 +39,8 @@ Warning: intlcal_is_set() expects exactly 2 parameters, 1 given in %s on line %d
Warning: intlcal_is_set(): intlcal_is_set: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_is_set() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_is_set() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_is_set(1, 2)
#1 {main}
thrown in %s on line %d

View File

@ -35,4 +35,8 @@ Warning: intlcal_is_weekend() expects parameter 2 to be float, string given in %
Warning: intlcal_is_weekend(): intlcal_is_weekend: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_is_weekend() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_is_weekend() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_is_weekend(1)
#1 {main}
thrown in %s on line %d

View File

@ -34,4 +34,8 @@ bool(false)
Warning: intlcal_roll(): intlcal_set: too many arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_roll() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_roll() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_roll(1, 2, 3)
#1 {main}
thrown in %s on line %d

View File

@ -37,4 +37,8 @@ bool(false)
Warning: intlcal_set_first_day_of_week(): intlcal_set_first_day_of_week: invalid day of week in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_set_first_day_of_week() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_set_first_day_of_week() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_set_first_day_of_week(1, 2)
#1 {main}
thrown in %s on line %d

View File

@ -41,4 +41,8 @@ Warning: intlcal_set_lenient() expects parameter 2 to be boolean, array given in
Warning: intlcal_set_lenient(): intlcal_set_lenient: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_set_lenient() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_set_lenient() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_set_lenient(1, false)
#1 {main}
thrown in %s on line %d

View File

@ -36,5 +36,9 @@ bool(false)
Warning: intlcal_set_minimal_days_in_first_week(): intlcal_set_minimal_days_in_first_week: invalid number of days; must be between 1 and 7 in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_set_minimal_days_in_first_week() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_set_minimal_days_in_first_week() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_set_minimal_days_in_first_week(1, 2)
#1 {main}
thrown in %s on line %d

View File

@ -79,4 +79,8 @@ Warning: intlcal_set_repeated_wall_time_option() expects exactly 2 parameters, 1
Warning: intlcal_set_repeated_wall_time_option(): intlcal_set_repeated_wall_time_option: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_set_repeated_wall_time_option() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_set_repeated_wall_time_option() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_set_repeated_wall_time_option(1, 1)
#1 {main}
thrown in %s on line %d

View File

@ -34,4 +34,8 @@ Warning: intlcal_set_time() expects exactly 2 parameters, 3 given in %s on line
Warning: intlcal_set_time(): intlcal_set_time: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_set_time() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_set_time() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_set_time(1)
#1 {main}
thrown in %s on line %d

View File

@ -38,4 +38,8 @@ bool(false)
Warning: intlcal_set(): intlcal_set: invalid field in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlcal_set() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_set() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_set(1, 2, 3)
#1 {main}
thrown in %s on line %d

View File

@ -38,4 +38,8 @@ bool(false)
Warning: IntlCalendar::toDateTime(): intlcal_to_date_time: DateTimeZone constructor threw exception in %s on line %d
string(77) "exception: DateTimeZone::__construct(): Unknown or bad timezone (Etc/Unknown)"
Fatal error: Argument 1 passed to intlcal_to_date_time() must be an instance of IntlCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlcal_to_date_time() must be an instance of IntlCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlcal_to_date_time(3)
#1 {main}
thrown in %s on line %d

View File

@ -27,4 +27,8 @@ Warning: intlgregcal_get_gregorian_change() expects exactly 1 parameter, 2 given
Warning: intlgregcal_get_gregorian_change(): intlgregcal_get_gregorian_change: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlgregcal_get_gregorian_change() must be an instance of IntlGregorianCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlgregcal_get_gregorian_change() must be an instance of IntlGregorianCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlgregcal_get_gregorian_change(1)
#1 {main}
thrown in %s on line %d

View File

@ -45,4 +45,8 @@ Warning: intlgregcal_is_leap_year() expects exactly 2 parameters, 1 given in %s
Warning: intlgregcal_is_leap_year(): intlgregcal_is_leap_year: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlgregcal_is_leap_year() must be an instance of IntlGregorianCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlgregcal_is_leap_year() must be an instance of IntlGregorianCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlgregcal_is_leap_year(1, 2)
#1 {main}
thrown in %s on line %d

View File

@ -39,4 +39,8 @@ Warning: intlgregcal_set_gregorian_change() expects exactly 2 parameters, 1 give
Warning: intlgregcal_set_gregorian_change(): intlgregcal_set_gregorian_change: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intlgregcal_set_gregorian_change() must be an instance of IntlGregorianCalendar, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intlgregcal_set_gregorian_change() must be an instance of IntlGregorianCalendar, integer given in %s:%d
Stack trace:
#0 %s(%d): intlgregcal_set_gregorian_change(1, 4)
#1 {main}
thrown in %s on line %d

View File

@ -20,4 +20,8 @@ Warning: IntlTimeZone::getDSTSavings() expects exactly 0 parameters, 1 given in
Warning: IntlTimeZone::getDSTSavings(): intltz_get_dst_savings: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intltz_get_dst_savings() must be an instance of IntlTimeZone, null given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intltz_get_dst_savings() must be an instance of IntlTimeZone, null given in %s:%d
Stack trace:
#0 %s(%d): intltz_get_dst_savings(NULL)
#1 {main}
thrown in %s on line %d

View File

@ -42,4 +42,8 @@ Warning: IntlTimeZone::getDisplayName() expects at most 3 parameters, 4 given in
Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intltz_get_display_name() must be an instance of IntlTimeZone, null given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intltz_get_display_name() must be an instance of IntlTimeZone, null given in %s:%d
Stack trace:
#0 %s(%d): intltz_get_display_name(NULL, 1, false, 'pt_PT')
#1 {main}
thrown in %s on line %d

View File

@ -20,4 +20,8 @@ Warning: IntlTimeZone::getErrorCode() expects exactly 0 parameters, 1 given in %
Warning: IntlTimeZone::getErrorCode(): intltz_get_error_code: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intltz_get_error_code() must be an instance of IntlTimeZone, null given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intltz_get_error_code() must be an instance of IntlTimeZone, null given in %s:%d
Stack trace:
#0 %s(%d): intltz_get_error_code(NULL)
#1 {main}
thrown in %s on line %d

View File

@ -20,4 +20,8 @@ Warning: IntlTimeZone::getErrorMessage() expects exactly 0 parameters, 1 given i
Warning: IntlTimeZone::getErrorMessage(): intltz_get_error_message: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intltz_get_error_message() must be an instance of IntlTimeZone, null given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intltz_get_error_message() must be an instance of IntlTimeZone, null given in %s:%d
Stack trace:
#0 %s(%d): intltz_get_error_message(NULL)
#1 {main}
thrown in %s on line %d

View File

@ -20,4 +20,8 @@ Warning: IntlTimeZone::getID() expects exactly 0 parameters, 1 given in %s on li
Warning: IntlTimeZone::getID(): intltz_get_id: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intltz_get_id() must be an instance of IntlTimeZone, null given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intltz_get_id() must be an instance of IntlTimeZone, null given in %s:%d
Stack trace:
#0 %s(%d): intltz_get_id(NULL)
#1 {main}
thrown in %s on line %d

View File

@ -30,4 +30,8 @@ Warning: IntlTimeZone::getOffset() expects exactly 4 parameters, 5 given in %s o
Warning: IntlTimeZone::getOffset(): intltz_get_offset: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intltz_get_offset() must be an instance of IntlTimeZone, null given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intltz_get_offset() must be an instance of IntlTimeZone, null given in %s:%d
Stack trace:
#0 %s(%d): intltz_get_offset(NULL, %d, false, NULL, NULL)
#1 {main}
thrown in %s on line %d

View File

@ -20,4 +20,8 @@ Warning: IntlTimeZone::getRawOffset() expects exactly 0 parameters, 1 given in %
Warning: IntlTimeZone::getRawOffset(): intltz_get_raw_offset: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intltz_get_raw_offset() must be an instance of IntlTimeZone, null given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intltz_get_raw_offset() must be an instance of IntlTimeZone, null given in %s:%d
Stack trace:
#0 %s(%d): intltz_get_raw_offset(NULL)
#1 {main}
thrown in %s on line %d

View File

@ -35,4 +35,8 @@ Warning: intltz_to_date_time_zone() expects exactly 1 parameter, 0 given in %s o
Warning: intltz_to_date_time_zone(): intltz_to_date_time_zone: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intltz_to_date_time_zone() must be an instance of IntlTimeZone, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intltz_to_date_time_zone() must be an instance of IntlTimeZone, integer given in %s:%d
Stack trace:
#0 %s(%d): intltz_to_date_time_zone(1)
#1 {main}
thrown in %s on line %d

View File

@ -19,4 +19,8 @@ Warning: IntlTimeZone::useDaylightTime() expects exactly 0 parameters, 1 given i
Warning: IntlTimeZone::useDaylightTime(): intltz_use_daylight_time: bad arguments in %s on line %d
bool(false)
Fatal error: Argument 1 passed to intltz_use_daylight_time() must be an instance of IntlTimeZone, null given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to intltz_use_daylight_time() must be an instance of IntlTimeZone, null given in %s:%d
Stack trace:
#0 %s(%d): intltz_use_daylight_time(NULL)
#1 {main}
thrown in %s on line %d

View File

@ -18,4 +18,8 @@ Warning: Transliterator::createInverse() expects exactly 0 parameters, 1 given i
Warning: Transliterator::createInverse(): transliterator_create_inverse: bad arguments in %s on line %d
Fatal error: Argument 1 passed to transliterator_create_inverse() must be an instance of Transliterator, string given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to transliterator_create_inverse() must be an instance of Transliterator, string given in %s:%d
Stack trace:
#0 %s(%d): transliterator_create_inverse('jj')
#1 {main}
thrown in %s on line %d

View File

@ -21,4 +21,8 @@ Warning: Transliterator::getErrorCode() expects exactly 0 parameters, 1 given in
Warning: Transliterator::getErrorCode(): transliterator_get_error_code: unable to parse input params in %s on line %d
Fatal error: Argument 1 passed to transliterator_get_error_code() must be an instance of Transliterator, array given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to transliterator_get_error_code() must be an instance of Transliterator, array given in %s:%d
Stack trace:
#0 %s(%d): transliterator_get_error_code(Array)
#1 {main}
thrown in %s on line %d

View File

@ -21,4 +21,8 @@ Warning: Transliterator::getErrorMessage() expects exactly 0 parameters, 1 given
Warning: Transliterator::getErrorMessage(): transliterator_get_error_message: unable to parse input params in %s on line %d
Fatal error: Argument 1 passed to transliterator_get_error_message() must be an instance of Transliterator, array given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to transliterator_get_error_message() must be an instance of Transliterator, array given in %s:%d
Stack trace:
#0 %s(%d): transliterator_get_error_message(Array)
#1 {main}
thrown in %s on line %d

View File

@ -17,4 +17,8 @@ var_dump($a);
?>
--EXPECTF--
Fatal error: Argument 1 passed to ReflectionClass::newInstanceArgs() must be of the type array, string given in %s on line 8
Fatal error: Uncaught TypeException: Argument 1 passed to ReflectionClass::newInstanceArgs() must be of the type array, string given in %s:8
Stack trace:
#0 %s(%d): ReflectionClass->newInstanceArgs('x')
#1 {main}
thrown in %s on line 8

View File

@ -23,4 +23,8 @@ Warning: iterator_count() expects exactly 1 parameter, 0 given in %s
Warning: iterator_count() expects exactly 1 parameter, 2 given in %s
Fatal error: Argument 1 passed to iterator_count() must implement interface Traversable, %unicode_string_optional% given %s
Fatal error: Uncaught TypeException: Argument 1 passed to iterator_count() must implement interface Traversable, string given in %s:%d
Stack trace:
#0 %s(%d): iterator_count('1')
#1 {main}
thrown in %s on line %d

View File

@ -22,4 +22,8 @@ Warning: iterator_to_array() expects at least 1 parameter, 0 given in %s
Warning: iterator_to_array() expects at most 2 parameters, 3 given in %s
Fatal error: Argument 1 passed to iterator_to_array() must implement interface Traversable, %unicode_string_optional% given %s
Fatal error: Uncaught TypeException: Argument 1 passed to iterator_to_array() must implement interface Traversable, string given in %s:%d
Stack trace:
#0 %s(%d): iterator_to_array('test', 'test')
#1 {main}
thrown in %s on line %d

View File

@ -104,4 +104,9 @@ echo "Done\n";
--EXPECTF--
Warning: fopen(var://myvar): failed to open stream: "VariableStream::stream_open" call failed in %sbug38450_3.php on line %d
Fatal error: Argument 1 passed to VariableStream::__construct() must be of the type array, none given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to VariableStream::__construct() must be of the type array, none given in %s:%d
Stack trace:
#0 [internal function]: VariableStream->__construct()
#1 %s(%d): fopen('var://myvar', 'r+')
#2 {main}
thrown in %s on line %d

View File

@ -14,7 +14,8 @@ Ensure type hints for unknown types do not trigger autoload.
f(new stdClass);
?>
--EXPECTF--
Fatal error: Argument 1 passed to f() must be an instance of UndefClass, instance of stdClass given, called in %s
Fatal error: Uncaught TypeException: Argument 1 passed to f() must be an instance of UndefClass, instance of stdClass given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): f()
#1 {main}
thrown in %s on line %d

View File

@ -23,4 +23,8 @@ $obj = new MyTestClass;
===DONE===
--EXPECTF--
Fatal error: Argument 1 passed to MyTestClass::__construct() must be an instance of MyObject, none given, called in %sinterfaces_003.php on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to MyTestClass::__construct() must be an instance of MyObject, none given, called in %sinterfaces_003.php:%d
Stack trace:
#0 %s(%d): MyTestClass->__construct()
#1 {main}
thrown in %sinterfaces_003.php on line %d

View File

@ -35,4 +35,8 @@ $a->b($b);
?>
--EXPECTF--
Fatal error: Argument 1 passed to FooBar::a() must implement interface Foo, instance of Blort given, called in %s on line 27 and defined in %s on line 12
Fatal error: Uncaught TypeException: Argument 1 passed to FooBar::a() must implement interface Foo, instance of Blort given, called in %s on line 27 and defined in %s:12
Stack trace:
#0 %s(%d): FooBar->a()
#1 {main}
thrown in %s on line 12

View File

@ -13,4 +13,8 @@ $o = new Foo;
$o->a($o);
?>
--EXPECTF--
Fatal error: Argument 1 passed to Foo::a() must be an instance of NonExisting, instance of Foo given, called in %s on line %d and defined in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to Foo::a() must be an instance of NonExisting, instance of Foo given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): Foo->a()
#1 {main}
thrown in %s on line %d

View File

@ -57,4 +57,8 @@ array(1) {
int(25)
}
Fatal error: Argument 1 passed to Test::f1() must be of the type array, integer given, called in %s on line %d and defined in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to Test::f1() must be of the type array, integer given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): Test::f1()
#1 {main}
thrown in %s on line %d

View File

@ -53,4 +53,9 @@ int(2)
object(foo)#%d (0) {
}
Fatal error: Argument 1 passed to typehint() must be an instance of foo, integer given in %s on line %d
Fatal error: Uncaught TypeException: Argument 1 passed to typehint() must be an instance of foo, integer given in %s:%d
Stack trace:
#0 [internal function]: typehint(1)
#1 %s(%d): array_walk(Array, 'typehint')
#2 {main}
thrown in %s on line %d

View File

@ -19,4 +19,8 @@ Catchable fatal error [1]
echo "ALIVE!\n";
?>
--EXPECTF--
Fatal error: Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_001.php on line 15 and defined in %scatchable_error_001.php on line 5
Fatal error: Uncaught TypeException: Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_001.php on line 15 and defined in %scatchable_error_001.php:5
Stack trace:
#0 %s(%d): blah()
#1 {main}
thrown in %scatchable_error_001.php on line 5

View File

@ -23,4 +23,8 @@ type_hint_foo($bar);
?>
--EXPECTF--
Fatal error: Argument 1 passed to type_hint_foo() must be an instance of Foo, instance of Bar given, called in %s on line 16 and defined in %s on line 9
Fatal error: Uncaught TypeException: Argument 1 passed to type_hint_foo() must be an instance of Foo, instance of Bar given, called in %s on line 16 and defined in %s:9
Stack trace:
#0 %s(%d): type_hint_foo()
#1 {main}
thrown in %s on line 9