]> granicus.if.org Git - php/commitdiff
Implement \ArgumentCountError exception
authorDavey Shafik <me@daveyshafik.com>
Tue, 30 Aug 2016 19:09:26 +0000 (12:09 -0700)
committerDavey Shafik <me@daveyshafik.com>
Wed, 31 Aug 2016 02:35:56 +0000 (19:35 -0700)
21 files changed:
Zend/tests/bug38047.phpt
Zend/tests/bug55705.phpt
Zend/tests/bug70689.phpt
Zend/tests/function_arguments/argument_count_correct.phpt [new file with mode: 0644]
Zend/tests/function_arguments/argument_count_correct_strict.phpt [new file with mode: 0644]
Zend/tests/function_arguments/argument_count_incorrect_internal.phpt [new file with mode: 0644]
Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt [new file with mode: 0644]
Zend/tests/function_arguments/argument_count_incorrect_userland.phpt [new file with mode: 0644]
Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt [new file with mode: 0644]
Zend/tests/nullable_types/nullable_type_parameters_do_not_have_default_value.phpt
Zend/zend.c
Zend/zend.h
Zend/zend_API.c
Zend/zend_exceptions.c
Zend/zend_exceptions.h
Zend/zend_execute.c
ext/reflection/tests/ReflectionMethod_invokeArgs_error1.phpt
ext/reflection/tests/ReflectionMethod_invoke_error2.phpt
ext/standard/tests/assert/assert_error2.phpt
ext/standard/tests/file/bug38450_3.phpt
tests/classes/interfaces_003.phpt

index 09739d23ebbba0c84866790a1b9dd0bd141843d6..e6eeb6631ddb3f2221e7a6c47d954e0855fde529 100644 (file)
@@ -44,7 +44,7 @@ Non-static method A::A_ftk() should not be called statically
 2 %sbug38047.php:36 kalus_error_handler()
 
 
-Fatal error: Uncaught Error: Too few arguments to function A::A_ftk(), 0 passed in %sbug38047.php on line 36 and exactly 1 expected in %sbug38047.php:7
+Fatal error: Uncaught ArgumentCountError: Too few arguments to function A::A_ftk(), 0 passed in %sbug38047.php on line 36 and exactly 1 expected in %sbug38047.php:7
 Stack trace:
 #0 %sbug38047.php(36): A::A_ftk()
 #1 {main}
index fc17139344d784a1e285b7d9236e8a6113b173a6..06811bbc1b97117bafd529fd521c24c4e9c49865 100644 (file)
@@ -6,7 +6,7 @@ function f(callable $c) {}
 f();
 ?>
 --EXPECTF--
-Fatal error: Uncaught Error: Too few arguments to function f(), 0 passed in %s on line 3 and exactly 1 expected in %s:2
+Fatal error: Uncaught ArgumentCountError: Too few arguments to function f(), 0 passed in %s on line 3 and exactly 1 expected in %s:2
 Stack trace:
 #0 %s(%d): f()
 #1 {main}
