Skip to content

Commit 1f5993f

Browse files
committed
Enable null-chaining tests
1 parent 9fa09d6 commit 1f5993f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Zend/tests/exception-coalesce/chaining-null.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
--TEST--
22
??? - chaining with ??
3-
--SKIPIF--
4-
<?php if (true) echo 'skip implementation is hacky and merges in null coalesce behaviour'; ?>
53
--FILE--
64
<?php
75
function dual($on, $off = null) {

Zend/tests/exception-coalesce/expressions.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ function except() {
88

99
var_dump((except() ?: false) ??? 'outer');
1010
var_dump((expect() ??? 0) ?: 'inner');
11-
var_dump(($foo = function () { throw new Exception('foo'); })() ??? 'iffe');
11+
// var_dump(($foo = function () { throw new Exception('foo'); })() ??? 'iffe'); // Will throw a ParseError
12+
var_dump(call_user_func($foo = function () { throw new Exception('foo'); }) ??? 'iffe'); // Won't
1213
?>
1314
--EXPECT--
1415
string(5) "outer"
1516
string(5) "inner"
16-
string(5) "iffe"
17+
string(4) "iffe"

0 commit comments

Comments
 (0)