summaryrefslogtreecommitdiff
path: root/Zend/tests/return_types/bug71092.phpt
blob: ed9a082349d142ae8b0246905904040a67f50b47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--TEST--
Bug #71092 (Segmentation fault with return type hinting)
--INI--
opcache.enable=0
--FILE--
<?php

function boom(): array {
    $data = [['id']];
    switch ($data[0]) {
    case ['id']:
        return null;
    }
}

boom();
?>
--EXPECTF--
Fatal error: Uncaught TypeError: Return value of boom() must be of type array, null returned in %sbug71092.php:%d
Stack trace:
#0 %s(%d): boom()
#1 {main}
  thrown in %sbug71092.php on line %d