TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
349 B
31 lines
349 B
--TEST--
|
|
Test ?? operator
|
|
--FILE--
|
|
<?php
|
|
function foo1() {
|
|
$a = null;
|
|
$b = null;
|
|
$c = 100;
|
|
$a ??= $b ??= $c;
|
|
var_dump($a, $b);
|
|
|
|
}
|
|
|
|
function foo2() {
|
|
$a = null;
|
|
$b = 33;
|
|
$c = 100;
|
|
$a ??= $b ??= $c;
|
|
var_dump($a, $b);
|
|
}
|
|
|
|
function main() {
|
|
foo1();
|
|
foo2();
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
int(100)
|
|
int(100)
|
|
int(33)
|
|
int(33)
|