php-src/Zend/tests/list_keyed_non_literals.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

31 lines
536 B
PHP

--TEST--
list() with constant keys
--FILE--
<?php
$arr = [
1 => "one",
2 => "two",
3 => "three"
];
const COMPILE_TIME_RESOLVABLE = 1;
define('PROBABLY_NOT_COMPILE_TIME_RESOLVABLE', file_get_contents("data:text/plain,2"));
$probablyNotCompileTimeResolvable3 = cos(0) * 3;
list(
COMPILE_TIME_RESOLVABLE => $one,
PROBABLY_NOT_COMPILE_TIME_RESOLVABLE => $two,
$probablyNotCompileTimeResolvable3 => $three
) = $arr;
var_dump($one, $two, $three);
?>
--EXPECT--
string(3) "one"
string(3) "two"
string(5) "three"