File tree 1 file changed +13
-18
lines changed 1 file changed +13
-18
lines changed Original file line number Diff line number Diff line change @@ -294,39 +294,34 @@ PHP_FUNCTION(setrawcookie)
294
294
/* {{{ Returns true if headers have already been sent, false otherwise */
295
295
PHP_FUNCTION (headers_sent )
296
296
{
297
- zval * arg1 = NULL , * arg2 = NULL ;
298
- const char * file = "" ;
299
- int line = 0 ;
297
+ zval * by_ref_filename = NULL ;
298
+ zval * by_ref_line = NULL ;
299
+ const char * file = "" ;
300
+ int line = 0 ;
300
301
301
302
ZEND_PARSE_PARAMETERS_START (0 , 2 )
302
303
Z_PARAM_OPTIONAL
303
- Z_PARAM_ZVAL (arg1 )
304
- Z_PARAM_ZVAL (arg2 )
304
+ Z_PARAM_ZVAL (by_ref_filename )
305
+ Z_PARAM_ZVAL (by_ref_line )
305
306
ZEND_PARSE_PARAMETERS_END ();
306
307
307
308
if (SG (headers_sent )) {
308
309
line = php_output_get_start_lineno ();
309
310
file = php_output_get_start_filename ();
310
311
}
311
312
312
- switch (ZEND_NUM_ARGS ()) {
313
- case 2 :
314
- ZEND_TRY_ASSIGN_REF_LONG (arg2 , line );
315
- ZEND_FALLTHROUGH ;
316
- case 1 :
313
+ if (by_ref_filename ) {
317
314
if (file ) {
318
- ZEND_TRY_ASSIGN_REF_STRING (arg1 , file );
315
+ ZEND_TRY_ASSIGN_REF_STRING (by_ref_filename , file );
319
316
} else {
320
- ZEND_TRY_ASSIGN_REF_EMPTY_STRING (arg1 );
317
+ ZEND_TRY_ASSIGN_REF_EMPTY_STRING (by_ref_filename );
321
318
}
322
- break ;
323
319
}
324
-
325
- if (SG (headers_sent )) {
326
- RETURN_TRUE ;
327
- } else {
328
- RETURN_FALSE ;
320
+ if (by_ref_line ) {
321
+ ZEND_TRY_ASSIGN_REF_LONG (by_ref_line , line );
329
322
}
323
+
324
+ RETURN_BOOL (SG (headers_sent ));
330
325
}
331
326
/* }}} */
332
327
You can’t perform that action at this time.
0 commit comments