TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

41 lines
808 B

--TEST--
Test fprintf() function (errors)
--SKIPIF--
<?php
echo 'skip mismatched argument count causes compile-time error in AOT, not runtime TypeError';
?>
--FILE--
<?php
/* Testing Error Conditions */
echo "*** Testing Error Conditions ***\n";
/* zero argument */
try {
var_dump( fprintf() );
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
/* scalar argument */
try {
var_dump( fprintf(3) );
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
/* NULL argument */
try {
var_dump( fprintf(NULL) );
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
echo "Done\n";
?>
--EXPECT--
*** Testing Error Conditions ***
fprintf() expects at least 2 arguments, 0 given
fprintf() expects at least 2 arguments, 1 given
fprintf() expects at least 2 arguments, 1 given
Done