summaryrefslogtreecommitdiff
path: root/Zend/tests/type_declarations/iterable_002.phpt
blob: b9e02e40cd33eb5a356d9208426454ca514a236a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--TEST--
iterable type#002 - Default values
--FILE--
<?php

function foo(iterable $iterable = null) {
    // Null should be allowed as a default value
}

function bar(iterable $iterable = []) {
    // Array should be allowed as a default value
}

function baz(iterable $iterable = 1) {
    // No other values should be allowed as defaults
}

?>
--EXPECTF--
Fatal error: Default value for parameters with iterable type can only be an array or NULL in %s on line %d