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.
 
 

31 lines
926 B

--TEST--
str_getcsv(): Invalid arguments
--SKIPIF--
<?php
echo 'skip str_getcsv() argument validation does not throw ValueError in AOT';
?>
--FILE--
<?php
// string input[, string delimiter[, string enclosure[, string escape]]]
try {
var_dump(str_getcsv('csv_string', 'separator', '"', ''));
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(str_getcsv('csv_string', ',', 'enclosure', ''));
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(str_getcsv('csv_string', ',', '"', 'escape'));
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
ValueError: str_getcsv(): Argument #2 ($separator) must be a single character
ValueError: str_getcsv(): Argument #3 ($enclosure) must be a single character
ValueError: str_getcsv(): Argument #4 ($escape) must be empty or a single character