diff options
author | Gabriel Caruso <carusogabriel34@gmail.com> | 2018-02-04 11:33:49 -0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-02-04 19:08:23 +0100 |
commit | ce1d69a1f6dcf15d43029301059c25e5bc09a577 (patch) | |
tree | 3df785771b4bfa07a9e270b04750840ed47f1cbf /Zend | |
parent | 4861730a945908208a049b0c037ddf4a339f999a (diff) | |
download | php-git-ce1d69a1f6dcf15d43029301059c25e5bc09a577.tar.gz |
Use int instead of integer in type errors
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
Diffstat (limited to 'Zend')
35 files changed, 114 insertions, 114 deletions
diff --git a/Zend/tests/bug73954.phpt b/Zend/tests/bug73954.phpt index f911dd5834..fb0a6b8f3d 100644 --- a/Zend/tests/bug73954.phpt +++ b/Zend/tests/bug73954.phpt @@ -16,7 +16,7 @@ takes_int(log(tan(3.14))); float(NAN) bool(true) -Fatal error: Uncaught TypeError: Argument 1 passed to takes_int() must be of the type integer, float given, called in %s on line 9 and defined in %s:6 +Fatal error: Uncaught TypeError: Argument 1 passed to takes_int() must be of the type int, float given, called in %s on line 9 and defined in %s:6 Stack trace: #0 %s(9): takes_int(NAN) #1 {main} diff --git a/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt index 9029dc2625..1e535ea9f9 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt @@ -49,6 +49,6 @@ 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 +Argument 1 passed to bat() must be of the type int, 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 +Argument 2 passed to bat() must be of the type string, int given, called in %s diff --git a/Zend/tests/generators/generator_with_type_check.phpt b/Zend/tests/generators/generator_with_type_check.phpt index 2aa16532dc..12e6d46d76 100644 --- a/Zend/tests/generators/generator_with_type_check.phpt +++ b/Zend/tests/generators/generator_with_type_check.phpt @@ -6,7 +6,7 @@ function gen(array $a) { yield; } gen(42); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Argument 1 passed to gen() must be of the type array, integer given, called in %sgenerator_with_type_check.php on line 3 and defined in %sgenerator_with_type_check.php:2 +Fatal error: Uncaught TypeError: Argument 1 passed to gen() must be of the type array, int given, called in %sgenerator_with_type_check.php on line 3 and defined in %sgenerator_with_type_check.php:2 Stack trace: #0 %sgenerator_with_type_check.php(3): gen(42) #1 {main} diff --git a/Zend/tests/generators/generator_with_type_check_2.phpt b/Zend/tests/generators/generator_with_type_check_2.phpt index d8ea4fbf0d..ba1216224c 100644 --- a/Zend/tests/generators/generator_with_type_check_2.phpt +++ b/Zend/tests/generators/generator_with_type_check_2.phpt @@ -18,5 +18,5 @@ try { } ?> --EXPECTF-- -Argument 1 passed to gen() must be of the type array, integer given, called in %sgenerator_with_type_check_2.php on line 4 -Argument 1 passed to gen() must be of the type array, integer given, called in %sgenerator_with_type_check_2.php on line 10 +Argument 1 passed to gen() must be of the type array, int given, called in %sgenerator_with_type_check_2.php on line 4 +Argument 1 passed to gen() must be of the type array, int given, called in %sgenerator_with_type_check_2.php on line 10 diff --git a/Zend/tests/object_types/return_type_in_class.phpt b/Zend/tests/object_types/return_type_in_class.phpt index 2d0f771106..bef0421f8d 100644 --- a/Zend/tests/object_types/return_type_in_class.phpt +++ b/Zend/tests/object_types/return_type_in_class.phpt @@ -19,7 +19,7 @@ $three = new class extends Two { $three->a(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of class@anonymous::a() must be an object, integer returned in %s:13 +Fatal error: Uncaught TypeError: Return value of class@anonymous::a() must be an object, int returned in %s:13 Stack trace: #0 %s(16): class@anonymous->a() #1 {main} diff --git a/Zend/tests/object_types/return_type_in_function.phpt b/Zend/tests/object_types/return_type_in_function.phpt index e8ae75f490..5597e27b3f 100644 --- a/Zend/tests/object_types/return_type_in_function.phpt +++ b/Zend/tests/object_types/return_type_in_function.phpt @@ -9,7 +9,7 @@ function a() : object { a(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of a() must be an object, integer returned in %s:4 +Fatal error: Uncaught TypeError: Return value of a() must be an object, int returned in %s:4 Stack trace: #0 %s(6): a() #1 {main} diff --git a/Zend/tests/object_types/return_type_inheritance_in_class.phpt b/Zend/tests/object_types/return_type_inheritance_in_class.phpt index 826758f326..9ecf3cab1c 100644 --- a/Zend/tests/object_types/return_type_inheritance_in_class.phpt +++ b/Zend/tests/object_types/return_type_inheritance_in_class.phpt @@ -19,7 +19,7 @@ $three = new class extends Two { $three->a(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of class@anonymous::a() must be an object, integer returned in %s:13 +Fatal error: Uncaught TypeError: Return value of class@anonymous::a() must be an object, int returned in %s:13 Stack trace: #0 %s(16): class@anonymous->a() #1 {main} diff --git a/Zend/tests/object_types/return_type_inheritance_in_interface.phpt b/Zend/tests/object_types/return_type_inheritance_in_interface.phpt index fe1f6e6c0c..eec1ba260b 100644 --- a/Zend/tests/object_types/return_type_inheritance_in_interface.phpt +++ b/Zend/tests/object_types/return_type_inheritance_in_interface.phpt @@ -19,7 +19,7 @@ $three = new class implements Two { $three->a(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of class@anonymous::a() must be an object, integer returned in %s:13 +Fatal error: Uncaught TypeError: Return value of class@anonymous::a() must be an object, int returned in %s:13 Stack trace: #0 %s(16): class@anonymous->a() #1 {main} diff --git a/Zend/tests/object_types/type_hint_in_class_method.phpt b/Zend/tests/object_types/type_hint_in_class_method.phpt index e41caa0e70..4ea5216c4e 100644 --- a/Zend/tests/object_types/type_hint_in_class_method.phpt +++ b/Zend/tests/object_types/type_hint_in_class_method.phpt @@ -12,7 +12,7 @@ $one->a(new One()); $one->a(123); --EXPECTF-- -Fatal error: Uncaught TypeError: Argument 1 passed to One::a() must be an object, integer given, called in %s:4 +Fatal error: Uncaught TypeError: Argument 1 passed to One::a() must be an object, int given, called in %s:4 Stack trace: #0 %s(9): One->a(123) #1 {main} diff --git a/Zend/tests/object_types/type_hint_in_function.phpt b/Zend/tests/object_types/type_hint_in_function.phpt index 917726ce2e..3e923983d7 100644 --- a/Zend/tests/object_types/type_hint_in_function.phpt +++ b/Zend/tests/object_types/type_hint_in_function.phpt @@ -10,7 +10,7 @@ a(new A()); a(123); --EXPECTF-- -Fatal error: Uncaught TypeError: Argument 1 passed to a() must be an object, integer given, called in %s.php on line 7 and defined in %s:4 +Fatal error: Uncaught TypeError: Argument 1 passed to a() must be an object, int given, called in %s.php on line 7 and defined in %s:4 Stack trace: #0 %s(7): a(123) #1 {main} diff --git a/Zend/tests/return_types/003.phpt b/Zend/tests/return_types/003.phpt index e12e215de2..f70500da9f 100644 --- a/Zend/tests/return_types/003.phpt +++ b/Zend/tests/return_types/003.phpt @@ -9,7 +9,7 @@ function test1() : array { test1(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of test1() must be of the type array, integer returned in %s:%d +Fatal error: Uncaught TypeError: Return value of test1() must be of the type array, int returned in %s:%d Stack trace: #0 %s(%d): test1() #1 {main} diff --git a/Zend/tests/return_types/030.phpt b/Zend/tests/return_types/030.phpt index 288137f05c..1bb5512c85 100644 --- a/Zend/tests/return_types/030.phpt +++ b/Zend/tests/return_types/030.phpt @@ -16,7 +16,7 @@ foo(0); ok ok -Fatal error: Uncaught TypeError: Return value of foo() must be of the type array or null, integer returned in %s030.php:3 +Fatal error: Uncaught TypeError: Return value of foo() must be of the type array or null, int returned in %s030.php:3 Stack trace: #0 %s030.php(10): foo(0) #1 {main} diff --git a/Zend/tests/return_types/bug70557.phpt b/Zend/tests/return_types/bug70557.phpt index 8cc123a581..cb4eb498b9 100644 --- a/Zend/tests/return_types/bug70557.phpt +++ b/Zend/tests/return_types/bug70557.phpt @@ -16,4 +16,4 @@ try { } ?> --EXPECT-- -string(72) "Return value of getNumber() must be of the type integer, string returned" +string(68) "Return value of getNumber() must be of the type int, string returned" diff --git a/Zend/tests/return_types/rfc001.phpt b/Zend/tests/return_types/rfc001.phpt index 5a1d42b446..3c74acb923 100644 --- a/Zend/tests/return_types/rfc001.phpt +++ b/Zend/tests/return_types/rfc001.phpt @@ -11,7 +11,7 @@ function get_config(): array { get_config(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of get_config() must be of the type array, integer returned in %s:%d +Fatal error: Uncaught TypeError: Return value of get_config() must be of the type array, int returned in %s:%d Stack trace: #0 %s(%d): get_config() #1 {main} diff --git a/Zend/tests/type_declarations/array_001.phpt b/Zend/tests/type_declarations/array_001.phpt index 8fc368e288..c3315849a2 100644 --- a/Zend/tests/type_declarations/array_001.phpt +++ b/Zend/tests/type_declarations/array_001.phpt @@ -12,7 +12,7 @@ foo(123); --EXPECTF-- 3 -Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type array, integer given, called in %s on line 7 and defined in %s:2 +Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type array, int given, called in %s on line 7 and defined in %s:2 Stack trace: #0 %s(%d): foo(123) #1 {main} diff --git a/Zend/tests/type_declarations/explicit_weak_include_strict.phpt b/Zend/tests/type_declarations/explicit_weak_include_strict.phpt index fb53d8ce11..9773775ae4 100644 --- a/Zend/tests/type_declarations/explicit_weak_include_strict.phpt +++ b/Zend/tests/type_declarations/explicit_weak_include_strict.phpt @@ -11,7 +11,7 @@ require 'weak_include_strict_2.inc'; // calls within that file should stay strict, despite being included by weak file ?> --EXPECTF-- -Fatal error: Uncaught TypeError: 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 +Fatal error: Uncaught TypeError: Argument 1 passed to takes_int() must be of the type int, 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) #1 %s(%d): require('%s') diff --git a/Zend/tests/type_declarations/internal_function_strict_mode.phpt b/Zend/tests/type_declarations/internal_function_strict_mode.phpt index 4e792fa8d1..8b70bbae1a 100644 --- a/Zend/tests/type_declarations/internal_function_strict_mode.phpt +++ b/Zend/tests/type_declarations/internal_function_strict_mode.phpt @@ -28,7 +28,7 @@ try { ?> --EXPECTF-- *** Trying Ord With Integer -*** Caught ord() expects parameter 1 to be string, integer given +*** Caught ord() expects parameter 1 to be string, int given *** Trying Array Map With Invalid Callback *** Caught array_map() expects parameter 1 to be a valid callback, first array member is not a valid class name or object *** Trying Strlen With Float diff --git a/Zend/tests/type_declarations/iterable_001.phpt b/Zend/tests/type_declarations/iterable_001.phpt index f0c8bba610..b9e8119436 100644 --- a/Zend/tests/type_declarations/iterable_001.phpt +++ b/Zend/tests/type_declarations/iterable_001.phpt @@ -45,4 +45,4 @@ object(ArrayIterator)#1 (1) { int(3) } } -Argument 1 passed to test() must be iterable, integer given, called in %s on line %d +Argument 1 passed to test() must be iterable, int given, called in %s on line %d diff --git a/Zend/tests/type_declarations/iterable_003.phpt b/Zend/tests/type_declarations/iterable_003.phpt index 8c91c993d0..e5e6af9ae8 100644 --- a/Zend/tests/type_declarations/iterable_003.phpt +++ b/Zend/tests/type_declarations/iterable_003.phpt @@ -29,4 +29,4 @@ array(0) { } object(Generator)#2 (0) { } -Return value of baz() must be iterable, integer returned +Return value of baz() must be iterable, int returned diff --git a/Zend/tests/type_declarations/scalar_basic.phpt b/Zend/tests/type_declarations/scalar_basic.phpt index 51c3664737..c2191b9e64 100644 --- a/Zend/tests/type_declarations/scalar_basic.phpt +++ b/Zend/tests/type_declarations/scalar_basic.phpt @@ -79,16 +79,16 @@ E_NOTICE: A non well formed numeric value encountered on line %d int(1) *** Trying string(1) "a" -*** Caught Argument 1 passed to {closure}() must be of the type integer, string given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Trying string(0) "" -*** Caught Argument 1 passed to {closure}() must be of the type integer, string given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Trying int(%d) int(%d) *** Trying float(NAN) -*** Caught Argument 1 passed to {closure}() must be of the type integer, float given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d *** Trying bool(true) int(1) @@ -97,22 +97,22 @@ int(1) int(0) *** Trying NULL -*** Caught Argument 1 passed to {closure}() must be of the type integer, null given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, null given, called in %s on line %d *** Trying array(0) { } -*** Caught Argument 1 passed to {closure}() must be of the type integer, array given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, array given, called in %s on line %d *** Trying object(stdClass)#%s (0) { } -*** Caught Argument 1 passed to {closure}() must be of the type integer, object given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, object given, called in %s on line %d *** Trying object(Stringable)#%s (0) { } -*** Caught Argument 1 passed to {closure}() must be of the type integer, object given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, object given, called in %s on line %d *** 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 +*** Caught Argument 1 passed to {closure}() must be of the type int, resource given, called in %s on line %d Testing 'float' type: diff --git a/Zend/tests/type_declarations/scalar_constant_defaults_error.phpt b/Zend/tests/type_declarations/scalar_constant_defaults_error.phpt index dcbb3e87f4..750edb77fa 100644 --- a/Zend/tests/type_declarations/scalar_constant_defaults_error.phpt +++ b/Zend/tests/type_declarations/scalar_constant_defaults_error.phpt @@ -13,7 +13,7 @@ var_dump(int_val()); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: 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 +Fatal error: Uncaught TypeError: Argument 1 passed to int_val() must be of the type int, string given, called in %s on line %d and defined in %s:%d Stack trace: #0 %s(%d): int_val() #1 {main} diff --git a/Zend/tests/type_declarations/scalar_null.phpt b/Zend/tests/type_declarations/scalar_null.phpt index 6b9930f297..e3beb9feac 100644 --- a/Zend/tests/type_declarations/scalar_null.phpt +++ b/Zend/tests/type_declarations/scalar_null.phpt @@ -37,7 +37,7 @@ echo PHP_EOL . "Done"; ?> --EXPECTF-- Testing int: -*** Caught Argument 1 passed to {closure}() must be of the type integer, null given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, null given, called in %s on line %d Testing float: *** Caught Argument 1 passed to {closure}() must be of the type float, null given, called in %s on line %d Testing string: diff --git a/Zend/tests/type_declarations/scalar_return_basic.phpt b/Zend/tests/type_declarations/scalar_return_basic.phpt index 4e0650e7e9..cf58f91500 100644 --- a/Zend/tests/type_declarations/scalar_return_basic.phpt +++ b/Zend/tests/type_declarations/scalar_return_basic.phpt @@ -76,30 +76,30 @@ int(1) E_NOTICE: A non well formed numeric value encountered on line %d int(1) *** Trying string(1) "a" -*** Caught Return value of {closure}() must be of the type integer, string returned in %s on line %d +*** Caught Return value of {closure}() must be of the type int, string returned in %s on line %d *** Trying string(0) "" -*** Caught Return value of {closure}() must be of the type integer, string returned in %s on line %d +*** Caught Return value of {closure}() must be of the type int, string returned in %s on line %d *** Trying int(2147483647) int(2147483647) *** Trying float(NAN) -*** Caught Return value of {closure}() must be of the type integer, float returned in %s on line %d +*** Caught Return value of {closure}() must be of the type int, float returned in %s on line %d *** Trying bool(true) int(1) *** Trying bool(false) int(0) *** Trying NULL -*** Caught Return value of {closure}() must be of the type integer, null returned in %s on line %d +*** Caught Return value of {closure}() must be of the type int, null returned in %s on line %d *** Trying array(0) { } -*** Caught Return value of {closure}() must be of the type integer, array returned in %s on line %d +*** Caught Return value of {closure}() must be of the type int, array returned in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught Return value of {closure}() must be of the type integer, object returned in %s on line %d +*** Caught Return value of {closure}() must be of the type int, object returned in %s on line %d *** Trying object(Stringable)#7 (0) { } -*** Caught Return value of {closure}() must be of the type integer, object returned in %s on line %d +*** Caught Return value of {closure}() must be of the type int, object returned in %s on line %d *** Trying resource(5) of type (stream) -*** Caught Return value of {closure}() must be of the type integer, resource returned in %s on line %d +*** Caught Return value of {closure}() must be of the type int, resource returned in %s on line %d Testing 'float' type: *** Trying int(1) diff --git a/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt b/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt index e8f69bc699..9c4217203f 100644 --- a/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt +++ b/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt @@ -76,30 +76,30 @@ int(1) E_NOTICE: A non well formed numeric value encountered on line %d int(1) *** Trying string(1) "a" -*** Caught Return value of {closure}() must be of the type integer, string returned in %s on line %d +*** Caught Return value of {closure}() must be of the type int, string returned in %s on line %d *** Trying string(0) "" -*** Caught Return value of {closure}() must be of the type integer, string returned in %s on line %d +*** Caught Return value of {closure}() must be of the type int, string returned in %s on line %d *** Trying int(9223372036854775807) int(9223372036854775807) *** Trying float(NAN) -*** Caught Return value of {closure}() must be of the type integer, float returned in %s on line %d +*** Caught Return value of {closure}() must be of the type int, float returned in %s on line %d *** Trying bool(true) int(1) *** Trying bool(false) int(0) *** Trying NULL -*** Caught Return value of {closure}() must be of the type integer, null returned in %s on line %d +*** Caught Return value of {closure}() must be of the type int, null returned in %s on line %d *** Trying array(0) { } -*** Caught Return value of {closure}() must be of the type integer, array returned in %s on line %d +*** Caught Return value of {closure}() must be of the type int, array returned in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught Return value of {closure}() must be of the type integer, object returned in %s on line %d +*** Caught Return value of {closure}() must be of the type int, object returned in %s on line %d *** Trying object(Stringable)#7 (0) { } -*** Caught Return value of {closure}() must be of the type integer, object returned in %s on line %d +*** Caught Return value of {closure}() must be of the type int, object returned in %s on line %d *** Trying resource(5) of type (stream) -*** Caught Return value of {closure}() must be of the type integer, resource returned in %s on line %d +*** Caught Return value of {closure}() must be of the type int, resource returned in %s on line %d Testing 'float' type: *** Trying int(1) diff --git a/Zend/tests/type_declarations/scalar_strict.phpt b/Zend/tests/type_declarations/scalar_strict.phpt index 40b036e1d4..afef18f6a3 100644 --- a/Zend/tests/type_declarations/scalar_strict.phpt +++ b/Zend/tests/type_declarations/scalar_strict.phpt @@ -70,52 +70,52 @@ Testing 'int' type: int(1) *** Trying string(1) "1" -*** Caught Argument 1 passed to {closure}() must be of the type integer, string given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Trying float(1) -*** Caught Argument 1 passed to {closure}() must be of the type integer, float given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d *** Trying float(1.5) -*** Caught Argument 1 passed to {closure}() must be of the type integer, float given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d *** Trying string(2) "1a" -*** Caught Argument 1 passed to {closure}() must be of the type integer, string given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Trying string(1) "a" -*** Caught Argument 1 passed to {closure}() must be of the type integer, string given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Trying string(0) "" -*** Caught Argument 1 passed to {closure}() must be of the type integer, string given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Trying int(2147483647) int(2147483647) *** Trying float(NAN) -*** Caught Argument 1 passed to {closure}() must be of the type integer, float given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d *** Trying bool(true) -*** Caught Argument 1 passed to {closure}() must be of the type integer, boolean given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, boolean given, called in %s on line %d *** Trying bool(false) -*** Caught Argument 1 passed to {closure}() must be of the type integer, boolean given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, boolean given, called in %s on line %d *** Trying NULL -*** Caught Argument 1 passed to {closure}() must be of the type integer, null given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, null given, called in %s on line %d *** Trying array(0) { } -*** Caught Argument 1 passed to {closure}() must be of the type integer, array given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, array given, called in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught Argument 1 passed to {closure}() must be of the type integer, object given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, object given, called in %s on line %d *** Trying object(Stringable)#7 (0) { } -*** Caught Argument 1 passed to {closure}() must be of the type integer, object given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, object given, called in %s on line %d *** 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 +*** Caught Argument 1 passed to {closure}() must be of the type int, resource given, called in %s on line %d Testing 'float' type: @@ -173,7 +173,7 @@ float(NAN) 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 +*** Caught Argument 1 passed to {closure}() must be of the type string, int given, called in %s on line %d *** Trying string(1) "1" string(1) "1" @@ -194,7 +194,7 @@ string(1) "a" string(0) "" *** Trying int(2147483647) -*** Caught Argument 1 passed to {closure}() must be of the type string, integer given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type string, int given, called in %s on line %d *** Trying float(NAN) *** Caught Argument 1 passed to {closure}() must be of the type string, float given, called in %s on line %d @@ -226,7 +226,7 @@ string(0) "" 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 +*** Caught Argument 1 passed to {closure}() must be of the type boolean, int given, called in %s on line %d *** Trying string(1) "1" *** Caught Argument 1 passed to {closure}() must be of the type boolean, string given, called in %s on line %d @@ -247,7 +247,7 @@ Testing 'bool' type: *** Caught Argument 1 passed to {closure}() must be of the type boolean, string given, called in %s on line %d *** Trying int(2147483647) -*** Caught Argument 1 passed to {closure}() must be of the type boolean, integer given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type boolean, int given, called in %s on line %d *** Trying float(NAN) *** Caught Argument 1 passed to {closure}() must be of the type boolean, float given, called in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_strict_64bit.phpt b/Zend/tests/type_declarations/scalar_strict_64bit.phpt index 3e748ede34..914f0e6807 100644 --- a/Zend/tests/type_declarations/scalar_strict_64bit.phpt +++ b/Zend/tests/type_declarations/scalar_strict_64bit.phpt @@ -70,52 +70,52 @@ Testing 'int' type: int(1) *** Trying string(1) "1" -*** Caught Argument 1 passed to {closure}() must be of the type integer, string given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Trying float(1) -*** Caught Argument 1 passed to {closure}() must be of the type integer, float given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d *** Trying float(1.5) -*** Caught Argument 1 passed to {closure}() must be of the type integer, float given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d *** Trying string(2) "1a" -*** Caught Argument 1 passed to {closure}() must be of the type integer, string given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Trying string(1) "a" -*** Caught Argument 1 passed to {closure}() must be of the type integer, string given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Trying string(0) "" -*** Caught Argument 1 passed to {closure}() must be of the type integer, string given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Trying int(9223372036854775807) int(9223372036854775807) *** Trying float(NAN) -*** Caught Argument 1 passed to {closure}() must be of the type integer, float given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d *** Trying bool(true) -*** Caught Argument 1 passed to {closure}() must be of the type integer, boolean given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, boolean given, called in %s on line %d *** Trying bool(false) -*** Caught Argument 1 passed to {closure}() must be of the type integer, boolean given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, boolean given, called in %s on line %d *** Trying NULL -*** Caught Argument 1 passed to {closure}() must be of the type integer, null given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, null given, called in %s on line %d *** Trying array(0) { } -*** Caught Argument 1 passed to {closure}() must be of the type integer, array given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, array given, called in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught Argument 1 passed to {closure}() must be of the type integer, object given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, object given, called in %s on line %d *** Trying object(Stringable)#7 (0) { } -*** Caught Argument 1 passed to {closure}() must be of the type integer, object given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, object given, called in %s on line %d *** 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 +*** Caught Argument 1 passed to {closure}() must be of the type int, resource given, called in %s on line %d Testing 'float' type: @@ -173,7 +173,7 @@ float(NAN) 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 +*** Caught Argument 1 passed to {closure}() must be of the type string, int given, called in %s on line %d *** Trying string(1) "1" string(1) "1" @@ -194,7 +194,7 @@ string(1) "a" string(0) "" *** Trying int(9223372036854775807) -*** Caught Argument 1 passed to {closure}() must be of the type string, integer given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type string, int given, called in %s on line %d *** Trying float(NAN) *** Caught Argument 1 passed to {closure}() must be of the type string, float given, called in %s on line %d @@ -226,7 +226,7 @@ string(0) "" 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 +*** Caught Argument 1 passed to {closure}() must be of the type boolean, int given, called in %s on line %d *** Trying string(1) "1" *** Caught Argument 1 passed to {closure}() must be of the type boolean, string given, called in %s on line %d @@ -247,7 +247,7 @@ Testing 'bool' type: *** Caught Argument 1 passed to {closure}() must be of the type boolean, string given, called in %s on line %d *** Trying int(9223372036854775807) -*** Caught Argument 1 passed to {closure}() must be of the type boolean, integer given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type boolean, int given, called in %s on line %d *** Trying float(NAN) *** Caught Argument 1 passed to {closure}() must be of the type boolean, float given, called in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_strict_basic.phpt b/Zend/tests/type_declarations/scalar_strict_basic.phpt index 3ee94a2059..24dff2489d 100644 --- a/Zend/tests/type_declarations/scalar_strict_basic.phpt +++ b/Zend/tests/type_declarations/scalar_strict_basic.phpt @@ -68,28 +68,28 @@ Testing 'int' type: int(1) *** Trying float value -*** Caught Argument 1 passed to {closure}() must be of the type integer, float given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d *** Trying string value -*** Caught Argument 1 passed to {closure}() must be of the type integer, string given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Trying true value -*** Caught Argument 1 passed to {closure}() must be of the type integer, boolean given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, boolean given, called in %s on line %d *** Trying false value -*** Caught Argument 1 passed to {closure}() must be of the type integer, boolean given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, boolean given, called in %s on line %d *** Trying null value -*** Caught Argument 1 passed to {closure}() must be of the type integer, null given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, null given, called in %s on line %d *** Trying array value -*** Caught Argument 1 passed to {closure}() must be of the type integer, array given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, array given, called in %s on line %d *** Trying object value -*** Caught Argument 1 passed to {closure}() must be of the type integer, object given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, object given, called in %s on line %d *** Trying resource value -*** Caught Argument 1 passed to {closure}() must be of the type integer, resource given, called in %s on line %d +*** Caught Argument 1 passed to {closure}() must be of the type int, resource given, called in %s on line %d Testing 'float' type: @@ -123,7 +123,7 @@ float(1) 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 +*** Caught Argument 1 passed to {closure}() must be of the type string, int given, called in %s on line %d *** Trying float value *** Caught Argument 1 passed to {closure}() must be of the type string, float given, called in %s on line %d @@ -152,7 +152,7 @@ string(1) "1" 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 +*** Caught Argument 1 passed to {closure}() must be of the type boolean, int given, called in %s on line %d *** Trying float value *** Caught Argument 1 passed to {closure}() must be of the type boolean, float given, called in %s on line %d diff --git a/Zend/tests/type_declarations/strict_call_weak.phpt b/Zend/tests/type_declarations/strict_call_weak.phpt index e3a606ec12..d064161480 100644 --- a/Zend/tests/type_declarations/strict_call_weak.phpt +++ b/Zend/tests/type_declarations/strict_call_weak.phpt @@ -13,7 +13,7 @@ require 'strict_call_weak_2.inc'; function_declared_in_weak_mode(1.0); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: 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 +Fatal error: Uncaught TypeError: Argument 1 passed to function_declared_in_weak_mode() must be of the type int, 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) #1 {main} diff --git a/Zend/tests/type_declarations/strict_call_weak_explicit.phpt b/Zend/tests/type_declarations/strict_call_weak_explicit.phpt index 22c5b4319c..e909ee0141 100644 --- a/Zend/tests/type_declarations/strict_call_weak_explicit.phpt +++ b/Zend/tests/type_declarations/strict_call_weak_explicit.phpt @@ -13,7 +13,7 @@ require 'strict_call_weak_explicit_2.inc'; function_declared_in_weak_mode(1.0); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: 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 +Fatal error: Uncaught TypeError: Argument 1 passed to function_declared_in_weak_mode() must be of the type int, 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) #1 {main} diff --git a/Zend/tests/type_declarations/weak_include_strict.phpt b/Zend/tests/type_declarations/weak_include_strict.phpt index e49485dbe5..52f5f55cdb 100644 --- a/Zend/tests/type_declarations/weak_include_strict.phpt +++ b/Zend/tests/type_declarations/weak_include_strict.phpt @@ -11,7 +11,7 @@ require 'weak_include_strict_2.inc'; // calls within that file should stay strict, despite being included by weak file ?> --EXPECTF-- -Fatal error: Uncaught TypeError: 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 +Fatal error: Uncaught TypeError: Argument 1 passed to takes_int() must be of the type int, 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) #1 %s(%d): require('%s') diff --git a/Zend/tests/typehints/or_null.phpt b/Zend/tests/typehints/or_null.phpt index 8c20052165..552db7d058 100644 --- a/Zend/tests/typehints/or_null.phpt +++ b/Zend/tests/typehints/or_null.phpt @@ -231,27 +231,27 @@ TypeError: Argument 1 passed to loadedInterface() must implement interface RealI Stack trace: #0 %s(26): loadedInterface(Object(stdClass)) #1 {main} -TypeError: Argument 1 passed to unloadedClass() must be an instance of I\Dont\Exist or null, integer given, called in %s on line 32 and defined in %s:5 +TypeError: Argument 1 passed to unloadedClass() must be an instance of I\Dont\Exist or null, int given, called in %s on line 32 and defined in %s:5 Stack trace: #0 %s(32): unloadedClass(1) #1 {main} -TypeError: Argument 1 passed to loadedClass() must be an instance of RealClass or null, integer given, called in %s on line 38 and defined in %s:16 +TypeError: Argument 1 passed to loadedClass() must be an instance of RealClass or null, int given, called in %s on line 38 and defined in %s:16 Stack trace: #0 %s(38): loadedClass(1) #1 {main} -TypeError: Argument 1 passed to loadedInterface() must implement interface RealInterface or be null, integer given, called in %s on line 44 and defined in %s:17 +TypeError: Argument 1 passed to loadedInterface() must implement interface RealInterface or be null, int given, called in %s on line 44 and defined in %s:17 Stack trace: #0 %s(44): loadedInterface(1) #1 {main} -TypeError: Argument 1 passed to callableF() must be callable or null, integer given, called in %s on line 52 and defined in %s:49 +TypeError: Argument 1 passed to callableF() must be callable or null, int given, called in %s on line 52 and defined in %s:49 Stack trace: #0 %s(52): callableF(1) #1 {main} -TypeError: Argument 1 passed to iterableF() must be iterable or null, integer given, called in %s on line 60 and defined in %s:57 +TypeError: Argument 1 passed to iterableF() must be iterable or null, int given, called in %s on line 60 and defined in %s:57 Stack trace: #0 %s(60): iterableF(1) #1 {main} -TypeError: Argument 1 passed to intF() must be of the type integer or null, object given, called in %s on line 68 and defined in %s:65 +TypeError: Argument 1 passed to intF() must be of the type int or null, object given, called in %s on line 68 and defined in %s:65 Stack trace: #0 %s(68): intF(Object(stdClass)) #1 {main} @@ -267,27 +267,27 @@ TypeError: Return value of returnLoadedInterface() must implement interface Real Stack trace: #0 %s(98): returnLoadedInterface() #1 {main} -TypeError: Return value of returnUnloadedClassScalar() must be an instance of I\Dont\Exist or null, integer returned in %s:104 +TypeError: Return value of returnUnloadedClassScalar() must be an instance of I\Dont\Exist or null, int returned in %s:104 Stack trace: #0 %s(108): returnUnloadedClassScalar() #1 {main} -TypeError: Return value of returnLoadedClassScalar() must be an instance of RealClass or null, integer returned in %s:114 +TypeError: Return value of returnLoadedClassScalar() must be an instance of RealClass or null, int returned in %s:114 Stack trace: #0 %s(118): returnLoadedClassScalar() #1 {main} -TypeError: Return value of returnLoadedInterfaceScalar() must implement interface RealInterface or be null, integer returned in %s:124 +TypeError: Return value of returnLoadedInterfaceScalar() must implement interface RealInterface or be null, int returned in %s:124 Stack trace: #0 %s(128): returnLoadedInterfaceScalar() #1 {main} -TypeError: Return value of returnCallable() must be callable or null, integer returned in %s:134 +TypeError: Return value of returnCallable() must be callable or null, int returned in %s:134 Stack trace: #0 %s(138): returnCallable() #1 {main} -TypeError: Return value of returnIterable() must be iterable or null, integer returned in %s:144 +TypeError: Return value of returnIterable() must be iterable or null, int returned in %s:144 Stack trace: #0 %s(148): returnIterable() #1 {main} -TypeError: Return value of returnInt() must be of the type integer or null, object returned in %s:154 +TypeError: Return value of returnInt() must be of the type int or null, object returned in %s:154 Stack trace: #0 %s(158): returnInt() #1 {main} @@ -311,7 +311,7 @@ TypeError: Return value of returnMissingIterable() must be iterable or null, non Stack trace: #0 %s(203): returnMissingIterable() #1 {main} -TypeError: Return value of returnMissingInt() must be of the type integer or null, none returned in %s:209 +TypeError: Return value of returnMissingInt() must be of the type int or null, none returned in %s:209 Stack trace: #0 %s(212): returnMissingInt() #1 {main} diff --git a/Zend/tests/variadic/typehint_error.phpt b/Zend/tests/variadic/typehint_error.phpt index 153161a09d..d9a5ea291f 100644 --- a/Zend/tests/variadic/typehint_error.phpt +++ b/Zend/tests/variadic/typehint_error.phpt @@ -33,7 +33,7 @@ array(3) { } } -Fatal error: Uncaught TypeError: Argument 3 passed to test() must be of the type array, integer given, called in %s:%d +Fatal error: Uncaught TypeError: Argument 3 passed to test() must be of the type array, int given, called in %s:%d Stack trace: #0 %s(%d): test(Array, Array, 2) #1 {main} diff --git a/Zend/tests/variadic/typehint_suppressed_error.phpt b/Zend/tests/variadic/typehint_suppressed_error.phpt index ef217b2be0..ebc44c38b1 100644 --- a/Zend/tests/variadic/typehint_suppressed_error.phpt +++ b/Zend/tests/variadic/typehint_suppressed_error.phpt @@ -15,4 +15,4 @@ try { ?> --EXPECTF-- -string(%d) "Argument 3 passed to test() must be of the type array, integer given, called in %s on line %d" +string(%d) "Argument 3 passed to test() must be of the type array, int given, called in %s on line %d" diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 79d6ab9a6c..d0ab8a31ec 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -107,7 +107,7 @@ ZEND_API char *zend_get_type_by_const(int type) /* {{{ */ case _IS_BOOL: return "boolean"; case IS_LONG: - return "integer"; + return "int"; case IS_DOUBLE: return "float"; case IS_STRING: @@ -497,7 +497,7 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons } if (!zend_parse_arg_long(arg, p, is_null, check_null, c == 'L')) { - return "integer"; + return "int"; } } break; diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 1baf50a4e8..31ce98a121 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -690,7 +690,7 @@ END_EXTERN_C() #define FAST_ZPP 1 #define Z_EXPECTED_TYPES(_) \ - _(Z_EXPECTED_LONG, "integer") \ + _(Z_EXPECTED_LONG, "int") \ _(Z_EXPECTED_BOOL, "boolean") \ _(Z_EXPECTED_STRING, "string") \ _(Z_EXPECTED_ARRAY, "array") \ |