ext/standard/head.c: Small refactoring of headers_sent()#16109
ext/standard/head.c: Small refactoring of headers_sent()#16109Girgias wants to merge 2 commits intophp:masterfrom
headers_sent()#16109Conversation
6096c8b to
d344a08
Compare
| ZEND_TRY_ASSIGN_REF_LONG(by_ref_line, line); | ||
| } | ||
|
|
||
| RETURN_BOOL(SG(headers_sent)); |
There was a problem hiding this comment.
quick question: is there a reason why headers_sent global is not just a bool ?
There was a problem hiding this comment.
Because it hasn't been refactored since the move to C99, but it should yes.
| $file = null; | ||
| $line = null; | ||
|
|
||
| $v1 = headers_sent(line: $line); |
There was a problem hiding this comment.
I wonder if using named params here (and later) was intentional?
| @@ -0,0 +1,110 @@ | |||
| --TEST-- | |||
| headers_sent() by-ref argument with named arguments | |||
There was a problem hiding this comment.
This test file is a bit hard to read, maybe you should split the invocations with --- subtestname --- so that different subtests are easier to match between output and code.
ext/standard/head.c
Outdated
| file = php_output_get_start_filename(); | ||
| } | ||
|
|
||
| switch(ZEND_NUM_ARGS()) { |
There was a problem hiding this comment.
I think the code was written this way because this avoids a check: if we have a second param then we know the first one was also passed. The new code doesn't avoid such a check. It probably doesn't really matter however as the new code produces less machine code.
No description provided.