mirror of
https://github.com/php/php-src.git
synced 2026-03-28 18:22:42 +01:00
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".
29 lines
641 B
PHP
29 lines
641 B
PHP
--TEST--
|
|
func_get_arg test
|
|
--FILE--
|
|
<?php
|
|
|
|
function foo($a)
|
|
{
|
|
$a=5;
|
|
echo func_get_arg();
|
|
echo func_get_arg(2,2);
|
|
echo func_get_arg("hello");
|
|
echo func_get_arg(-1);
|
|
echo func_get_arg(2);
|
|
}
|
|
foo(2);
|
|
echo "\n";
|
|
?>
|
|
--EXPECTF--
|
|
Warning: func_get_arg() expects exactly 1 parameter, 0 given in %s on line %d
|
|
|
|
Warning: func_get_arg() expects exactly 1 parameter, 2 given in %s on line %d
|
|
|
|
Warning: func_get_arg() expects parameter 1 to be int, string given in %s on line %d
|
|
|
|
Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
|
|
|
|
Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
|
|
|