1
0
mirror of https://github.com/php/php-src.git synced 2026-04-16 20:41:18 +02:00

Merge remote-tracking branch 'origin/master' into native-tls

* origin/master: (42 commits)
  Add tests verifying calls work inside echo, concatenation and array access
  Updated NEWS and UPGRADING
  Fix $this CV init for include/eval
  Fix dynamic calls to static methods with fci->object
  Fix $arr =& $arr[0]
  Add UPGRADING stubs for a number of recent changes
  Regenerate tokenizer data
  Fix unused variable warning
  Remove <% and <script language="php"> tags
  zend_uint -> uint32_t
  Fix nesting for *non*-compile-time-resolveable functions See a1a4ba9511 (commitcomment-7414223)
  Add tests for calls to nested, *non*-compile-time-resolveable functions See a1a4ba9511 (commitcomment-7414362)
  Make list of opcodes used for nesting calculation consistent   with `zend_do_convert_call_user_func()` in Zend/zend_compile.c
  Rewrite code to use ZEND_VM_JMP() instead of repeated ZEND_VM_INC_OPCODE() calls
  QA: Simplify code to find matching ZEND_DO_FCALL_BY_NAME CG(context).nested_calls is stored inside the initializer's result.num and inside the finalizer's op2.num, by comparing these we don't need to count manually, and are thus safer from future expansion with specialized opcodes e.g.
  Fix expected fatal error, now is catchable fatal
  Adjust expected fatal error message Now also includes "on [TYPE]" after merge from master
  Check for memory leaks when not using return value
  Adjust expected fatal error message Now also includes "on [TYPE]" after merge from master
  Add tests with arrays as parameters
  ...
This commit is contained in:
Anatol Belski
2014-10-06 08:42:53 +02:00
54 changed files with 4919 additions and 4220 deletions

2
NEWS
View File

@@ -12,6 +12,8 @@ PHP NEWS
. Added Closure::apply() method. (Andrea)
. Implemented FR #38409 (parse_ini_file() looses the type of booleans). (Tjerk)
. Fixed #67959 (Segfault when calling phpversion('spl')). (Florian)
. Implemented the RFC `Catchable "Call to a member function bar() on a
non-object"` (Timm)
- Reflection
. Fixed inheritance chain of Reflector interface (Tjerk)

View File

@@ -22,6 +22,11 @@ PHP X.Y UPGRADE NOTES
========================================
- Core
. Added null coalesce operator (??).
(RFC: https://wiki.php.net/rfc/isset_ternary)
. list() now always supports ArrayAccess and never supports strings.
Previously both were accepted in some situations and not in others.
(RFC: https://wiki.php.net/rfc/fix_list_behavior_inconsistency)
. Bitwise shifts by negative numbers of bits are disallowed (throws E_WARNING
and gives FALSE, like a division by zero).
. Left bitwise shifts by a number of bits beyond the bit width of an integer
@@ -29,6 +34,8 @@ PHP X.Y UPGRADE NOTES
. Right bitwise shifts by a number of bits beyond the bit width of an integer
will always result in 0 or -1 (depending on sign), even on CPUs which wrap
around.
. Removed ASP (<%) and script (<script language=php>) tags.
(RFC: https://wiki.php.net/rfc/remove_alternative_php_tags)
- DBA
. dba_delete() now returns false if the key was not found for the inifile
@@ -102,6 +109,10 @@ PHP X.Y UPGRADE NOTES
11. Changes to INI File Handling
========================================
- Core
. Removed asp_tags ini directive. Trying to enable it will result in a fatal
error.
========================================
12. Windows Support
========================================
@@ -117,6 +128,8 @@ PHP X.Y UPGRADE NOTES
- Core
. Instead of being undefined and platform-dependant, NaN and Infinity will
always be zero when casted to integer.
. Calling a method on a non-object no longer raises a fatal error; see
also: https://wiki.php.net/rfc/catchable-call-to-member-of-non-object
- Standard
. call_user_method() and call_user_method_array() no longer exists.

17
Zend/tests/bug68148.phpt Normal file
View File

@@ -0,0 +1,17 @@
--TEST--
Bug #68148: $this is null inside include
--FILE--
<?php
class Test {
public function method() {
eval('var_dump($this);');
}
}
(new Test)->method();
?>
--EXPECT--
object(Test)#1 (0) {
}

View File

@@ -76,4 +76,4 @@ NULL
Notice: Undefined offset: 3 in %s on line %d
Fatal error: Call to a member function bar() on null in %s on line %d
Catchable fatal error: Call to a member function bar() on null in %s on line %d

View File

@@ -0,0 +1,18 @@
--TEST--
Catch method calls on non-objects raise recoverable errors
--FILE--
<?php
set_error_handler(function($code, $message) {
var_dump($code, $message);
});
$x= null;
var_dump($x->method(1, 2, 3));
echo "Alive\n";
?>
--EXPECTF--
int(4096)
string(%d) "Call to a member function method() on null"
NULL
Alive

View File

@@ -0,0 +1,18 @@
--TEST--
Catch method calls on non-objects inside array access
--FILE--
<?php
set_error_handler(function($code, $message) {
var_dump($code, $message);
});
$x= null;
$a= [null => 'OK'];
var_dump($a[$x->method()]);
echo "Alive\n";
?>
--EXPECTF--
int(4096)
string(%d) "Call to a member function method() on null"
string(2) "OK"
Alive

View File

@@ -0,0 +1,35 @@
--TEST--
Catch method calls on non-objects inside array creation
--FILE--
<?php
set_error_handler(function($code, $message) {
var_dump($code, $message);
});
$x= null;
var_dump([$x->method() => 'OK']);
var_dump([$x->method(), $x->method(), $x->method()]);
echo "Alive\n";
?>
--EXPECTF--
int(4096)
string(%d) "Call to a member function method() on null"
array(1) {
[""]=>
string(2) "OK"
}
int(4096)
string(%d) "Call to a member function method() on null"
int(4096)
string(%d) "Call to a member function method() on null"
int(4096)
string(%d) "Call to a member function method() on null"
array(3) {
[0]=>
NULL
[1]=>
NULL
[2]=>
NULL
}
Alive

View File

@@ -0,0 +1,47 @@
--TEST--
Catch method calls on non-objects as argument
--FILE--
<?php
function nesting() {
return func_get_args();
}
set_error_handler(function($code, $message) {
static $i= 0;
echo 'Called #'.(++$i)."\n";
});
$x= null;
var_dump(nesting($x->method()));
var_dump(nesting(nesting($x->method())));
var_dump(nesting($x->method(nesting($x->method()))));
var_dump(nesting($x->method(), $x->method()));
echo "Alive\n";
?>
--EXPECTF--
Called #1
array(1) {
[0]=>
NULL
}
Called #2
array(1) {
[0]=>
array(1) {
[0]=>
NULL
}
}
Called #3
array(1) {
[0]=>
NULL
}
Called #4
Called #5
array(2) {
[0]=>
NULL
[1]=>
NULL
}
Alive

View File

@@ -0,0 +1,13 @@
--TEST--
call_user_func() in combination with "Call to a member function method() on a non-object"
--FILE--
<?php
$comparator= null;
var_dump(call_user_func([$comparator, 'compare'], 1, 2));
echo "Alive\n";
?>
--EXPECTF--
Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d
NULL
Alive

View File

@@ -0,0 +1,18 @@
--TEST--
Catch method calls on non-objects raise recoverable errors
--FILE--
<?php
set_error_handler(function($code, $message) {
var_dump($code, $message);
});
$x= null;
var_dump($x->method());
echo "Alive\n";
?>
--EXPECTF--
int(4096)
string(%d) "Call to a member function method() on null"
NULL
Alive

View File

@@ -0,0 +1,22 @@
--TEST--
Catch chained method calls on non-objects raise recoverable errors
--FILE--
<?php
set_error_handler(function($code, $message) {
var_dump($code, $message);
});
$x= null;
var_dump($x->method()->chained()->invocations());
echo "Alive\n";
?>
--EXPECTF--
int(4096)
string(%d) "Call to a member function method() on null"
int(4096)
string(%d) "Call to a member function chained() on null"
int(4096)
string(%d) "Call to a member function invocations() on null"
NULL
Alive

View File

@@ -0,0 +1,18 @@
--TEST--
Catch method calls on non-objects inside concatenation
--FILE--
<?php
set_error_handler(function($code, $message) {
var_dump($code, $message);
});
$x= null;
echo "Before\n".$x->method()."After\n";
echo "Alive\n";
?>
--EXPECTF--
int(4096)
string(%d) "Call to a member function method() on null"
Before
After
Alive

View File

@@ -0,0 +1,23 @@
--TEST--
Catch method calls on non-objects with dynamic lookups
--FILE--
<?php
set_error_handler(function($code, $message) {
static $i= 0;
echo 'Called #'.(++$i)."\n";
});
$arr= [null, 'method'];
var_dump($arr[0]->{$arr[1]}());
$fun= function() { return null; };
var_dump($fun()->{'method'}());
echo "Alive\n";
?>
--EXPECTF--
Called #1
NULL
Called #2
NULL
Alive

View File

@@ -0,0 +1,18 @@
--TEST--
Indirect call inside eval to member function on non-object
--FILE--
<?php
set_error_handler(function($code, $message) {
var_dump($code, $message);
});
$x= null;
var_dump(eval('$x->method(1, 2, 3);'));
echo "Alive\n";
?>
--EXPECTF--
int(4096)
string(%d) "Call to a member function method() on null"
NULL
Alive

View File

@@ -0,0 +1,18 @@
--TEST--
Catch method calls on non-objects inside echo
--FILE--
<?php
set_error_handler(function($code, $message) {
var_dump($code, $message);
});
$x= null;
echo "Before\n", $x->method(), "After\n";
echo "Alive\n";
?>
--EXPECTF--
Before
int(4096)
string(%d) "Call to a member function method() on null"
After
Alive

View File

@@ -0,0 +1,37 @@
--TEST--
Catch method calls on non-objects with nested dynamic calls
--FILE--
<?php
function nested() {
throw new LogicException('Should not be called');
}
set_error_handler(function($code, $message) {
static $i= 0;
echo 'Called #'.(++$i)."\n";
});
$x= null;
$closure= function() { return nested(); };
var_dump($x->method($closure()));
$lambda= create_function('', 'return nested();');
var_dump($x->method($lambda()));
$func= 'nested';
var_dump($x->method($func()));
var_dump($x->method(call_user_func('nested')));
echo "Alive\n";
?>
--EXPECTF--
Called #1
NULL
Called #2
NULL
Called #3
NULL
Called #4
NULL
Alive

View File

@@ -0,0 +1,37 @@
--TEST--
Catch method calls on non-objects with nested calls to new
--FILE--
<?php
class Nesting {
}
set_error_handler(function($code, $message) {
static $i= 0;
echo 'Called #'.(++$i)."\n";
});
$x= null;
var_dump($x->method(new Nesting()));
var_dump($x->method(new Nesting(), new Nesting()));
var_dump($x->method(new Nesting(new Nesting())));
var_dump($x->method(new Nesting($x->nested())));
var_dump($x->method(new Nesting($x->nested(new Nesting()))));
var_dump($x->method($x->nested(new Nesting($x->deep()))));
var_dump($x->method([new Nesting()]));
echo "Alive\n";
?>
--EXPECTF--
Called #1
NULL
Called #2
NULL
Called #3
NULL
Called #4
NULL
Called #5
NULL
Called #6
NULL
Called #7
NULL
Alive

View File

@@ -0,0 +1,43 @@
--TEST--
Catch method calls on non-objects with nested non-compile-time-resolveable calls
--FILE--
<?php
require('methods-on-non-objects-nested.inc');
set_error_handler(function($code, $message) {
static $i= 0;
echo 'Called #'.(++$i)."\n";
});
$x= null;
var_dump($x->method(nested()));
$closure= function() { return nested(); };
var_dump($x->method($closure()));
$lambda= create_function('', 'return nested();');
var_dump($x->method($lambda()));
$func= 'nested';
var_dump($x->method($func()));
var_dump($x->method(call_user_func('nested')));
var_dump($x->method(call_user_func_array('nested', [])));
echo "Alive\n";
?>
--EXPECTF--
Called #1
NULL
Called #2
NULL
Called #3
NULL
Called #4
NULL
Called #5
NULL
Called #6
NULL
Alive

View File

@@ -0,0 +1,26 @@
--TEST--
Catch method calls on non-objects with nested calls to namespaced functions with core counterparts
--FILE--
<?php namespace test;
function strlen($str) {
throw new LogicException('Should not be called');
}
set_error_handler(function($code, $message) {
static $i= 0;
echo 'Called #'.(++$i)."\n";
});
$x= null;
var_dump($x->method(strlen('Test')));
var_dump($x->method(strlen('Test'), strlen('Test')));
var_dump($x->method([strlen('Test')]));
echo "Alive\n";
?>
--EXPECTF--
Called #1
NULL
Called #2
NULL
Called #3
NULL
Alive

View File

@@ -0,0 +1,33 @@
--TEST--
Catch method calls on non-objects with nested calls to static methods
--FILE--
<?php
class Nesting {
static function nested() {
throw new LogicException('Should not be called');
}
}
set_error_handler(function($code, $message) {
static $i= 0;
echo 'Called #'.(++$i)."\n";
});
$x= null;
$class= 'Nesting';
$method= 'nested';
var_dump($x->method(Nesting::nested()));
var_dump($x->method($class::nested()));
var_dump($x->method($class::{$method}()));
var_dump($x->method([Nesting::nested()]));
echo "Alive\n";
?>
--EXPECTF--
Called #1
NULL
Called #2
NULL
Called #3
NULL
Called #4
NULL
Alive

View File

@@ -0,0 +1,47 @@
--TEST--
Catch method calls on non-objects with nested function and method calls
--FILE--
<?php
function nested() {
throw new LogicException('Should not be called');
}
set_error_handler(function($code, $message) {
static $i= 0;
echo 'Called #'.(++$i)."\n";
});
$x= null;
var_dump($x->method(nested()));
var_dump($x->method(nested(), nested()));
var_dump($x->method(nested(nested())));
var_dump($x->method($x->nested()));
var_dump($x->method($x->nested(), $x->nested()));
var_dump($x->method($x->nested(nested())));
var_dump($x->method($x->nested($x->deep())));
var_dump($x->method($x->nested(nested($x->deep()))));
var_dump($x->method(nested(nested($x->nested()))));
var_dump($x->method([nested()]));
echo "Alive\n";
?>
--EXPECTF--
Called #1
NULL
Called #2
NULL
Called #3
NULL
Called #4
NULL
Called #5
NULL
Called #6
NULL
Called #7
NULL
Called #8
NULL
Called #9
NULL
Called #10
NULL
Alive

View File

@@ -0,0 +1,4 @@
<?php
function nested() {
throw new LogicException('Should not be called');
}

View File

@@ -0,0 +1,17 @@
--TEST--
Catch method calls on non-objects without using return value
--INI--
report_memleaks=1
--FILE--
<?php
set_error_handler(function($code, $message) {
echo "Caught\n";
});
$x= null;
$x->method();
echo "Alive\n";
?>
--EXPECTF--
Caught
Alive

View File

@@ -0,0 +1,29 @@
--TEST--
Convert errors to exceptions from method calls on non-objects raise recoverable errors
--FILE--
<?php
set_error_handler(function($code, $message) {
echo "Raising...\n";
if (0 === strncmp('Call', $message, 4)) {
throw new BadMethodCallException($message);
} else if (0 === strncmp('Argument', $message, 8)) {
throw new InvalidArgumentException($message);
} else {
trigger_error($message, E_USER_ERROR);
}
}, E_RECOVERABLE_ERROR);
$x= null;
echo "Calling...\n";
try {
$x->method();
} catch (BadMethodCallException $e) {
echo "Caught expected ", $e->getMessage(), "!\n";
}
echo "Alive\n";
?>
--EXPECTF--
Calling...
Raising...
Caught expected Call to a member function method() on null!
Alive

View File

@@ -0,0 +1,43 @@
--TEST--
usort() in combination with "Call to a member function method() on null"
--FILE--
<?php
set_error_handler(function($code, $message) {
var_dump($code, $message);
});
$comparator= null;
$list= [1, 4, 2, 3, -1];
usort($list, function($a, $b) use ($comparator) {
return $comparator->compare($a, $b);
});
var_dump($list);
echo "Alive\n";
?>
--EXPECTF--
int(4096)
string(43) "Call to a member function compare() on null"
int(4096)
string(43) "Call to a member function compare() on null"
int(4096)
string(43) "Call to a member function compare() on null"
int(4096)
string(43) "Call to a member function compare() on null"
int(4096)
string(43) "Call to a member function compare() on null"
int(4096)
string(43) "Call to a member function compare() on null"
array(5) {
[0]=>
int(-1)
[1]=>
int(3)
[2]=>
int(2)
[3]=>
int(4)
[4]=>
int(1)
}
Alive

View File

@@ -0,0 +1,12 @@
--TEST--
Method calls on non-objects raise recoverable errors
--FILE--
<?php
$x= null;
$x->method();
echo "Should not get here!\n";
?>
--EXPECTF--
Catchable fatal error: Call to a member function method() on null in %s on line %d

View File

@@ -373,11 +373,9 @@ static FILE *zend_fopen_wrapper(const char *filename, char **opened_path TSRMLS_
/* }}} */
#ifdef ZTS
static zend_bool asp_tags_default = 0;
static zend_bool short_tags_default = 1;
static zend_bool short_tags_default = 1;
static uint32_t compiler_options_default = ZEND_COMPILE_DEFAULT;
#else
# define asp_tags_default 0
# define short_tags_default 1
# define compiler_options_default ZEND_COMPILE_DEFAULT
#endif
@@ -385,7 +383,6 @@ static uint32_t compiler_options_default = ZEND_COMPILE_DEFAULT;
static void zend_set_default_compile_time_values(TSRMLS_D) /* {{{ */
{
/* default compile-time values */
CG(asp_tags) = asp_tags_default;
CG(short_tags) = short_tags_default;
CG(compiler_options) = compiler_options_default;
}
@@ -723,7 +720,6 @@ void zend_post_startup(TSRMLS_D) /* {{{ */
*GLOBAL_CLASS_TABLE = *compiler_globals->class_table;
*GLOBAL_CONSTANTS_TABLE = *executor_globals->zend_constants;
asp_tags_default = CG(asp_tags);
short_tags_default = CG(short_tags);
compiler_options_default = CG(compiler_options);

View File

@@ -2186,7 +2186,6 @@ static void zend_compile_list_assign(znode *result, zend_ast *ast, znode *expr_n
for (i = 0; i < list->children; ++i) {
zend_ast *var_ast = list->child[i];
znode fetch_result, dim_node;
zend_op *opline;
if (var_ast == NULL) {
continue;
@@ -2199,9 +2198,7 @@ static void zend_compile_list_assign(znode *result, zend_ast *ast, znode *expr_n
Z_TRY_ADDREF(expr_node->u.constant);
}
opline = zend_emit_op(&fetch_result,
ZEND_FETCH_LIST, expr_node, &dim_node TSRMLS_CC);
zend_emit_op(&fetch_result, ZEND_FETCH_LIST, expr_node, &dim_node TSRMLS_CC);
zend_emit_assign_znode(var_ast, &fetch_result TSRMLS_CC);
}
*result = *expr_node;

View File

@@ -462,10 +462,13 @@ static inline zval *_get_obj_zval_ptr_ptr(int op_type, const znode_op *node, zen
static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *value_ptr TSRMLS_DC)
{
if (EXPECTED(variable_ptr != value_ptr)) {
zend_reference *ref;
ZVAL_MAKE_REF(value_ptr);
Z_ADDREF_P(value_ptr);
ref = Z_REF_P(value_ptr);
zval_ptr_dtor(variable_ptr);
ZVAL_REF(variable_ptr, Z_REF_P(value_ptr));
ZVAL_REF(variable_ptr, ref);
} else {
ZVAL_MAKE_REF(variable_ptr);
}
@@ -1503,6 +1506,11 @@ static zend_always_inline void i_init_code_execute_data(zend_execute_data *execu
zend_attach_symbol_table(execute_data);
if (op_array->this_var != -1 && Z_OBJ(EX(This))) {
ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This)));
GC_REFCOUNT(Z_OBJ(EX(This)))++;
}
if (!op_array->run_time_cache && op_array->last_cache_slot) {
op_array->run_time_cache = ecalloc(op_array->last_cache_slot, sizeof(void*));
}
@@ -1570,11 +1578,11 @@ static zend_always_inline void i_init_execute_data(zend_execute_data *execute_da
var++;
} while (var != end);
}
}
if (op_array->this_var != -1 && Z_OBJ(EX(This))) {
ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This)));
GC_REFCOUNT(Z_OBJ(EX(This)))++;
}
if (op_array->this_var != -1 && Z_OBJ(EX(This))) {
ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This)));
GC_REFCOUNT(Z_OBJ(EX(This)))++;
}
if (!op_array->run_time_cache && op_array->last_cache_slot) {

View File

@@ -826,8 +826,10 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
call->num_args = fci->param_count;
EG(scope) = calling_scope;
if (!fci->object ||
(func->common.fn_flags & ZEND_ACC_STATIC)) {
if (func->common.fn_flags & ZEND_ACC_STATIC) {
fci->object = NULL;
}
if (!fci->object) {
Z_OBJ(call->This) = NULL;
Z_TYPE_INFO(call->This) = IS_UNDEF;
} else {
@@ -905,7 +907,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
}
}
if (fci->object && !(func->common.fn_flags & ZEND_ACC_STATIC)) {
if (fci->object) {
OBJ_RELEASE(fci->object);
}

View File

@@ -91,7 +91,6 @@ struct _zend_compiler_globals {
zend_bool parse_error;
zend_bool in_compilation;
zend_bool short_tags;
zend_bool asp_tags;
zend_declarables declarables;

File diff suppressed because it is too large Load Diff

View File

@@ -989,8 +989,6 @@ int lex_scan(zval *zendlval TSRMLS_DC)
restart:
SCNG(yy_text) = YYCURSOR;
yymore_restart:
/*!re2c
re2c:yyfill:check = 0;
LNUM [0-9]+
@@ -1607,30 +1605,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
return T_NS_C;
}
<INITIAL>"<script"{WHITESPACE}+"language"{WHITESPACE}*"="{WHITESPACE}*("php"|"\"php\""|"'php'"){WHITESPACE}*">" {
YYCTYPE *bracket = (YYCTYPE*)zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1));
if (bracket != SCNG(yy_text)) {
/* Handle previously scanned HTML, as possible <script> tags found are assumed to not be PHP's */
YYCURSOR = bracket;
goto inline_html;
}
HANDLE_NEWLINES(yytext, yyleng);
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
}
<INITIAL>"<%=" {
if (CG(asp_tags)) {
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG_WITH_ECHO;
} else {
goto inline_char_handler;
}
}
<INITIAL>"<?=" {
BEGIN(ST_IN_SCRIPTING);
@@ -1638,16 +1612,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<INITIAL>"<%" {
if (CG(asp_tags)) {
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
} else {
goto inline_char_handler;
}
}
<INITIAL>"<?php"([ \t]|{NEWLINE}) {
HANDLE_NEWLINE(yytext[yyleng-1]);
BEGIN(ST_IN_SCRIPTING);
@@ -1676,35 +1640,19 @@ inline_char_handler:
YYCURSOR = ptr ? ptr + 1 : YYLIMIT;
if (YYCURSOR < YYLIMIT) {
switch (*YYCURSOR) {
case '?':
if (CG(short_tags) || !strncasecmp((char*)YYCURSOR + 1, "php", 3) || (*(YYCURSOR + 1) == '=')) { /* Assume [ \t\n\r] follows "php" */
break;
}
continue;
case '%':
if (CG(asp_tags)) {
break;
}
continue;
case 's':
case 'S':
/* Probably NOT an opening PHP <script> tag, so don't end the HTML chunk yet
* If it is, the PHP <script> tag rule checks for any HTML scanned before it */
YYCURSOR--;
yymore();
default:
continue;
}
YYCURSOR--;
if (YYCURSOR >= YYLIMIT) {
break;
}
break;
if (*YYCURSOR == '?') {
if (CG(short_tags) || !strncasecmp((char*)YYCURSOR + 1, "php", 3) || (*(YYCURSOR + 1) == '=')) { /* Assume [ \t\n\r] follows "php" */
YYCURSOR--;
break;
}
}
}
inline_html:
yyleng = YYCURSOR - SCNG(yy_text);
if (SCNG(output_filter)) {
@@ -1785,11 +1733,6 @@ inline_html:
case '\n':
CG(zend_lineno)++;
break;
case '%':
if (!CG(asp_tags)) {
continue;
}
/* fall through */
case '?':
if (*YYCURSOR == '>') {
YYCURSOR--;
@@ -1841,23 +1784,12 @@ inline_html:
return T_COMMENT;
}
<ST_IN_SCRIPTING>("?>"|"</script"{WHITESPACE}*">"){NEWLINE}? {
<ST_IN_SCRIPTING>"?>"{NEWLINE}? {
BEGIN(INITIAL);
return T_CLOSE_TAG; /* implicit ';' at php-end tag */
}
<ST_IN_SCRIPTING>"%>"{NEWLINE}? {
if (CG(asp_tags)) {
BEGIN(INITIAL);
return T_CLOSE_TAG; /* implicit ';' at php-end tag */
} else {
yyless(1);
return yytext[0];
}
}
<ST_IN_SCRIPTING>b?['] {
register char *s, *t;
char *end;

View File

@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.6 */
/* Generated by re2c 0.13.5 */
#line 3 "Zend/zend_language_scanner_defs.h"
enum YYCONDTYPE {

View File

@@ -2139,11 +2139,48 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV)
object = GET_OP1_OBJ_ZVAL_PTR_DEREF(BP_VAR_R);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
FREE_OP2();
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
FREE_OP2();
FREE_OP1_IF_VAR();
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);

View File

@@ -11003,11 +11003,47 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO
object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);
@@ -12135,11 +12171,47 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE
object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor_nogc(free_op2.var);
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zval_ptr_dtor_nogc(free_op2.var);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);
@@ -13266,11 +13338,47 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE
object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor_nogc(free_op2.var);
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zval_ptr_dtor_nogc(free_op2.var);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);
@@ -14990,11 +15098,47 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_
object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);
@@ -18568,11 +18712,48 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO
object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zval_ptr_dtor_nogc(free_op1.var);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);
@@ -20790,11 +20971,48 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE
object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor_nogc(free_op2.var);
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zval_ptr_dtor_nogc(free_op2.var);
zval_ptr_dtor_nogc(free_op1.var);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);
@@ -22979,11 +23197,48 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE
object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor_nogc(free_op2.var);
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zval_ptr_dtor_nogc(free_op2.var);
zval_ptr_dtor_nogc(free_op1.var);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);
@@ -26364,11 +26619,48 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_
object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zval_ptr_dtor_nogc(free_op1.var);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);
@@ -27945,11 +28237,47 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_O
object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);
@@ -29308,11 +29636,47 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPC
object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor_nogc(free_op2.var);
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zval_ptr_dtor_nogc(free_op2.var);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);
@@ -30578,11 +30942,47 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC
object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor_nogc(free_op2.var);
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zval_ptr_dtor_nogc(free_op2.var);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);
@@ -32358,11 +32758,47 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCO
object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);
@@ -35674,11 +36110,47 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCOD
object = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);
@@ -37729,11 +38201,47 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_
object = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor_nogc(free_op2.var);
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zval_ptr_dtor_nogc(free_op2.var);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);
@@ -39789,11 +40297,47 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_
object = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor_nogc(free_op2.var);
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zval_ptr_dtor_nogc(free_op2.var);
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);
@@ -42900,11 +43444,47 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_H
object = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
zend_error(E_RECOVERABLE_ERROR, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
if (EG(exception) != NULL) {
HANDLE_EXCEPTION();
}
/* No exception raised: Skip over arguments until fcall opcode with correct
* nesting level. Return NULL (except when return value unused) */
do {
opline++;
if (opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_NEW
) {
nesting++;
} else if (opline->opcode == ZEND_DO_FCALL) {
nesting--;
}
} while (nesting);
if (RETURN_VALUE_USED(opline)) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
/* We've skipped EXT_FCALL_BEGIND, so also skip the ending opcode */
if ((opline + 1)->opcode == ZEND_EXT_FCALL_END) {
opline++;
}
ZEND_VM_JMP(++opline);
}
obj = Z_OBJ_P(object);

View File

@@ -26,3 +26,4 @@ new mydt("Funktionsansvarig rådgivning och juridik", "UTC");
Warning: DateTime::format(): The DateTime object has not been correctly initialized by its constructor in %s on line %d
Bad date

View File

@@ -1,7 +1,7 @@
--TEST--
Bug #33491 (extended mysqli class crashes when result is not object)
--INI--
error_reporting=4095
error_reporting=4096
--SKIPIF--
<?php
require_once('skipif.inc');
@@ -26,4 +26,4 @@ $DB->query_single('SELECT DATE()');
?>
--EXPECTF--
Fatal error: Call to a member function fetch_row() on boolean in %sbug33491.php on line %d
Catchable fatal error: Call to a member function fetch_row() on boolean in %sbug33491.php on line %d

View File

@@ -41,4 +41,4 @@ Warning: mysqli_query(): MySQL server has gone away in %s on line %d
Warning: mysqli_query(): Error reading result set's header in %s on line %d
[003] [2006] MySQL server has gone away
Fatal error: Call to a member function fetch_assoc() on %s in %s on line %d
Catchable fatal error: Call to a member function fetch_assoc() on %s in %s on line %d

View File

@@ -93,4 +93,4 @@ array(1) {
Warning: PDO::prepare(): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'unknown_column' in 'field list' in %s on line %d
Fatal error: Call to a member function execute() on boolean in %s on line %d
Catchable fatal error: Call to a member function execute() on boolean in %s on line %d

View File

@@ -36,4 +36,4 @@ Warning: PDO::prepare(): SQLSTATE[HY093]: Invalid parameter number: mixed named
Warning: PDO::prepare(): SQLSTATE[HY093]: Invalid parameter number in %s on line %d
Fatal error: Call to a member function execute() on boolean in %s on line %d
Catchable fatal error: Call to a member function execute() on boolean in %s on line %d

View File

@@ -56,4 +56,4 @@ Testing native PS...
Warning: PDO::prepare(): SQLSTATE[42S02]: Base table or view not found: 1146 Table '%s.ihopeitdoesnotexist' doesn't exist in %s on line %d
Fatal error: Call to a member function execute() on boolean in %s on line %d
Catchable fatal error: Call to a member function execute() on boolean in %s on line %d

View File

@@ -99,4 +99,4 @@ Native Prepared Statements...
Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near '%SSELECT label FROM test ORDER BY id ASC LIMIT 1' at line %d in %s on line %d
Fatal error: Call to a member function errorInfo() on boolean in %s on line %d
Catchable fatal error: Call to a member function errorInfo() on boolean in %s on line %d

View File

@@ -270,12 +270,6 @@ static int cli_is_valid_code(char *code, int len, zend_string **prompt TSRMLS_DC
}
valid_end = 0;
break;
case '%':
if (!CG(asp_tags)) {
valid_end = 0;
break;
}
/* no break */
case '?':
if (code[i+1] == '>') {
i++;
@@ -360,7 +354,6 @@ static int cli_is_valid_code(char *code, int len, zend_string **prompt TSRMLS_DC
break;
case outside:
if ((CG(short_tags) && !strncmp(code+i-1, "<?", 2))
|| (CG(asp_tags) && !strncmp(code+i-1, "<%", 2))
|| (i > 3 && !strncmp(code+i-4, "<?php", 5))
) {
code_type = body;

View File

@@ -51,6 +51,7 @@ void tokenizer_register_constants(INIT_FUNC_ARGS) {
REGISTER_LONG_CONSTANT("T_MUL_EQUAL", T_MUL_EQUAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_MINUS_EQUAL", T_MINUS_EQUAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_PLUS_EQUAL", T_PLUS_EQUAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_COALESCE", T_COALESCE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_BOOLEAN_OR", T_BOOLEAN_OR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_BOOLEAN_AND", T_BOOLEAN_AND, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_IS_NOT_IDENTICAL", T_IS_NOT_IDENTICAL, CONST_CS | CONST_PERSISTENT);
@@ -74,22 +75,29 @@ void tokenizer_register_constants(INIT_FUNC_ARGS) {
REGISTER_LONG_CONSTANT("T_POW", T_POW, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_CLONE", T_CLONE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_NEW", T_NEW, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_EXIT", T_EXIT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_IF", T_IF, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_ELSEIF", T_ELSEIF, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_ELSE", T_ELSE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_ENDIF", T_ENDIF, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_PUBLIC", T_PUBLIC, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_PROTECTED", T_PROTECTED, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_PRIVATE", T_PRIVATE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_FINAL", T_FINAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_ABSTRACT", T_ABSTRACT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_STATIC", T_STATIC, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_DOUBLE_ARROW", T_DOUBLE_ARROW, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_LNUMBER", T_LNUMBER, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_DNUMBER", T_DNUMBER, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_STRING", T_STRING, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_STRING_VARNAME", T_STRING_VARNAME, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_VARIABLE", T_VARIABLE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_NUM_STRING", T_NUM_STRING, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_INLINE_HTML", T_INLINE_HTML, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_CHARACTER", T_CHARACTER, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_BAD_CHARACTER", T_BAD_CHARACTER, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_ENCAPSED_AND_WHITESPACE", T_ENCAPSED_AND_WHITESPACE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_CONSTANT_ENCAPSED_STRING", T_CONSTANT_ENCAPSED_STRING, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_STRING_VARNAME", T_STRING_VARNAME, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_NUM_STRING", T_NUM_STRING, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_EXIT", T_EXIT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_IF", T_IF, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_CHARACTER", T_CHARACTER, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_BAD_CHARACTER", T_BAD_CHARACTER, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_ECHO", T_ECHO, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_DO", T_DO, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_WHILE", T_WHILE, CONST_CS | CONST_PERSISTENT);
@@ -118,12 +126,6 @@ void tokenizer_register_constants(INIT_FUNC_ARGS) {
REGISTER_LONG_CONSTANT("T_USE", T_USE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_INSTEADOF", T_INSTEADOF, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_GLOBAL", T_GLOBAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_PUBLIC", T_PUBLIC, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_PROTECTED", T_PROTECTED, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_PRIVATE", T_PRIVATE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_FINAL", T_FINAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_ABSTRACT", T_ABSTRACT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_STATIC", T_STATIC, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_VAR", T_VAR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_UNSET", T_UNSET, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_ISSET", T_ISSET, CONST_CS | CONST_PERSISTENT);
@@ -135,16 +137,16 @@ void tokenizer_register_constants(INIT_FUNC_ARGS) {
REGISTER_LONG_CONSTANT("T_EXTENDS", T_EXTENDS, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_IMPLEMENTS", T_IMPLEMENTS, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_OBJECT_OPERATOR", T_OBJECT_OPERATOR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_DOUBLE_ARROW", T_DOUBLE_ARROW, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_LIST", T_LIST, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_ARRAY", T_ARRAY, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_CALLABLE", T_CALLABLE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_LINE", T_LINE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_FILE", T_FILE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_DIR", T_DIR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_CLASS_C", T_CLASS_C, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_TRAIT_C", T_TRAIT_C, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_METHOD_C", T_METHOD_C, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_FUNC_C", T_FUNC_C, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_LINE", T_LINE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_FILE", T_FILE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_COMMENT", T_COMMENT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_DOC_COMMENT", T_DOC_COMMENT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_OPEN_TAG", T_OPEN_TAG, CONST_CS | CONST_PERSISTENT);
@@ -158,7 +160,6 @@ void tokenizer_register_constants(INIT_FUNC_ARGS) {
REGISTER_LONG_CONSTANT("T_PAAMAYIM_NEKUDOTAYIM", T_PAAMAYIM_NEKUDOTAYIM, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_NAMESPACE", T_NAMESPACE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_NS_C", T_NS_C, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_DIR", T_DIR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_NS_SEPARATOR", T_NS_SEPARATOR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_ELLIPSIS", T_ELLIPSIS, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_DOUBLE_COLON", T_PAAMAYIM_NEKUDOTAYIM, CONST_CS | CONST_PERSISTENT);
@@ -190,6 +191,7 @@ char *get_token_type_name(int token_type)
case T_MUL_EQUAL: return "T_MUL_EQUAL";
case T_MINUS_EQUAL: return "T_MINUS_EQUAL";
case T_PLUS_EQUAL: return "T_PLUS_EQUAL";
case T_COALESCE: return "T_COALESCE";
case T_BOOLEAN_OR: return "T_BOOLEAN_OR";
case T_BOOLEAN_AND: return "T_BOOLEAN_AND";
case T_IS_NOT_IDENTICAL: return "T_IS_NOT_IDENTICAL";
@@ -213,22 +215,29 @@ char *get_token_type_name(int token_type)
case T_POW: return "T_POW";
case T_CLONE: return "T_CLONE";
case T_NEW: return "T_NEW";
case T_EXIT: return "T_EXIT";
case T_IF: return "T_IF";
case T_ELSEIF: return "T_ELSEIF";
case T_ELSE: return "T_ELSE";
case T_ENDIF: return "T_ENDIF";
case T_PUBLIC: return "T_PUBLIC";
case T_PROTECTED: return "T_PROTECTED";
case T_PRIVATE: return "T_PRIVATE";
case T_FINAL: return "T_FINAL";
case T_ABSTRACT: return "T_ABSTRACT";
case T_STATIC: return "T_STATIC";
case T_DOUBLE_ARROW: return "T_DOUBLE_ARROW";
case T_LNUMBER: return "T_LNUMBER";
case T_DNUMBER: return "T_DNUMBER";
case T_STRING: return "T_STRING";
case T_STRING_VARNAME: return "T_STRING_VARNAME";
case T_VARIABLE: return "T_VARIABLE";
case T_NUM_STRING: return "T_NUM_STRING";
case T_INLINE_HTML: return "T_INLINE_HTML";
case T_CHARACTER: return "T_CHARACTER";
case T_BAD_CHARACTER: return "T_BAD_CHARACTER";
case T_ENCAPSED_AND_WHITESPACE: return "T_ENCAPSED_AND_WHITESPACE";
case T_CONSTANT_ENCAPSED_STRING: return "T_CONSTANT_ENCAPSED_STRING";
case T_STRING_VARNAME: return "T_STRING_VARNAME";
case T_NUM_STRING: return "T_NUM_STRING";
case T_EXIT: return "T_EXIT";
case T_IF: return "T_IF";
case T_CHARACTER: return "T_CHARACTER";
case T_BAD_CHARACTER: return "T_BAD_CHARACTER";
case T_ECHO: return "T_ECHO";
case T_DO: return "T_DO";
case T_WHILE: return "T_WHILE";
@@ -257,12 +266,6 @@ char *get_token_type_name(int token_type)
case T_USE: return "T_USE";
case T_INSTEADOF: return "T_INSTEADOF";
case T_GLOBAL: return "T_GLOBAL";
case T_PUBLIC: return "T_PUBLIC";
case T_PROTECTED: return "T_PROTECTED";
case T_PRIVATE: return "T_PRIVATE";
case T_FINAL: return "T_FINAL";
case T_ABSTRACT: return "T_ABSTRACT";
case T_STATIC: return "T_STATIC";
case T_VAR: return "T_VAR";
case T_UNSET: return "T_UNSET";
case T_ISSET: return "T_ISSET";
@@ -274,16 +277,16 @@ char *get_token_type_name(int token_type)
case T_EXTENDS: return "T_EXTENDS";
case T_IMPLEMENTS: return "T_IMPLEMENTS";
case T_OBJECT_OPERATOR: return "T_OBJECT_OPERATOR";
case T_DOUBLE_ARROW: return "T_DOUBLE_ARROW";
case T_LIST: return "T_LIST";
case T_ARRAY: return "T_ARRAY";
case T_CALLABLE: return "T_CALLABLE";
case T_LINE: return "T_LINE";
case T_FILE: return "T_FILE";
case T_DIR: return "T_DIR";
case T_CLASS_C: return "T_CLASS_C";
case T_TRAIT_C: return "T_TRAIT_C";
case T_METHOD_C: return "T_METHOD_C";
case T_FUNC_C: return "T_FUNC_C";
case T_LINE: return "T_LINE";
case T_FILE: return "T_FILE";
case T_COMMENT: return "T_COMMENT";
case T_DOC_COMMENT: return "T_DOC_COMMENT";
case T_OPEN_TAG: return "T_OPEN_TAG";
@@ -297,7 +300,6 @@ char *get_token_type_name(int token_type)
case T_PAAMAYIM_NEKUDOTAYIM: return "T_DOUBLE_COLON";
case T_NAMESPACE: return "T_NAMESPACE";
case T_NS_C: return "T_NS_C";
case T_DIR: return "T_DIR";
case T_NS_SEPARATOR: return "T_NS_SEPARATOR";
case T_ELLIPSIS: return "T_ELLIPSIS";

View File

@@ -45,8 +45,8 @@ echo '/*
echo 'void tokenizer_register_constants(INIT_FUNC_ARGS) {' >> $OUTFILE
$AWK '/^#define T_/ { print " REGISTER_INT_CONSTANT(\"" $2 "\", " $2 ", CONST_CS | CONST_PERSISTENT);" }' < $INFILE >> $OUTFILE
echo ' REGISTER_INT_CONSTANT("T_DOUBLE_COLON", T_PAAMAYIM_NEKUDOTAYIM, CONST_CS | CONST_PERSISTENT);' >> $OUTFILE
$AWK '/^#define T_/ { print " REGISTER_LONG_CONSTANT(\"" $2 "\", " $2 ", CONST_CS | CONST_PERSISTENT);" }' < $INFILE >> $OUTFILE
echo ' REGISTER_LONG_CONSTANT("T_DOUBLE_COLON", T_PAAMAYIM_NEKUDOTAYIM, CONST_CS | CONST_PERSISTENT);' >> $OUTFILE
echo '}' >> $OUTFILE

View File

@@ -528,7 +528,6 @@ PHP_INI_BEGIN()
PHP_INI_ENTRY_EX("highlight.keyword", HL_KEYWORD_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
PHP_INI_ENTRY_EX("highlight.string", HL_STRING_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
STD_PHP_INI_BOOLEAN("asp_tags", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, asp_tags, zend_compiler_globals, compiler_globals)
STD_PHP_INI_ENTRY_EX("display_errors", "1", PHP_INI_ALL, OnUpdateDisplayErrors, display_errors, php_core_globals, core_globals, display_errors_mode)
STD_PHP_INI_BOOLEAN("display_startup_errors", "0", PHP_INI_ALL, OnUpdateBool, display_startup_errors, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("enable_dl", "1", PHP_INI_SYSTEM, OnUpdateBool, enable_dl, php_core_globals, core_globals)
@@ -2317,7 +2316,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
struct {
const long error_level;
const char *phrase;
const char *directives[16]; /* Remember to change this if the number of directives change */
const char *directives[17]; /* Remember to change this if the number of directives change */
} directives[2] = {
{
E_DEPRECATED,
@@ -2331,6 +2330,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
"Directive '%s' is no longer available in PHP",
{
"allow_call_time_pass_reference",
"asp_tags",
"define_syslog_variables",
"highlight.bg",
"magic_quotes_gpc",

View File

@@ -1,8 +1,8 @@
/* automatically generated by configure */
/* edit configure.in to change version number */
#define PHP_MAJOR_VERSION 7
#define PHP_MINOR_VERSION 0
#define PHP_MAJOR_VERSION 5
#define PHP_MINOR_VERSION 7
#define PHP_RELEASE_VERSION 0
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "7.0.0-dev"
#define PHP_VERSION_ID 70000
#define PHP_VERSION "5.7.0-dev"
#define PHP_VERSION_ID 50700

View File

@@ -201,10 +201,6 @@ engine = On
; http://php.net/short-open-tag
short_open_tag = Off
; Allow ASP-style <% %> tags.
; http://php.net/asp-tags
asp_tags = Off
; The number of significant digits displayed in floating point numbers.
; http://php.net/precision
precision = 14

View File

@@ -201,10 +201,6 @@ engine = On
; http://php.net/short-open-tag
short_open_tag = Off
; Allow ASP-style <% %> tags.
; http://php.net/asp-tags
asp_tags = Off
; The number of significant digits displayed in floating point numbers.
; http://php.net/precision
precision = 14

View File

@@ -594,6 +594,9 @@ if (isset($argc) && $argc > 1) {
}
$pass_option_n = true;
break;
case 'e':
$pass_options .= ' -e';
break;
case '--no-clean':
$no_clean = true;
break;

View File

@@ -1,17 +0,0 @@
--TEST--
<script> tag
--FILE--
<script language=php> echo "ola\n";</script>
<script language="php"> echo "ola2\n";</script>
<script language='php'> echo "ola3\n";</script>
texto <sc <s <script> <script language> <script language=>
<script language=php>
#comment
echo "oi\n"; //ignore here
# 2nd comment
--EXPECT--
ola
ola2
ola3
texto <sc <s <script> <script language> <script language=>
oi

View File

@@ -1,32 +0,0 @@
--TEST--
short_open_tag: On, asp_tags: On
--INI--
short_open_tag=on
asp_tags=on
--FILE--
<?='this should get echoed'?>
<%= 'so should this' %>
<?php
$a = 'This gets echoed twice';
?>
<?= $a?>
<%= $a%>
<? $b=3; ?>
<?php
echo "{$b}";
?>
--EXPECT--
this should get echoed
so should this
This gets echoed twice
This gets echoed twice
3

View File

@@ -1,8 +1,7 @@
--TEST--
short_open_tag: Off, asp_tags: Off
short_open_tag: Off
--INI--
short_open_tag=off
asp_tags=off
--FILE--
<%= 'so should this' %>