Skip to content

Commit

Permalink
Merge branch 'PHP-7.0'
Browse files Browse the repository at this point in the history
* PHP-7.0:
  Remove mentions of "type hint" and "typehint"
  • Loading branch information
Julien Pauli committed Dec 24, 2015
2 parents 2a4993d + 2a7eeff commit 7a2f60d
Show file tree
Hide file tree
Showing 78 changed files with 112 additions and 112 deletions.
2 changes: 1 addition & 1 deletion Zend/tests/bug42802.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Bug #42802 (Namespace not supported in typehints)
Bug #42802 (Namespace not supported in types)
--FILE--
<?php
namespace foo;
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug69767.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Bug #69767 (Default parameter value with wrong type segfaults)
function foo(String $bar = 0) {}
?>
--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
2 changes: 1 addition & 1 deletion Zend/tests/closure_059.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Closure 059: Closure type hinting
Closure 059: Closure type declaration
--FILE--
<?php
class A {
Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/errmsg_013.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
errmsg: default value for parameters with array type hint can only be an array or NULL
errmsg: default value for parameters with array type can only be an array or NULL
--FILE--
<?php

Expand All @@ -11,4 +11,4 @@ class test {
echo "Done\n";
?>
--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
2 changes: 1 addition & 1 deletion Zend/tests/generators/get_return.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/ns_055.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
055: typehints in namespaces
055: types in namespaces
--FILE--
<?php
namespace test\ns1;
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/return_types/internal_functions001.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Return type hinting for internal functions
Return type for internal functions

--SKIPIF--
<?php
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/return_types/internal_functions002.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Return type hinting for internal functions 2
Return type for internal functions 2

--SKIPIF--
<?php
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/return_types/reflection001.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Return type hinting and Reflection::export()
Return type and Reflection::export()

--SKIPIF--
<?php
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Array type hint
Array type declaration
--FILE--
<?php
function foo(array $a) {
Expand All @@ -12,8 +12,8 @@ foo(123);
--EXPECTF--
3

Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type array, integer given, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php:2
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
Stack trace:
#0 %s(%d): foo(123)
#1 {main}
thrown in %sarray_type_hint_001.php on line 2
thrown in %s on line 2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
callable type hint#001
callable type#001
--FILE--
<?php

Expand All @@ -21,7 +21,7 @@ foo($closure);
string(6) "strpos"
string(3) "foo"

Deprecated: Non-static method bar::baz() should not be called statically in %scallable_type_hint_001.php on line %d
Deprecated: Non-static method bar::baz() should not be called statically in %s on line %d
array(2) {
[0]=>
string(3) "bar"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
callable type hint#002 - Reflection
callable type#002 - Reflection
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
callable type hint#003
callable type#003
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Closure with variadic type hint
Closure with variadic type declaration
--FILE--
<?php
$f = function (stdClass ...$a) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Inexistent class as typehint receiving scalar argument
Inexistent class as type receiving scalar argument
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint - internal function strict mode
Scalar type - internal function strict mode
--FILE--
<?php
declare(strict_types=1);
Expand Down Expand Up @@ -32,4 +32,4 @@ try {
*** 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
*** Caught strlen() expects parameter 1 to be string, float given
*** Caught strlen() expects parameter 1 to be string, float given
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint basics
Scalar type basics
--FILE--
<?php

Expand Down Expand Up @@ -45,7 +45,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);
Expand All @@ -60,7 +60,7 @@ echo PHP_EOL . "Done";
?>
--EXPECTF--

Testing 'int' typehint:
Testing 'int' type:

*** Trying int(1)
int(1)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint - default via constants
Scalar type - default via constants
--FILE--
<?php

Expand Down Expand Up @@ -80,4 +80,4 @@ string(14) "this is a test"
Testing int with default null constant
NULL
Testing int with null null constant
NULL
NULL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint - default via constants - error condition
Scalar type - default via constants - error condition
--FILE--
<?php

Expand All @@ -17,4 +17,4 @@ Fatal error: Uncaught TypeError: Argument 1 passed to int_val() must be of the t
Stack trace:
#0 %s(%d): int_val()
#1 {main}
thrown in %s on line %d
thrown in %s on line %d
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Float type hint should allow an integer as default even with strict types
Float type should allow an integer as default even with strict types
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Float type hint should allow an integer as default
Float type should allow an integer as default
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--TEST--
Float type should not allow invalid types as default
--FILE--
<?php

function test(float $arg = true)
{
var_dump($arg);
}

test();

?>
--EXPECTF--

Fatal error: Default value for parameters with a float type can only be float, integer, or NULL in %s on line %d
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint missing parameters
Scalar type missing parameters
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint nullability
Scalar type nullability
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint - disallow relative typehints
Scalar type - disallow relative types
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint names cannot be used as class, trait or interface names (2)
Scalar type names cannot be used as class, trait or interface names (2)
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint names cannot be used as class, trait or interface names (2) - class_alias
Scalar type names cannot be used as class, trait or interface names (2) - class_alias
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint names cannot be used as class, trait or interface names (2) - use
Scalar type names cannot be used as class, trait or interface names (2) - use
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint names cannot be used as class, trait or interface names (3)
Scalar type names cannot be used as class, trait or interface names (3)
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint names cannot be used as class, trait or interface names (3) - class_alias
Scalar type names cannot be used as class, trait or interface names (3) - class_alias
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint names cannot be used as class, trait or interface names (3) - use
Scalar type names cannot be used as class, trait or interface names (3) - use
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint names cannot be used as class, trait or interface names (4)
Scalar type names cannot be used as class, trait or interface names (4)
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint names cannot be used as class, trait or interface names (4) - class_alias
Scalar type names cannot be used as class, trait or interface names (4) - class_alias
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint names cannot be used as class, trait or interface names (4) - use
Scalar type names cannot be used as class, trait or interface names (4) - use
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint names cannot be used as class, trait or interface names (6)
Scalar type names cannot be used as class, trait or interface names (6)
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint names cannot be used as class, trait or interface names (6) - class_alias
Scalar type names cannot be used as class, trait or interface names (6) - class_alias
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint names cannot be used as class, trait or interface names (6) - use
Scalar type names cannot be used as class, trait or interface names (6) - use
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Scalar type hint names cannot be used as class, trait or interface names (7)
Scalar type names cannot be used as class, trait or interface names (7)
--FILE--
<?php
namespace foo;
Expand Down
Loading

0 comments on commit 7a2f60d

Please sign in to comment.