Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9585c04
Implement pipe operator.
Crell Apr 11, 2020
529ba11
Include FCC in tested callable formats.
Crell Dec 13, 2024
0988adc
Move the code generation from the lexer to a compile function, courte…
Crell Dec 30, 2024
6612361
Fix pipe error output.
Crell Dec 30, 2024
499b111
Remove dead comment.
Crell Dec 30, 2024
b04e422
Wrap pipe LHS in a QM_ASSIGN opcode to implicitly block references.
Crell Jan 14, 2025
4dbf197
Add test to check behaviour of prefer-by-ref parameters
Girgias Feb 8, 2025
97db4bc
Use echo instead.
Crell Feb 9, 2025
f07fea2
Don't use printf, either.
Crell Feb 9, 2025
1443311
Correct addition-precedence test so it would be a different output if…
Crell Feb 9, 2025
3b6a9b3
Tweak style.
Crell Feb 10, 2025
46be67d
Expand ternary test.
Crell Feb 10, 2025
77af087
Add a test for comparison operators.
Crell Feb 10, 2025
d395181
Update comparison precedence test.
Crell Feb 10, 2025
c8e0051
Whitespace fixes.
Crell Feb 10, 2025
4ddf259
Add single quotes for consistency.
Crell Feb 13, 2025
cf26b9f
Increase precedence of pipe operator.
Crell Feb 26, 2025
c02447c
Remove dead code.
Crell Feb 27, 2025
ec94530
Add test for generator and pipe behavior.
Crell Mar 6, 2025
f1cb86d
Add regenerated file.
Crell Mar 6, 2025
0d9e407
Add test for complex ordering.
Crell Mar 6, 2025
c932837
Add test for exceptions.
Crell Mar 6, 2025
d608250
Use BINARY_OP macro for printing Pipe AST.
Crell Mar 6, 2025
241dda7
Improve tests for AST printing, still doesn't work.
Crell Mar 18, 2025
63c7b63
Improved optimzations and namespace handling, courtesy Arnaud.
Crell Mar 18, 2025
d7b7a99
Improve docs.
Crell Mar 18, 2025
82bae3c
Ensure higher order functions stil work.
Crell Mar 18, 2025
0d432c6
AST: Update priorities for ZEND_AST_PIPE
arnaud-lb Mar 18, 2025
93ea77b
Remove vestigial comment.
Crell Mar 18, 2025
d53cade
Add test for namespaced functions.
Crell Mar 18, 2025
7b13753
Remove dead code
Crell Mar 20, 2025
036cf3c
More namespace tests.
Crell Mar 20, 2025
cfa3e3f
Add test for static method FCC.
Crell Mar 20, 2025
2ba6512
Add more AST examples.
Crell Mar 20, 2025
7b6365d
Optimize static method calls in pipes.
Crell Mar 20, 2025
ba646f5
Typo fix.
Crell Mar 20, 2025
9915924
Add tests for pipe optimizations.
Crell Mar 20, 2025
ffa7735
Make test output more portable.
Crell May 28, 2025
af73e57
Revise all-callables test.
Crell May 31, 2025
c4dcbae
Formatting fix.
Crell May 31, 2025
dbac4e7
Whitespace and tab/space fixes.
Crell Jun 8, 2025
702c064
Correct test name.
Crell Jun 8, 2025
1a7006c
Only wrap against references when needed.
Crell Jun 8, 2025
98319b3
Don't produce numbers so large they overflow 32 bit integers. Oops.
Crell Jun 8, 2025
70b1b46
Typo fix
Crell Jun 9, 2025
bead416
Merge branch 'master' into func-composition
TimWolla Jun 10, 2025
0a3a121
NEWS / UPGRADING
TimWolla Jun 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -6436,10 +6436,15 @@ static void zend_compile_pipe(znode *result, zend_ast *ast)
znode operand_result;
zend_compile_expr(&operand_result, operand_ast);

/* Wrap the value in a ZEND_QM_ASSIGN opcode to ensure references
* always fail. Otherwise, they'd only fail in complex cases like arrays. */
/* Wrap simple values in a ZEND_QM__ASSIGN opcode to ensure references
* always fail. They will already fail in complex cases like arrays,
* so those don't need a wrapper. */
znode wrapped_operand_result;
zend_emit_op_tmp(&wrapped_operand_result, ZEND_QM_ASSIGN, &operand_result, NULL);
if (operand_result.op_type & (IS_CV|IS_VAR)) {
zend_emit_op_tmp(&wrapped_operand_result, ZEND_QM_ASSIGN, &operand_result, NULL);
} else {
wrapped_operand_result = operand_result;
}

/* Turn the operand into a function parameter list. */
zend_ast *arg_list_ast = zend_ast_create_list(1, ZEND_AST_ARG_LIST, zend_ast_create_znode(&wrapped_operand_result));
Expand Down
Loading