1
0
mirror of https://github.com/php/php-src.git synced 2026-03-25 08:42:29 +01:00
Files
archived-php-src/ext/standard/tests/strings/join_error.phpt
2023-08-24 21:05:26 +01:00

25 lines
553 B
PHP

--TEST--
Test join() function: error conditions
--FILE--
<?php
echo "*** Testing join() : error conditions ***\n";
// Less than expected number of arguments
echo "\n-- Testing join() with less than expected no. of arguments --\n";
$glue = 'string_val';
try {
var_dump(join($glue));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
echo "Done\n";
?>
--EXPECT--
*** Testing join() : error conditions ***
-- Testing join() with less than expected no. of arguments --
join(): Argument #1 ($array) must be of type array, string given
Done