source: src/router/php7/Zend/tests/type_declarations/iterable_002.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 2 months ago

update php

File size: 465 bytes
Line 
1--TEST--
2iterable type#002 - Default values
3--FILE--
4<?php
5
6function foo(iterable $iterable = null) {
7    // Null should be allowed as a default value
8}
9
10function bar(iterable $iterable = []) {
11    // Array should be allowed as a default value
12}
13
14function baz(iterable $iterable = 1) {
15    // No other values should be allowed as defaults
16}
17
18?>
19--EXPECTF--
20
21Fatal error: Default value for parameters with iterable type can only be an array or NULL in %s on line %d
Note: See TracBrowser for help on using the repository browser.