File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 5
5
- Core:
6
6
. Fixed bug GH-18850 (Repeated inclusion of file with __halt_compiler()
7
7
triggers "Constant already defined" warning). (ilutov)
8
+ . Fixed bug GH-19476 (pipe operator fails to correctly handle returning
9
+ by reference). (alexandre-daubois)
8
10
9
11
- ODBC:
10
12
. Remove ODBCVER and assume ODBC 3.5. (Calvin Buckley)
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Fix GH-19476: Pipe operator with function returning by reference
3
+ --FILE--
4
+ <?php
5
+
6
+ function &get_ref ($ _ ): string {
7
+ static $ a = "original " ;
8
+
9
+ $ a .= " " .$ _ ;
10
+
11
+ return $ a ;
12
+ }
13
+
14
+ function &test_pipe_ref (): string {
15
+ return "input " |> get_ref (...);
16
+ }
17
+
18
+ $ ref = &test_pipe_ref ();
19
+ echo "Before: " . $ ref . "\n" ;
20
+ $ ref = "changed " ;
21
+ echo "After: " . test_pipe_ref () . "\n" ;
22
+
23
+ ?>
24
+ --EXPECT--
25
+ Before: original input
26
+ After: changed input
Original file line number Diff line number Diff line change @@ -2726,7 +2726,8 @@ static inline bool zend_is_call(zend_ast *ast) /* {{{ */
2726
2726
return ast -> kind == ZEND_AST_CALL
2727
2727
|| ast -> kind == ZEND_AST_METHOD_CALL
2728
2728
|| ast -> kind == ZEND_AST_NULLSAFE_METHOD_CALL
2729
- || ast -> kind == ZEND_AST_STATIC_CALL ;
2729
+ || ast -> kind == ZEND_AST_STATIC_CALL
2730
+ || ast -> kind == ZEND_AST_PIPE ;
2730
2731
}
2731
2732
/* }}} */
2732
2733
You can’t perform that action at this time.
0 commit comments