1--TEST-- 2Test Z_PARAM_ITERABLE() and Z_PARAM_ITERABLE_OR_NULL 3--EXTENSIONS-- 4zend_test 5--FILE-- 6<?php 7 8try { 9 var_dump(zend_iterable("string")); 10} catch (TypeError $exception) { 11 echo $exception->getMessage() . "\n"; 12} 13 14try { 15 var_dump(zend_iterable(1)); 16} catch (TypeError $exception) { 17 echo $exception->getMessage() . "\n"; 18} 19 20try { 21 var_dump(zend_iterable(null)); 22} catch (TypeError $exception) { 23 echo $exception->getMessage() . "\n"; 24} 25 26 27zend_iterable([]); 28zend_iterable([], []); 29 30$iterator = new ArrayIterator([]); 31zend_iterable($iterator); 32zend_iterable($iterator, $iterator); 33zend_iterable($iterator, null); 34 35try { 36 var_dump(zend_iterable([], "string")); 37} catch (TypeError $exception) { 38 echo $exception->getMessage() . "\n"; 39} 40 41?> 42--EXPECT-- 43zend_iterable(): Argument #1 ($arg1) must be of type Traversable|array, string given 44zend_iterable(): Argument #1 ($arg1) must be of type Traversable|array, int given 45zend_iterable(): Argument #1 ($arg1) must be of type Traversable|array, null given 46zend_iterable(): Argument #2 ($arg2) must be of type Traversable|array|null, string given 47 48