From 2a7eeff33e6b798c0b36a0a0e52fbf8c3197f4e9 Mon Sep 17 00:00:00 2001 From: Levi Morrison Date: Tue, 20 Oct 2015 10:50:13 -0600 Subject: [PATCH] Remove mentions of "type hint" and "typehint" --- Zend/tests/bug42802.phpt | 2 +- Zend/tests/bug69767.phpt | 2 +- Zend/tests/closure_059.phpt | 2 +- Zend/tests/errmsg_013.phpt | 4 ++-- Zend/tests/generators/get_return.phpt | 2 +- Zend/tests/ns_055.phpt | 2 +- .../return_types/internal_functions001.phpt | 2 +- .../return_types/internal_functions002.phpt | 2 +- Zend/tests/return_types/reflection001.phpt | 2 +- .../add_return_type.phpt | 0 .../array_001.phpt} | 6 +++--- .../callable_001.phpt} | 4 ++-- .../callable_002.phpt} | 2 +- .../callable_003.phpt} | 2 +- .../closure_with_variadic.phpt} | 2 +- .../default_boolean_hint_values.phpt | 0 .../explicit_weak_include_strict.phpt | 0 .../inexistent_class_hint_with_scalar_arg.phpt | 2 +- .../internal_function_strict_mode.phpt | 4 ++-- .../return_separation.phpt | 0 .../scalar_basic.phpt | 12 ++++++------ .../scalar_constant_defaults.phpt | 4 ++-- .../scalar_constant_defaults_error.phpt | 4 ++-- ...scalar_float_with_integer_default_strict.phpt | 2 +- .../scalar_float_with_integer_default_weak.phpt | 2 +- .../scalar_float_with_invalid_default.phpt | 16 ++++++++++++++++ .../scalar_none.phpt | 2 +- .../scalar_null.phpt | 2 +- .../scalar_relative_typehint_disallowed.phpt | 2 +- .../scalar_reserved2.phpt | 2 +- .../scalar_reserved2_class_alias.phpt | 2 +- .../scalar_reserved2_use.phpt | 2 +- .../scalar_reserved3.phpt | 2 +- .../scalar_reserved3_class_alias.phpt | 2 +- .../scalar_reserved3_use.phpt | 2 +- .../scalar_reserved4.phpt | 2 +- .../scalar_reserved4_class_alias.phpt | 2 +- .../scalar_reserved4_use.phpt | 2 +- .../scalar_reserved6.phpt | 2 +- .../scalar_reserved6_class_alias.phpt | 2 +- .../scalar_reserved6_use.phpt | 2 +- .../scalar_reserved7.phpt | 2 +- .../scalar_return_basic.phpt | 12 ++++++------ .../scalar_return_basic_64bit.phpt | 12 ++++++------ .../scalar_strict.phpt | 12 ++++++------ .../scalar_strict_64bit.phpt | 12 ++++++------ .../scalar_strict_basic.phpt | 12 ++++++------ .../scalar_strict_declaration_placement_001.phpt | 0 .../scalar_strict_declaration_placement_002.phpt | 0 .../scalar_strict_declaration_placement_003.phpt | 0 .../scalar_strict_declaration_placement_004.phpt | 0 .../scalar_strict_declaration_placement_005.phpt | 0 .../scalar_strict_declaration_placement_006.phpt | 0 .../scalar_strict_declaration_placement_007.phpt | 0 .../scalar_strict_declaration_placement_008.phpt | 0 .../scalar_weak_reference.phpt | 4 ++-- .../self_on_closure_in_method.phpt | 0 .../strict_call_weak.phpt | 0 .../strict_call_weak_2.inc | 0 .../strict_call_weak_explicit.phpt | 0 .../strict_call_weak_explicit_2.inc | 0 .../strict_include_explicit_weak.phpt | 0 .../strict_include_explicit_weak_2.inc | 0 .../strict_include_weak.phpt | 0 .../strict_include_weak_2.inc | 0 .../strict_nested.phpt | 0 .../weak_call_strict.phpt | 0 .../weak_call_strict_2.inc | 0 .../weak_explicit_call_strict.phpt | 0 .../weak_include_strict.phpt | 0 .../weak_include_strict_2.inc | 0 .../scalar_float_with_invalid_default.phpt | 16 ---------------- Zend/tests/variadic/typehint_error.phpt | 2 +- .../variadic/typehint_suppressed_error.phpt | 2 +- Zend/zend_compile.c | 12 ++++++------ Zend/zend_compile.h | 6 +++--- Zend/zend_inheritance.c | 4 ++-- tests/lang/type_hints_003.phpt | 4 ++-- 78 files changed, 112 insertions(+), 112 deletions(-) rename Zend/tests/{typehints => type_declarations}/add_return_type.phpt (100%) rename Zend/tests/{array_type_hint_001.phpt => type_declarations/array_001.phpt} (54%) rename Zend/tests/{callable_type_hint_001.phpt => type_declarations/callable_001.phpt} (87%) rename Zend/tests/{callable_type_hint_002.phpt => type_declarations/callable_002.phpt} (92%) rename Zend/tests/{callable_type_hint_003.phpt => type_declarations/callable_003.phpt} (92%) rename Zend/tests/{closure_with_variadic_typehint.phpt => type_declarations/closure_with_variadic.phpt} (80%) rename Zend/tests/{typehints => type_declarations}/default_boolean_hint_values.phpt (100%) rename Zend/tests/{typehints => type_declarations}/explicit_weak_include_strict.phpt (100%) rename Zend/tests/{typehints => type_declarations}/inexistent_class_hint_with_scalar_arg.phpt (84%) rename Zend/tests/{typehints => type_declarations}/internal_function_strict_mode.phpt (94%) rename Zend/tests/{typehints => type_declarations}/return_separation.phpt (100%) rename Zend/tests/{typehints => type_declarations}/scalar_basic.phpt (97%) rename Zend/tests/{typehints => type_declarations}/scalar_constant_defaults.phpt (97%) rename Zend/tests/{typehints => type_declarations}/scalar_constant_defaults_error.phpt (80%) rename Zend/tests/{typehints => type_declarations}/scalar_float_with_integer_default_strict.phpt (65%) rename Zend/tests/{typehints => type_declarations}/scalar_float_with_integer_default_weak.phpt (68%) create mode 100644 Zend/tests/type_declarations/scalar_float_with_invalid_default.phpt rename Zend/tests/{typehints => type_declarations}/scalar_none.phpt (97%) rename Zend/tests/{typehints => type_declarations}/scalar_null.phpt (98%) rename Zend/tests/{typehints => type_declarations}/scalar_relative_typehint_disallowed.phpt (79%) rename Zend/tests/{typehints => type_declarations}/scalar_reserved2.phpt (62%) rename Zend/tests/{typehints => type_declarations}/scalar_reserved2_class_alias.phpt (64%) rename Zend/tests/{typehints => type_declarations}/scalar_reserved2_use.phpt (64%) rename Zend/tests/{typehints => type_declarations}/scalar_reserved3.phpt (63%) rename Zend/tests/{typehints => type_declarations}/scalar_reserved3_class_alias.phpt (64%) rename Zend/tests/{typehints => type_declarations}/scalar_reserved3_use.phpt (65%) rename Zend/tests/{typehints => type_declarations}/scalar_reserved4.phpt (63%) rename Zend/tests/{typehints => type_declarations}/scalar_reserved4_class_alias.phpt (64%) rename Zend/tests/{typehints => type_declarations}/scalar_reserved4_use.phpt (65%) rename Zend/tests/{typehints => type_declarations}/scalar_reserved6.phpt (62%) rename Zend/tests/{typehints => type_declarations}/scalar_reserved6_class_alias.phpt (64%) rename Zend/tests/{typehints => type_declarations}/scalar_reserved6_use.phpt (64%) rename Zend/tests/{typehints => type_declarations}/scalar_reserved7.phpt (65%) rename Zend/tests/{typehints => type_declarations}/scalar_return_basic.phpt (96%) rename Zend/tests/{typehints => type_declarations}/scalar_return_basic_64bit.phpt (96%) rename Zend/tests/{typehints => type_declarations}/scalar_strict.phpt (97%) rename Zend/tests/{typehints => type_declarations}/scalar_strict_64bit.phpt (97%) rename Zend/tests/{typehints => type_declarations}/scalar_strict_basic.phpt (96%) rename Zend/tests/{typehints => type_declarations}/scalar_strict_declaration_placement_001.phpt (100%) rename Zend/tests/{typehints => type_declarations}/scalar_strict_declaration_placement_002.phpt (100%) rename Zend/tests/{typehints => type_declarations}/scalar_strict_declaration_placement_003.phpt (100%) rename Zend/tests/{typehints => type_declarations}/scalar_strict_declaration_placement_004.phpt (100%) rename Zend/tests/{typehints => type_declarations}/scalar_strict_declaration_placement_005.phpt (100%) rename Zend/tests/{typehints => type_declarations}/scalar_strict_declaration_placement_006.phpt (100%) rename Zend/tests/{typehints => type_declarations}/scalar_strict_declaration_placement_007.phpt (100%) rename Zend/tests/{typehints => type_declarations}/scalar_strict_declaration_placement_008.phpt (100%) rename Zend/tests/{typehints => type_declarations}/scalar_weak_reference.phpt (76%) rename Zend/tests/{typehints => type_declarations}/self_on_closure_in_method.phpt (100%) rename Zend/tests/{typehints => type_declarations}/strict_call_weak.phpt (100%) rename Zend/tests/{typehints => type_declarations}/strict_call_weak_2.inc (100%) rename Zend/tests/{typehints => type_declarations}/strict_call_weak_explicit.phpt (100%) rename Zend/tests/{typehints => type_declarations}/strict_call_weak_explicit_2.inc (100%) rename Zend/tests/{typehints => type_declarations}/strict_include_explicit_weak.phpt (100%) rename Zend/tests/{typehints => type_declarations}/strict_include_explicit_weak_2.inc (100%) rename Zend/tests/{typehints => type_declarations}/strict_include_weak.phpt (100%) rename Zend/tests/{typehints => type_declarations}/strict_include_weak_2.inc (100%) rename Zend/tests/{typehints => type_declarations}/strict_nested.phpt (100%) rename Zend/tests/{typehints => type_declarations}/weak_call_strict.phpt (100%) rename Zend/tests/{typehints => type_declarations}/weak_call_strict_2.inc (100%) rename Zend/tests/{typehints => type_declarations}/weak_explicit_call_strict.phpt (100%) rename Zend/tests/{typehints => type_declarations}/weak_include_strict.phpt (100%) rename Zend/tests/{typehints => type_declarations}/weak_include_strict_2.inc (100%) delete mode 100644 Zend/tests/typehints/scalar_float_with_invalid_default.phpt diff --git a/Zend/tests/bug42802.phpt b/Zend/tests/bug42802.phpt index 3b00408e01..ebfb528827 100644 --- a/Zend/tests/bug42802.phpt +++ b/Zend/tests/bug42802.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #42802 (Namespace not supported in typehints) +Bug #42802 (Namespace not supported in types) --FILE-- --EXPECTF-- -Fatal error: Default value for parameters with a string type hint can only be string or NULL in %sbug69767.php on line %d +Fatal error: Default value for parameters with a string type can only be string or NULL in %sbug69767.php on line %d diff --git a/Zend/tests/closure_059.phpt b/Zend/tests/closure_059.phpt index 1ee7fe6695..299d8f5d9d 100644 --- a/Zend/tests/closure_059.phpt +++ b/Zend/tests/closure_059.phpt @@ -1,5 +1,5 @@ --TEST-- -Closure 059: Closure type hinting +Closure 059: Closure type declaration --FILE-- --EXPECTF-- -Fatal error: Default value for parameters with array type hint can only be an array or NULL in %s on line %d +Fatal error: Default value for parameters with array type can only be an array or NULL in %s on line %d diff --git a/Zend/tests/generators/get_return.phpt b/Zend/tests/generators/get_return.phpt index c996eb4101..0d3e32af14 100644 --- a/Zend/tests/generators/get_return.phpt +++ b/Zend/tests/generators/get_return.phpt @@ -58,7 +58,7 @@ $gen->next(); var_dump($gen->getReturn()); // Explicit value-less return also results in a NULL generator -// return value and there is no interference with type hints +// return value and there is no interference with type declarations function gen6() : Generator { return; yield 24; diff --git a/Zend/tests/ns_055.phpt b/Zend/tests/ns_055.phpt index a692e47601..16e3e69777 100644 --- a/Zend/tests/ns_055.phpt +++ b/Zend/tests/ns_055.phpt @@ -1,5 +1,5 @@ --TEST-- -055: typehints in namespaces +055: types in namespaces --FILE-- string(3) "bar" diff --git a/Zend/tests/callable_type_hint_002.phpt b/Zend/tests/type_declarations/callable_002.phpt similarity index 92% rename from Zend/tests/callable_type_hint_002.phpt rename to Zend/tests/type_declarations/callable_002.phpt index b1b7339c31..01b6945755 100644 --- a/Zend/tests/callable_type_hint_002.phpt +++ b/Zend/tests/type_declarations/callable_002.phpt @@ -1,5 +1,5 @@ --TEST-- -callable type hint#002 - Reflection +callable type#002 - Reflection --FILE-- $function) { - echo PHP_EOL, "Testing '$type' typehint:", PHP_EOL; + echo PHP_EOL, "Testing '$type' type:", PHP_EOL; foreach ($values as $value) { echo PHP_EOL . "*** Trying "; var_dump($value); @@ -60,7 +60,7 @@ echo PHP_EOL . "Done"; ?> --EXPECTF-- -Testing 'int' typehint: +Testing 'int' type: *** Trying int(1) int(1) @@ -114,7 +114,7 @@ int(0) *** Trying resource(%d) of type (stream) *** Caught Argument 1 passed to {closure}() must be of the type integer, resource given, called in %s on line %d -Testing 'float' typehint: +Testing 'float' type: *** Trying int(1) float(1) @@ -168,7 +168,7 @@ float(0) *** Trying resource(%d) of type (stream) *** Caught Argument 1 passed to {closure}() must be of the type float, resource given, called in %s on line %d -Testing 'string' typehint: +Testing 'string' type: *** Trying int(1) string(1) "1" @@ -221,7 +221,7 @@ string(6) "foobar" *** Trying resource(%d) of type (stream) *** Caught Argument 1 passed to {closure}() must be of the type string, resource given, called in %s on line %d -Testing 'bool' typehint: +Testing 'bool' type: *** Trying int(1) bool(true) diff --git a/Zend/tests/typehints/scalar_constant_defaults.phpt b/Zend/tests/type_declarations/scalar_constant_defaults.phpt similarity index 97% rename from Zend/tests/typehints/scalar_constant_defaults.phpt rename to Zend/tests/type_declarations/scalar_constant_defaults.phpt index 4441022e16..2982d9b2af 100644 --- a/Zend/tests/typehints/scalar_constant_defaults.phpt +++ b/Zend/tests/type_declarations/scalar_constant_defaults.phpt @@ -1,5 +1,5 @@ --TEST-- -Scalar type hint - default via constants +Scalar type - default via constants --FILE-- +--EXPECTF-- + +Fatal error: Default value for parameters with a float type can only be float, integer, or NULL in %s on line %d diff --git a/Zend/tests/typehints/scalar_none.phpt b/Zend/tests/type_declarations/scalar_none.phpt similarity index 97% rename from Zend/tests/typehints/scalar_none.phpt rename to Zend/tests/type_declarations/scalar_none.phpt index 5a98377022..3bec609599 100644 --- a/Zend/tests/typehints/scalar_none.phpt +++ b/Zend/tests/type_declarations/scalar_none.phpt @@ -1,5 +1,5 @@ --TEST-- -Scalar type hint missing parameters +Scalar type missing parameters --FILE-- --FILE-- @@ -48,7 +48,7 @@ $values = [ ]; foreach ($functions as $type => $function) { - echo PHP_EOL, "Testing '$type' typehint:", PHP_EOL; + echo PHP_EOL, "Testing '$type' type:", PHP_EOL; foreach ($values as $value) { echo "*** Trying "; var_dump($value); @@ -63,7 +63,7 @@ foreach ($functions as $type => $function) { echo PHP_EOL . "Done"; ?> --EXPECTF-- -Testing 'int' typehint: +Testing 'int' type: *** Trying int(1) int(1) *** Trying string(1) "1" @@ -101,7 +101,7 @@ int(0) *** Trying resource(5) of type (stream) *** Caught Return value of {closure}() must be of the type integer, resource returned in %s on line %d -Testing 'float' typehint: +Testing 'float' type: *** Trying int(1) float(1) *** Trying string(1) "1" @@ -139,7 +139,7 @@ float(0) *** Trying resource(5) of type (stream) *** Caught Return value of {closure}() must be of the type float, resource returned in %s on line %d -Testing 'string' typehint: +Testing 'string' type: *** Trying int(1) string(1) "1" *** Trying string(1) "1" @@ -176,7 +176,7 @@ string(6) "foobar" *** Trying resource(5) of type (stream) *** Caught Return value of {closure}() must be of the type string, resource returned in %s on line %d -Testing 'bool' typehint: +Testing 'bool' type: *** Trying int(1) bool(true) *** Trying string(1) "1" diff --git a/Zend/tests/typehints/scalar_return_basic_64bit.phpt b/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt similarity index 96% rename from Zend/tests/typehints/scalar_return_basic_64bit.phpt rename to Zend/tests/type_declarations/scalar_return_basic_64bit.phpt index fc7401ed24..e8f69bc699 100644 --- a/Zend/tests/typehints/scalar_return_basic_64bit.phpt +++ b/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt @@ -1,5 +1,5 @@ --TEST-- -Return scalar type hint basics +Return scalar type basics --SKIPIF-- --FILE-- @@ -48,7 +48,7 @@ $values = [ ]; foreach ($functions as $type => $function) { - echo PHP_EOL, "Testing '$type' typehint:", PHP_EOL; + echo PHP_EOL, "Testing '$type' type:", PHP_EOL; foreach ($values as $value) { echo "*** Trying "; var_dump($value); @@ -63,7 +63,7 @@ foreach ($functions as $type => $function) { echo PHP_EOL . "Done"; ?> --EXPECTF-- -Testing 'int' typehint: +Testing 'int' type: *** Trying int(1) int(1) *** Trying string(1) "1" @@ -101,7 +101,7 @@ int(0) *** Trying resource(5) of type (stream) *** Caught Return value of {closure}() must be of the type integer, resource returned in %s on line %d -Testing 'float' typehint: +Testing 'float' type: *** Trying int(1) float(1) *** Trying string(1) "1" @@ -139,7 +139,7 @@ float(0) *** Trying resource(5) of type (stream) *** Caught Return value of {closure}() must be of the type float, resource returned in %s on line %d -Testing 'string' typehint: +Testing 'string' type: *** Trying int(1) string(1) "1" *** Trying string(1) "1" @@ -176,7 +176,7 @@ string(6) "foobar" *** Trying resource(5) of type (stream) *** Caught Return value of {closure}() must be of the type string, resource returned in %s on line %d -Testing 'bool' typehint: +Testing 'bool' type: *** Trying int(1) bool(true) *** Trying string(1) "1" diff --git a/Zend/tests/typehints/scalar_strict.phpt b/Zend/tests/type_declarations/scalar_strict.phpt similarity index 97% rename from Zend/tests/typehints/scalar_strict.phpt rename to Zend/tests/type_declarations/scalar_strict.phpt index 59ec45ac4f..40b036e1d4 100644 --- a/Zend/tests/typehints/scalar_strict.phpt +++ b/Zend/tests/type_declarations/scalar_strict.phpt @@ -1,5 +1,5 @@ --TEST-- -Scalar type hint strict mode +Scalar type strict mode --SKIPIF-- --FILE-- @@ -49,7 +49,7 @@ $values = [ ]; foreach ($functions as $type => $function) { - echo PHP_EOL, "Testing '$type' typehint:", PHP_EOL; + echo PHP_EOL, "Testing '$type' type:", PHP_EOL; foreach ($values as $value) { echo PHP_EOL . "*** Trying "; var_dump($value); @@ -64,7 +64,7 @@ foreach ($functions as $type => $function) { echo PHP_EOL . "Done"; ?> --EXPECTF-- -Testing 'int' typehint: +Testing 'int' type: *** Trying int(1) int(1) @@ -117,7 +117,7 @@ int(2147483647) *** Trying resource(5) of type (stream) *** Caught Argument 1 passed to {closure}() must be of the type integer, resource given, called in %s on line %d -Testing 'float' typehint: +Testing 'float' type: *** Trying int(1) float(1) @@ -170,7 +170,7 @@ float(NAN) *** Trying resource(5) of type (stream) *** Caught Argument 1 passed to {closure}() must be of the type float, resource given, called in %s on line %d -Testing 'string' typehint: +Testing 'string' type: *** Trying int(1) *** Caught Argument 1 passed to {closure}() must be of the type string, integer given, called in %s on line %d @@ -223,7 +223,7 @@ string(0) "" *** Trying resource(5) of type (stream) *** Caught Argument 1 passed to {closure}() must be of the type string, resource given, called in %s on line %d -Testing 'bool' typehint: +Testing 'bool' type: *** Trying int(1) *** Caught Argument 1 passed to {closure}() must be of the type boolean, integer given, called in %s on line %d diff --git a/Zend/tests/typehints/scalar_strict_64bit.phpt b/Zend/tests/type_declarations/scalar_strict_64bit.phpt similarity index 97% rename from Zend/tests/typehints/scalar_strict_64bit.phpt rename to Zend/tests/type_declarations/scalar_strict_64bit.phpt index 4671b07609..3e748ede34 100644 --- a/Zend/tests/typehints/scalar_strict_64bit.phpt +++ b/Zend/tests/type_declarations/scalar_strict_64bit.phpt @@ -1,5 +1,5 @@ --TEST-- -Scalar type hint strict mode +Scalar type strict mode --SKIPIF-- --FILE-- @@ -49,7 +49,7 @@ $values = [ ]; foreach ($functions as $type => $function) { - echo PHP_EOL, "Testing '$type' typehint:", PHP_EOL; + echo PHP_EOL, "Testing '$type' type:", PHP_EOL; foreach ($values as $value) { echo PHP_EOL . "*** Trying "; var_dump($value); @@ -64,7 +64,7 @@ foreach ($functions as $type => $function) { echo PHP_EOL . "Done"; ?> --EXPECTF-- -Testing 'int' typehint: +Testing 'int' type: *** Trying int(1) int(1) @@ -117,7 +117,7 @@ int(9223372036854775807) *** Trying resource(5) of type (stream) *** Caught Argument 1 passed to {closure}() must be of the type integer, resource given, called in %s on line %d -Testing 'float' typehint: +Testing 'float' type: *** Trying int(1) float(1) @@ -170,7 +170,7 @@ float(NAN) *** Trying resource(5) of type (stream) *** Caught Argument 1 passed to {closure}() must be of the type float, resource given, called in %s on line %d -Testing 'string' typehint: +Testing 'string' type: *** Trying int(1) *** Caught Argument 1 passed to {closure}() must be of the type string, integer given, called in %s on line %d @@ -223,7 +223,7 @@ string(0) "" *** Trying resource(5) of type (stream) *** Caught Argument 1 passed to {closure}() must be of the type string, resource given, called in %s on line %d -Testing 'bool' typehint: +Testing 'bool' type: *** Trying int(1) *** Caught Argument 1 passed to {closure}() must be of the type boolean, integer given, called in %s on line %d diff --git a/Zend/tests/typehints/scalar_strict_basic.phpt b/Zend/tests/type_declarations/scalar_strict_basic.phpt similarity index 96% rename from Zend/tests/typehints/scalar_strict_basic.phpt rename to Zend/tests/type_declarations/scalar_strict_basic.phpt index 15030e1c86..3ee94a2059 100644 --- a/Zend/tests/typehints/scalar_strict_basic.phpt +++ b/Zend/tests/type_declarations/scalar_strict_basic.phpt @@ -1,5 +1,5 @@ --TEST-- -Strict scalar type hint basics +Strict scalar type basics --FILE-- $function) { - echo PHP_EOL, "Testing '$type' typehint:", PHP_EOL; + echo PHP_EOL, "Testing '$type' type:", PHP_EOL; foreach ($values as $value) { $errored = false; echo PHP_EOL . "*** Trying ", type($value), " value", PHP_EOL; @@ -62,7 +62,7 @@ foreach ($functions as $type => $function) { echo PHP_EOL . "Done"; ?> --EXPECTF-- -Testing 'int' typehint: +Testing 'int' type: *** Trying integer value int(1) @@ -91,7 +91,7 @@ int(1) *** Trying resource value *** Caught Argument 1 passed to {closure}() must be of the type integer, resource given, called in %s on line %d -Testing 'float' typehint: +Testing 'float' type: *** Trying integer value float(1) @@ -120,7 +120,7 @@ float(1) *** Trying resource value *** Caught Argument 1 passed to {closure}() must be of the type float, resource given, called in %s on line %d -Testing 'string' typehint: +Testing 'string' type: *** Trying integer value *** Caught Argument 1 passed to {closure}() must be of the type string, integer given, called in %s on line %d @@ -149,7 +149,7 @@ string(1) "1" *** Trying resource value *** Caught Argument 1 passed to {closure}() must be of the type string, resource given, called in %s on line %d -Testing 'bool' typehint: +Testing 'bool' type: *** Trying integer value *** Caught Argument 1 passed to {closure}() must be of the type boolean, integer given, called in %s on line %d diff --git a/Zend/tests/typehints/scalar_strict_declaration_placement_001.phpt b/Zend/tests/type_declarations/scalar_strict_declaration_placement_001.phpt similarity index 100% rename from Zend/tests/typehints/scalar_strict_declaration_placement_001.phpt rename to Zend/tests/type_declarations/scalar_strict_declaration_placement_001.phpt diff --git a/Zend/tests/typehints/scalar_strict_declaration_placement_002.phpt b/Zend/tests/type_declarations/scalar_strict_declaration_placement_002.phpt similarity index 100% rename from Zend/tests/typehints/scalar_strict_declaration_placement_002.phpt rename to Zend/tests/type_declarations/scalar_strict_declaration_placement_002.phpt diff --git a/Zend/tests/typehints/scalar_strict_declaration_placement_003.phpt b/Zend/tests/type_declarations/scalar_strict_declaration_placement_003.phpt similarity index 100% rename from Zend/tests/typehints/scalar_strict_declaration_placement_003.phpt rename to Zend/tests/type_declarations/scalar_strict_declaration_placement_003.phpt diff --git a/Zend/tests/typehints/scalar_strict_declaration_placement_004.phpt b/Zend/tests/type_declarations/scalar_strict_declaration_placement_004.phpt similarity index 100% rename from Zend/tests/typehints/scalar_strict_declaration_placement_004.phpt rename to Zend/tests/type_declarations/scalar_strict_declaration_placement_004.phpt diff --git a/Zend/tests/typehints/scalar_strict_declaration_placement_005.phpt b/Zend/tests/type_declarations/scalar_strict_declaration_placement_005.phpt similarity index 100% rename from Zend/tests/typehints/scalar_strict_declaration_placement_005.phpt rename to Zend/tests/type_declarations/scalar_strict_declaration_placement_005.phpt diff --git a/Zend/tests/typehints/scalar_strict_declaration_placement_006.phpt b/Zend/tests/type_declarations/scalar_strict_declaration_placement_006.phpt similarity index 100% rename from Zend/tests/typehints/scalar_strict_declaration_placement_006.phpt rename to Zend/tests/type_declarations/scalar_strict_declaration_placement_006.phpt diff --git a/Zend/tests/typehints/scalar_strict_declaration_placement_007.phpt b/Zend/tests/type_declarations/scalar_strict_declaration_placement_007.phpt similarity index 100% rename from Zend/tests/typehints/scalar_strict_declaration_placement_007.phpt rename to Zend/tests/type_declarations/scalar_strict_declaration_placement_007.phpt diff --git a/Zend/tests/typehints/scalar_strict_declaration_placement_008.phpt b/Zend/tests/type_declarations/scalar_strict_declaration_placement_008.phpt similarity index 100% rename from Zend/tests/typehints/scalar_strict_declaration_placement_008.phpt rename to Zend/tests/type_declarations/scalar_strict_declaration_placement_008.phpt diff --git a/Zend/tests/typehints/scalar_weak_reference.phpt b/Zend/tests/type_declarations/scalar_weak_reference.phpt similarity index 76% rename from Zend/tests/typehints/scalar_weak_reference.phpt rename to Zend/tests/type_declarations/scalar_weak_reference.phpt index f397ceaa8d..74069689e6 100644 --- a/Zend/tests/typehints/scalar_weak_reference.phpt +++ b/Zend/tests/type_declarations/scalar_weak_reference.phpt @@ -1,5 +1,5 @@ --TEST-- -Weak scalar type hints, with references +Weak scalar types, with references --FILE-- ---EXPECTF-- - -Fatal error: Default value for parameters with a float type hint can only be float, integer, or NULL in %s on line %d diff --git a/Zend/tests/variadic/typehint_error.phpt b/Zend/tests/variadic/typehint_error.phpt index 26842bbcc2..153161a09d 100644 --- a/Zend/tests/variadic/typehint_error.phpt +++ b/Zend/tests/variadic/typehint_error.phpt @@ -1,5 +1,5 @@ --TEST-- -Variadic arguments enforce typehints +Variadic arguments enforce types --FILE-- arg_info[-1] for return type hinting */ + /* Use op_array->arg_info[-1] for return type */ arg_infos = safe_emalloc(sizeof(zend_arg_info), list->children + 1, 0); arg_infos->name = NULL; arg_infos->pass_by_reference = (op_array->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0; @@ -4525,31 +4525,31 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */ && !Z_CONSTANT(default_node.u.constant) ) { zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters " - "with array type hint can only be an array or NULL"); + "with array type can only be an array or NULL"); } } else if (arg_info->type_hint == IS_CALLABLE && default_ast) { if (!has_null_default && !Z_CONSTANT(default_node.u.constant)) { zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters " - "with callable type hint can only be NULL"); + "with callable type can only be NULL"); } } } else { if (default_ast && !has_null_default && !Z_CONSTANT(default_node.u.constant)) { if (arg_info->class_name) { zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters " - "with a class type hint can only be NULL"); + "with a class type can only be NULL"); } else switch (arg_info->type_hint) { case IS_DOUBLE: if (Z_TYPE(default_node.u.constant) != IS_DOUBLE && Z_TYPE(default_node.u.constant) != IS_LONG) { zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters " - "with a float type hint can only be float, integer, or NULL"); + "with a float type can only be float, integer, or NULL"); } break; default: if (!ZEND_SAME_FAKE_TYPE(arg_info->type_hint, Z_TYPE(default_node.u.constant))) { zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters " - "with a %s type hint can only be %s or NULL", + "with a %s type can only be %s or NULL", zend_get_type_by_const(arg_info->type_hint), zend_get_type_by_const(arg_info->type_hint)); } break; diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index b777a0ba8c..992d75ca3e 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -261,7 +261,7 @@ typedef struct _zend_try_catch_element { /* class has magic methods __get/__set/__unset/__isset that use guards */ #define ZEND_ACC_USE_GUARDS 0x1000000 -/* function has arguments with type hinting */ +/* function has typed arguments */ #define ZEND_ACC_HAS_TYPE_HINTS 0x10000000 /* op_array has finally blocks */ @@ -270,7 +270,7 @@ typedef struct _zend_try_catch_element { /* internal function is allocated at arena */ #define ZEND_ACC_ARENA_ALLOCATED 0x20000000 -/* Function has a return type hint (or class has such non-private function) */ +/* Function has a return type (or class has such non-private function) */ #define ZEND_ACC_HAS_RETURN_TYPE 0x40000000 /* op_array uses strict mode types */ @@ -319,7 +319,7 @@ typedef struct _zend_arg_info { /* the following structure repeats the layout of zend_internal_arg_info, * but its fields have different meaning. It's used as the first element of * arg_info array to define properties of internal functions. - * It's also used for return type hinting. + * It's also used for the return type. */ typedef struct _zend_internal_function_info { zend_uintptr_t required_num_args; diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 73b67f5216..6f897ab3cd 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -170,7 +170,7 @@ char *zend_visibility_string(uint32_t fn_flags) /* {{{ */ static int zend_do_perform_type_hint_check(const zend_function *fe, zend_arg_info *fe_arg_info, const zend_function *proto, zend_arg_info *proto_arg_info) /* {{{ */ { if (ZEND_LOG_XOR(fe_arg_info->class_name, proto_arg_info->class_name)) { - /* Only one has a type hint and the other one doesn't */ + /* Only one has a type declaration and the other one doesn't */ return 0; } @@ -239,7 +239,7 @@ static int zend_do_perform_type_hint_check(const zend_function *fe, zend_arg_inf } if (fe_arg_info->type_hint != proto_arg_info->type_hint) { - /* Incompatible type hint */ + /* Incompatible type */ return 0; } diff --git a/tests/lang/type_hints_003.phpt b/tests/lang/type_hints_003.phpt index 0ef3e3516b..2b536d0185 100644 --- a/tests/lang/type_hints_003.phpt +++ b/tests/lang/type_hints_003.phpt @@ -1,5 +1,5 @@ --TEST-- -ZE2 type hinting +ZE2 type --SKIPIF-- --FILE-- @@ -11,4 +11,4 @@ class T { ?> --EXPECTF-- -Fatal error: Default value for parameters with a class type hint can only be NULL in %stype_hints_003.php on line 3 +Fatal error: Default value for parameters with a class type can only be NULL in %stype_hints_003.php on line 3 -- 2.50.1