index 286b6f422580dc40c60e9d997ab192122a1dbcfe..882dd89b75c96977a9ec2a6d6888b109e84300f4 100644 (file)
@@ -19,7 +19,7 @@ try {
 
 ?>
 --EXPECTF--
-Fatal error: Uncaught Error: Too few arguments to function foo(), 0 passed in %sbug70689.php on line 12 and exactly 1 expected in %sbug70689.php:3
+Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo(), 0 passed in %sbug70689.php on line 12 and exactly 1 expected in %sbug70689.php:3
 Stack trace:
 #0 %sbug70689.php(12): foo()
 #1 {main}
diff --git a/Zend/tests/function_arguments/argument_count_correct.phpt b/Zend/tests/function_arguments/argument_count_correct.phpt
new file mode 100644 (file)
index 0000000..44a87b8
--- /dev/null
@@ -0,0 +1,20 @@
+--TEST--
+Call function with correct number of arguments
+--FILE--
+<?php
+function foo() { }
+foo();
+
+function bar($foo, $bar) { }
+bar(1, 2);
+
+function bat(int $foo, string $bar) { }
+bat(123, "foo");
+bat("123", "foo");
+
+$fp = fopen(__FILE__, "r");
+fclose($fp);
+
+echo "done";
+--EXPECT--
+done
\ No newline at end of file
diff --git a/Zend/tests/function_arguments/argument_count_correct_strict.phpt b/Zend/tests/function_arguments/argument_count_correct_strict.phpt
new file mode 100644 (file)
index 0000000..bfce61f
--- /dev/null
@@ -0,0 +1,20 @@
+--TEST--
+Call function with correct number of arguments with strict types
+--FILE--
+<?php
+declare(strict_types=1);
+function foo() { }
+foo();
+
+function bar($foo, $bar) { }
+bar(1, 2);
+
+function bat(int $foo, string $bar) { }
+bat(123, "foo");
+
+$fp = fopen(__FILE__, "r");
+fclose($fp);
+
+echo "done";
+--EXPECT--
+done
\ No newline at end of file
diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt
new file mode 100644 (file)
index 0000000..9d8d8bb
--- /dev/null
@@ -0,0 +1,10 @@
+--TEST--
+Call internal function with incorrect number of arguments
+--FILE--
+<?php
+substr("foo");
+array_diff([]);
+--EXPECTF--
+Warning: substr() expects at least 2 parameters, 1 given in %s
+
+Warning: array_diff(): at least 2 parameters are required, 1 given in %s
\ No newline at end of file
diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt
new file mode 100644 (file)
index 0000000..3374864
--- /dev/null
@@ -0,0 +1,18 @@
+--TEST--
+Call internal function with incorrect number of arguments with strict types
+--FILE--
+<?php
+declare(strict_types=1);
+try {
+       substr("foo");
+} catch (\Error $e) {
+       echo get_class($e) . PHP_EOL;
+       echo $e->getMessage() . PHP_EOL;
+}
+
+array_diff([]);
+--EXPECTF--
+ArgumentCountError
+substr() expects at least 2 parameters, 1 given
+
+Warning: array_diff(): at least 2 parameters are required, 1 given in %s
\ No newline at end of file
diff --git a/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt b/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt
new file mode 100644 (file)
index 0000000..97faa4e
--- /dev/null
@@ -0,0 +1,44 @@
+--TEST--
+Call userland function with incorrect number of arguments
+--FILE--
+<?php
+try {
+       function foo($bar) { }
+       foo();
+} catch (\Error $e) {
+       echo get_class($e) . PHP_EOL;
+       echo $e->getMessage() . PHP_EOL;
+}
+
+try {
+       function bar($foo, $bar) { }
+       bar(1);
+} catch (\Error $e) {
+       echo get_class($e) . PHP_EOL;
+       echo $e->getMessage() . PHP_EOL;
+}
+
+function bat(int $foo, string $bar) { }
+
+try {
+       bat(123);
+} catch (\Error $e) {
+       echo get_class($e) . PHP_EOL;
+       echo $e->getMessage() . PHP_EOL;
+}
+
+try {
+       bat("123");
+} catch (\Error $e) {
+       echo get_class($e) . PHP_EOL;
+       echo $e->getMessage() . PHP_EOL;
+}
+--EXPECTF--
+ArgumentCountError
+Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
+ArgumentCountError
+Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
+ArgumentCountError
+Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
+ArgumentCountError
+Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
\ No newline at end of file
diff --git a/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt
new file mode 100644 (file)
index 0000000..9029dc2
--- /dev/null
@@ -0,0 +1,54 @@
+--TEST--
+Call userland function with incorrect number of arguments with strict types
+--FILE--
+<?php
+declare(strict_types=1);
+try {
+       function foo($bar) { }
+       foo();
+} catch (\Error $e) {
+       echo get_class($e) . PHP_EOL;
+       echo $e->getMessage() . PHP_EOL;
+}
+
+try {
+       function bar($foo, $bar) { }
+       bar(1);
+} catch (\Error $e) {
+       echo get_class($e) . PHP_EOL;
+       echo $e->getMessage() . PHP_EOL;
+}
+
+function bat(int $foo, string $bar) { }
+
+try {
+       bat(123);
+} catch (\Error $e) {
+       echo get_class($e) . PHP_EOL;
+       echo $e->getMessage() . PHP_EOL;
+}
+
+try {
+       bat("123");
+} catch (\Error $e) {
+       echo get_class($e) . PHP_EOL;
+       echo $e->getMessage() . PHP_EOL;
+}
+
+try {
+       bat(123, 456);
+} catch (\Error $e) {
+       echo get_class($e) . PHP_EOL;
+       echo $e->getMessage() . PHP_EOL;
+}
+--EXPECTF--
+ArgumentCountError
+Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
+ArgumentCountError
+Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
+ArgumentCountError
+Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
+TypeError
+Argument 1 passed to bat() must be of the type integer, string given, called in %s
+TypeError
+Argument 2 passed to bat() must be of the type string, integer given, called in %s
\ No newline at end of file
index 5de93bb7d62562fd1c2a931e16241e2044814e10..3050feed53c754bd6a5e1c0344c42fc4326a80b6 100644 (file)
@@ -9,7 +9,7 @@ function f(?callable $p) {}
 f();
 
 --EXPECTF--
-Fatal error: Uncaught Error: Too few arguments to function f(), 0 passed in %snullable_type_parameters_do_not_have_default_value.php on line %d and exactly 1 expected in %s:%d
+Fatal error: Uncaught ArgumentCountError: Too few arguments to function f(), 0 passed in %snullable_type_parameters_do_not_have_default_value.php on line %d and exactly 1 expected in %s:%d
 Stack trace:
 #%d %s
 #%d %s
index 118bd6c4961ba900d55a42a5461682347fc7fd42..12801c8b70a322efca3f43ca53ea3a9e8dc05698 100644 (file)
@@ -1372,6 +1372,23 @@ ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, cons
        va_end(va);
 } /* }}} */
 
