mirror of
https://github.com/php/php-src.git
synced 2025-08-16 22:18:50 +02:00
- Speed up by making null/false/true reserved word which allows to drop
an opcode (FETCH_CONSTANT) for every usage.
This commit is contained in:
parent
381a3b234f
commit
86d46f7cc1
2 changed files with 22 additions and 0 deletions
|
@ -142,6 +142,9 @@
|
|||
%token T_DOLLAR_OPEN_CURLY_BRACES
|
||||
%token T_CURLY_OPEN
|
||||
%token T_PAAMAYIM_NEKUDOTAYIM
|
||||
%token T_NULL
|
||||
%token T_FALSE
|
||||
%token T_TRUE
|
||||
|
||||
%% /* Rules */
|
||||
|
||||
|
@ -675,6 +678,9 @@ common_scalar:
|
|||
| T_CLASS_C { $$ = $1; }
|
||||
| T_METHOD_C { $$ = $1; }
|
||||
| T_FUNC_C { $$ = $1; }
|
||||
| T_NULL { $$ = $1; }
|
||||
| T_FALSE { $$ = $1; }
|
||||
| T_TRUE { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
#include "zend_constants.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_operators.h"
|
||||
#include "zend_API.h"
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
# include <stdarg.h>
|
||||
|
@ -1303,6 +1304,21 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
|||
return T_FILE;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"NULL" {
|
||||
ZVAL_NULL(zendlval);
|
||||
return T_NULL;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"FALSE" {
|
||||
ZVAL_FALSE(zendlval);
|
||||
return T_FALSE;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"TRUE" {
|
||||
ZVAL_TRUE(zendlval);
|
||||
return T_TRUE;
|
||||
}
|
||||
|
||||
<INITIAL>(([^<]|"<"[^?%s<]){1,400})|"<s"|"<" {
|
||||
#ifdef ZEND_MULTIBYTE
|
||||
if (SCNG(output_filter)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue