mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
25 lines
479 B
Plaintext
25 lines
479 B
Plaintext
|
--TEST--
|
||
|
First class callables and strict types
|
||
|
--FILE--
|
||
|
<?php
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
function test(int $i) {
|
||
|
var_dump($i);
|
||
|
}
|
||
|
|
||
|
require __DIR__ . '/first_class_callable_015_weak.inc';
|
||
|
require __DIR__ . '/first_class_callable_015_strict.inc';
|
||
|
$fn = test(...);
|
||
|
do_weak_call($fn);
|
||
|
try {
|
||
|
do_strict_call($fn);
|
||
|
} catch (Error $e) {
|
||
|
echo $e->getMessage(), "\n";
|
||
|
}
|
||
|
|
||
|
?>
|
||
|
--EXPECTF--
|
||
|
int(42)
|
||
|
test(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
|