mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
- Update tests after MFH
This commit is contained in:
parent
de9fa58e0b
commit
23b97b2530
4 changed files with 44 additions and 2 deletions
|
@ -53,4 +53,4 @@ int(2)
|
|||
object(foo)#%d (0) {
|
||||
}
|
||||
|
||||
Fatal error: Argument 1 passed to typehint() must be an object of class foo in %s on line %d
|
||||
Catchable fatal error: Argument 1 passed to typehint() must be an object of class foo in %s on line %d
|
||||
|
|
|
@ -23,4 +23,4 @@ type_hint_foo($bar);
|
|||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Fatal error: Argument 1 passed to type_hint_foo() must be an instance of Foo, called in %s on line 16 and defined in %s on line 9
|
||||
Catchable fatal error: Argument 1 passed to type_hint_foo() must be an instance of Foo, called in %s on line 16 and defined in %s on line 9
|
||||
|
|
28
tests/lang/type_hints_002.phpt
Normal file
28
tests/lang/type_hints_002.phpt
Normal file
|
@ -0,0 +1,28 @@
|
|||
--TEST--
|
||||
ZE2 type hinting
|
||||
--SKIPIF--
|
||||
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class P { }
|
||||
class T {
|
||||
function f(P $p = NULL) {
|
||||
var_dump($p);
|
||||
echo "-\n";
|
||||
}
|
||||
}
|
||||
|
||||
$o=new T();
|
||||
$o->f(new P);
|
||||
$o->f();
|
||||
$o->f(NULL);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(P)#2 (0) {
|
||||
}
|
||||
-
|
||||
NULL
|
||||
-
|
||||
NULL
|
||||
-
|
||||
|
14
tests/lang/type_hints_003.phpt
Normal file
14
tests/lang/type_hints_003.phpt
Normal file
|
@ -0,0 +1,14 @@
|
|||
--TEST--
|
||||
ZE2 type hinting
|
||||
--SKIPIF--
|
||||
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class T {
|
||||
function f(P $p = 42) {
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Fatal error: Default value for parameters with a class type hint can only be NULL in %stype_hints_003.php on line 3
|
Loading…
Add table
Add a link
Reference in a new issue