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

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

update php

File size: 537 bytes
Line 
1--TEST--
2iterable type#004 - Parameter covariance
3--FILE--
4<?php
5
6class Foo {
7    function testArray(array $array) {}
8
9    function testTraversable(Traversable $traversable) {}
10
11    function testScalar(int $int) {}
12}
13
14class Bar extends Foo {
15    function testArray(iterable $iterable) {}
16
17    function testTraversable(iterable $iterable) {}
18
19    function testScalar(iterable $iterable) {}
20}
21
22?>
23--EXPECTF--
24
25Warning: Declaration of Bar::testScalar(iterable $iterable) should be compatible with Foo::testScalar(int $int) in %s on line %d
Note: See TracBrowser for help on using the repository browser.