+ZEND_API ZEND_COLD void zend_internal_argument_count_error(zend_bool throw_exception, const char *format, ...) /* {{{ */
+{
+       va_list va;
+       char *message = NULL;
+
+       va_start(va, format);
+       zend_vspprintf(&message, 0, format, va);
+       if (throw_exception) {
+               zend_throw_exception(zend_ce_argument_count_error, message, 0);
+       } else {
+               zend_error(E_WARNING, "%s", message);
+       }
+       efree(message);
+
+       va_end(va);
+} /* }}} */
+
 ZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) /* {{{ */
 {
 #if ZEND_DEBUG
index 94f2fbdcf4d6f9d2cc3e751456e60cb491aece04..04c9052e28355c93683fd3885f64b0880d486f9b 100644 (file)
@@ -271,6 +271,7 @@ ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRI
 ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
 ZEND_API ZEND_COLD void zend_type_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2);
 ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
+ZEND_API ZEND_COLD void zend_internal_argument_count_error(zend_bool throw_exception, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
 
 ZEND_COLD void zenderror(const char *error);
 
index fb0194f4af59421f4e8de5aa96c7aa2f9d607646..c7727bdca7544448425131112f2db64b29380443 100644 (file)
@@ -157,7 +157,7 @@ ZEND_API ZEND_COLD void zend_wrong_param_count(void) /* {{{ */
        const char *space;
        const char *class_name = get_active_class_name(&space);
 
-       zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "Wrong parameter count for %s%s%s()", class_name, space, get_active_function_name());
+       zend_internal_argument_count_error(ZEND_ARG_USES_STRICT_TYPES(), "Wrong parameter count for %s%s%s()", class_name, space, get_active_function_name());
 }
 /* }}} */
 
