You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FixesGH-18985ClosesGH-22833
zend_compile_expr() and zend_compile_var() now restore CG(zend_lineno) after
compilation of the node has finished. This makes the compiled lineno more
predictable.
Note that there are many cases left that are incorrect. For example:
<?php
return
foo();
L0004 0000 INIT_FCALL_BY_NAME 0 string("foo")
L0004 0001 T0 = DO_FCALL_BY_NAME
L0004 0002 RETURN T0
L0007 0003 RETURN int(1)
The zend_ast_create_n() functions set lineno to the lineno of the first non-null
child. In this case that's foo(), even though it's not on the same line as
return. What we'd need instead is backing up CG(zend_lineno) after the return
keyword in the parser so we can restore it later. However, this would be a
rather invasive change, given the same issue exists for many ast kinds, so a
better solution might just be to re-commit
e528762.
I don't feel comfortable backporting this as a bug fix, but we might address the
issue in a simpler, less comprehensive manner for older branches.
0 commit comments