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

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

update php

File size: 568 bytes
Line 
1--TEST--
2list() with non-integer-or-string keys
3--FILE--
4<?php
5
6$results = [
7    0 => 0,
8    1 => 1,
9    "" => ""
10];
11
12list(NULL => $NULL, 1.5 => $float, FALSE => $FALSE, TRUE => $TRUE) = $results;
13var_dump($NULL, $float, $FALSE, $TRUE);
14
15echo PHP_EOL;
16
17list("0" => $zeroString, "1" => $oneString) = $results;
18var_dump($zeroString, $oneString);
19
20list(STDIN => $resource) = [];
21
22?>
23--EXPECTF--
24string(0) ""
25int(1)
26int(0)
27int(1)
28
29int(0)
30int(1)
31
32Notice: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
33
34Notice: Undefined offset: 1 in %s on line %d
Note: See TracBrowser for help on using the repository browser.