diff options
-rw-r--r-- | tests/lang/operators/coalesce.phpt | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/lang/operators/coalesce.phpt b/tests/lang/operators/coalesce.phpt index 327a11a432..2ee54c5276 100644 --- a/tests/lang/operators/coalesce.phpt +++ b/tests/lang/operators/coalesce.phpt @@ -42,6 +42,14 @@ var_dump($arr["bing"][0] ?? 3); var_dump($arr["bing"][1] ?? 3); echo PHP_EOL; var_dump(foobar()[0] ?? false); +echo PHP_EOL; +function f($x) +{ + printf("%s(%d)\n", __FUNCTION__, $x); + return $x; +} + +$a = f(null) ?? f(1) ?? f(2); ?> --EXPECTF-- int(3) @@ -65,4 +73,7 @@ string(4) "bang" int(3) called -string(1) "a"
\ No newline at end of file +string(1) "a" + +f(0) +f(1)
\ No newline at end of file |