mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
7485978339
This is an automated migration of most SKIPIF extension_loaded checks.
48 lines
1.0 KiB
PHP
48 lines
1.0 KiB
PHP
--TEST--
|
|
Test Z_PARAM_ITERABLE() and Z_PARAM_ITERABLE_OR_NULL
|
|
--EXTENSIONS--
|
|
zend_test
|
|
--FILE--
|
|
<?php
|
|
|
|
try {
|
|
var_dump(zend_iterable("string"));
|
|
} catch (TypeError $exception) {
|
|
echo $exception->getMessage() . "\n";
|
|
}
|
|
|
|
try {
|
|
var_dump(zend_iterable(1));
|
|
} catch (TypeError $exception) {
|
|
echo $exception->getMessage() . "\n";
|
|
}
|
|
|
|
try {
|
|
var_dump(zend_iterable(null));
|
|
} catch (TypeError $exception) {
|
|
echo $exception->getMessage() . "\n";
|
|
}
|
|
|
|
|
|
zend_iterable([]);
|
|
zend_iterable([], []);
|
|
|
|
$iterator = new ArrayIterator([]);
|
|
zend_iterable($iterator);
|
|
zend_iterable($iterator, $iterator);
|
|
zend_iterable($iterator, null);
|
|
|
|
try {
|
|
var_dump(zend_iterable([], "string"));
|
|
} catch (TypeError $exception) {
|
|
echo $exception->getMessage() . "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
zend_iterable(): Argument #1 ($arg1) must be of type iterable, string given
|
|
zend_iterable(): Argument #1 ($arg1) must be of type iterable, int given
|
|
zend_iterable(): Argument #1 ($arg1) must be of type iterable, null given
|
|
zend_iterable(): Argument #2 ($arg2) must be of type ?iterable, string given
|
|
|