File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Zend/tests/exception-coalesce Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 1
1
--TEST--
2
2
??? - chaining with ??
3
- --SKIPIF--
4
- <?php if (true ) echo 'skip implementation is hacky and merges in null coalesce behaviour ' ; ?>
5
3
--FILE--
6
4
<?php
7
5
function dual ($ on , $ off = null ) {
Original file line number Diff line number Diff line change @@ -8,9 +8,10 @@ function except() {
8
8
9
9
var_dump ((except () ?: false ) ??? 'outer ' );
10
10
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
12
13
?>
13
14
--EXPECT--
14
15
string(5) "outer"
15
16
string(5) "inner"
16
- string(5 ) "iffe"
17
+ string(4 ) "iffe"
You can’t perform that action at this time.
0 commit comments