@@ -208,14 +208,16 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(int num_
        zend_function *active_function = EG(current_execute_data)->func;
        const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
 
-       zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "%s%s%s() expects %s %d parameter%s, %d given",
-               class_name, \
-               class_name[0] ? "::" : "", \
-               ZSTR_VAL(active_function->common.function_name),
-               min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most",
-               num_args < min_num_args ? min_num_args : max_num_args,
-               (num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
-               num_args);
+       zend_internal_argument_count_error(
+                               ZEND_ARG_USES_STRICT_TYPES(), 
+                               "%s%s%s() expects %s %d parameter%s, %d given", 
+                               class_name, \
+                               class_name[0] ? "::" : "", \
+                               ZSTR_VAL(active_function->common.function_name),
+                               min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most",
+                               num_args < min_num_args ? min_num_args : max_num_args,
+                               (num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
+                               num_args);
 }
 /* }}} */
 
@@ -875,7 +877,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
                        zend_function *active_function = EG(current_execute_data)->func;
                        const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
                        zend_bool throw_exception = ZEND_ARG_USES_STRICT_TYPES() || (flags & ZEND_PARSE_PARAMS_THROW);
-                       zend_internal_type_error(throw_exception, "%s%s%s() expects %s %d parameter%s, %d given",
+                       zend_internal_argument_count_error(throw_exception, "%s%s%s() expects %s %d parameter%s, %d given",
                                        class_name,
                                        class_name[0] ? "::" : "",
                                        ZSTR_VAL(active_function->common.function_name),
index 5301850310ef15a438efb698bbf3ae4d08ab8574..dc073de63391bbd5056143b638bf0020128f96ef 100644 (file)
@@ -36,6 +36,7 @@ ZEND_API zend_class_entry *zend_ce_error_exception;
 ZEND_API zend_class_entry *zend_ce_error;
 ZEND_API zend_class_entry *zend_ce_parse_error;
 ZEND_API zend_class_entry *zend_ce_type_error;
+ZEND_API zend_class_entry *zend_ce_argument_count_error;
 ZEND_API zend_class_entry *zend_ce_arithmetic_error;
 ZEND_API zend_class_entry *zend_ce_division_by_zero_error;
 
@@ -709,7 +710,7 @@ ZEND_METHOD(exception, __toString)
                        ZVAL_UNDEF(&trace);
                }
 
-               if (Z_OBJCE_P(exception) == zend_ce_type_error && strstr(ZSTR_VAL(message), ", called in ")) {
+               if ((Z_OBJCE_P(exception) == zend_ce_type_error || Z_OBJCE_P(exception) == zend_ce_argument_count_error) && strstr(ZSTR_VAL(message), ", called in ")) {
                        zend_string *real_message = zend_strpprintf(0, "%s and defined", ZSTR_VAL(message));
                        zend_string_release(message);
                        message = real_message;
@@ -859,6 +860,10 @@ void zend_register_default_exception(void) /* {{{ */
        zend_ce_type_error = zend_register_internal_class_ex(&ce, zend_ce_error);
        zend_ce_type_error->create_object = zend_default_exception_new;
 
+       INIT_CLASS_ENTRY(ce, "ArgumentCountError", NULL);
+       zend_ce_argument_count_error = zend_register_internal_class_ex(&ce, zend_ce_type_error);
+       zend_ce_argument_count_error->create_object = zend_default_exception_new;
+
        INIT_CLASS_ENTRY(ce, "ArithmeticError", NULL);
        zend_ce_arithmetic_error = zend_register_internal_class_ex(&ce, zend_ce_error);
        zend_ce_arithmetic_error->create_object = zend_default_exception_new;
index 04857f29fab113f4645b9cc984672c7aa6a3fc77..18caf35553986d31009a421f4ecf7f96aaf44ce4 100644 (file)
@@ -32,6 +32,7 @@ extern ZEND_API zend_class_entry *zend_ce_error_exception;
 extern ZEND_API zend_class_entry *zend_ce_error;
 extern ZEND_API zend_class_entry *zend_ce_parse_error;
 extern ZEND_API zend_class_entry *zend_ce_type_error;
+extern ZEND_API zend_class_entry *zend_ce_argument_count_error;
 extern ZEND_API zend_class_entry *zend_ce_arithmetic_error;
 extern ZEND_API zend_class_entry *zend_ce_division_by_zero_error;
 
index f0f249e243435566242cb809bf034ee2d39db871..c748a777111cb36adab4582db256db21053ea85e 100644 (file)
@@ -696,20 +696,24 @@ static ZEND_COLD void zend_verify_arg_error(
        const char *fname, *fsep, *fclass;
        const char *need_msg, *need_kind, *need_or_null, *given_msg, *given_kind;
 
-       zend_verify_type_error_common(
-               zf, arg_info, ce, value,
-               &fname, &fsep, &fclass, &need_msg, &need_kind, &need_or_null, &given_msg, &given_kind);
-
-       if (zf->common.type == ZEND_USER_FUNCTION) {
-               if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
-                       zend_type_error("Argument %d passed to %s%s%s() must %s%s%s, %s%s given, called in %s on line %d",
-                                       arg_num, fclass, fsep, fname, need_msg, need_kind, need_or_null, given_msg, given_kind,
-                                       ZSTR_VAL(ptr->func->op_array.filename), ptr->opline->lineno);
+       if (value) {
+               zend_verify_type_error_common(
+                       zf, arg_info, ce, value,
+                       &fname, &fsep, &fclass, &need_msg, &need_kind, &need_or_null, &given_msg, &given_kind);
+
+               if (zf->common.type == ZEND_USER_FUNCTION) {
+                       if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
+                               zend_type_error("Argument %d passed to %s%s%s() must %s%s%s, %s%s given, called in %s on line %d",
+                                               arg_num, fclass, fsep, fname, need_msg, need_kind, need_or_null, given_msg, given_kind,
+                                               ZSTR_VAL(ptr->func->op_array.filename), ptr->opline->lineno);
+                       } else {
+                               zend_type_error("Argument %d passed to %s%s%s() must %s%s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, need_or_null, given_msg, given_kind);
+                       }
                } else {
                        zend_type_error("Argument %d passed to %s%s%s() must %s%s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, need_or_null, given_msg, given_kind);
                }
        } else {
-               zend_type_error("Argument %d passed to %s%s%s() must %s%s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, need_or_null, given_msg, given_kind);
+               zend_missing_arg_error(ptr);
        }
 }
 
@@ -955,7 +959,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *
        zend_execute_data *ptr = EX(prev_execute_data);
 
        if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
-               zend_throw_error(NULL, "Too few arguments to function %s%s%s(), %d passed in %s on line %d and %s %d expected",
+               zend_throw_error(zend_ce_argument_count_error, "Too few arguments to function %s%s%s(), %d passed in %s on line %d and %s %d expected",
                        EX(func)->common.scope ? ZSTR_VAL(EX(func)->common.scope->name) : "",
                        EX(func)->common.scope ? "::" : "",
                        ZSTR_VAL(EX(func)->common.function_name),
@@ -965,7 +969,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *
                        EX(func)->common.required_num_args == EX(func)->common.num_args ? "exactly" : "at least",
                        EX(func)->common.required_num_args);
        } else {
-               zend_throw_error(NULL, "Too few arguments to function %s%s%s(), %d passed and %s %d expected",
+               zend_throw_error(zend_ce_argument_count_error, "Too few arguments to function %s%s%s(), %d passed and %s %d expected",
                        EX(func)->common.scope ? ZSTR_VAL(EX(func)->common.scope->name) : "",
                        EX(func)->common.scope ? "::" : "",
                        ZSTR_VAL(EX(func)->common.function_name),
index c9d1e6379a91d322d30398d201a58c7c0f9542b7..eec5a3e618e5a79e8faecc9cae5295a90cf8c379 100644 (file)
@@ -25,7 +25,7 @@ var_dump($methodWithArgs->invokeArgs($testClassInstance, array()));
 --EXPECTF--
 Method with args:
 
-Fatal error: Uncaught Error: Too few arguments to function TestClass::methodWithArgs(), 0 passed and exactly 2 expected in %sReflectionMethod_invokeArgs_error1.php:5
+Fatal error: Uncaught ArgumentCountError: Too few arguments to function TestClass::methodWithArgs(), 0 passed and exactly 2 expected in %sReflectionMethod_invokeArgs_error1.php:5
 Stack trace:
 #0 [internal function]: TestClass->methodWithArgs()
 #1 %sReflectionMethod_invokeArgs_error1.php(19): ReflectionMethod->invokeArgs(Object(TestClass), Array)
index 60a9ebae974ca09fe35769d059c20c4bdebbc3bf..5dba208bebc7b719fd08a55790128027031ef396 100644 (file)
@@ -21,7 +21,7 @@ var_dump($methodWithArgs->invoke($testClassInstance));
 --EXPECTF--
 Method with args:
 
-Fatal error: Uncaught Error: Too few arguments to function TestClass::methodWithArgs(), 0 passed and exactly 2 expected in %sReflectionMethod_invoke_error2.php:5
+Fatal error: Uncaught ArgumentCountError: Too few arguments to function TestClass::methodWithArgs(), 0 passed and exactly 2 expected in %sReflectionMethod_invoke_error2.php:5
 Stack trace:
 #0 [internal function]: TestClass->methodWithArgs()
 #1 %sReflectionMethod_invoke_error2.php(15): ReflectionMethod->invoke(Object(TestClass))
index 7861d435c83e499a4293b889bdd97f86843b4cda..f9018db05b0c73292438a0e716679d438a0d1dcc 100644 (file)
@@ -24,7 +24,7 @@ int(0)
 
 Warning: assert(): Assertion "0 != 0" failed in %s on line 9
 
-Fatal error: Uncaught Error: Too few arguments to function f1(), 3 passed and exactly 4 expected in %sassert_error2.php:2
+Fatal error: Uncaught ArgumentCountError: Too few arguments to function f1(), 3 passed and exactly 4 expected in %sassert_error2.php:2
 Stack trace:
 #0 [internal function]: f1('%s', 9, '0 != 0')
 #1 %sassert_error2.php(9): assert('0 != 0')
index 07c5958ab4ef84ce4f80bbf54d1cdc445b310709..a72a00310dce65c9ea889b4b6b1e164de8450cab 100644 (file)
@@ -104,7 +104,7 @@ 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: Uncaught Error: Too few arguments to function VariableStream::__construct(), 0 passed and exactly 1 expected in %sbug38450_3.php:7
+Fatal error: Uncaught ArgumentCountError: Too few arguments to function VariableStream::__construct(), 0 passed and exactly 1 expected in %sbug38450_3.php:7
 Stack trace:
 #0 [internal function]: VariableStream->__construct()
 #1 %s(%d): fopen('var://myvar', 'r+')
index e66a86491c21d67e5f54620321b8df5165f443dc..28680096c5bdaea80ad38ae8b6283ed93b7ebd15 100644 (file)
@@ -23,7 +23,7 @@ $obj = new MyTestClass;
 ===DONE===
 --EXPECTF--
 
-Fatal error: Uncaught Error: Too few arguments to function MyTestClass::__construct(), 0 passed in %sinterfaces_003.php on line 17 and exactly 1 expected in %sinterfaces_003.php:12
+Fatal error: Uncaught ArgumentCountError: Too few arguments to function MyTestClass::__construct(), 0 passed in %sinterfaces_003.php on line 17 and exactly 1 expected in %sinterfaces_003.php:12
 Stack trace:
 #0 %s(%d): MyTestClass->__construct()
 #1 {main}