diff --git a/NEWS b/NEWS index 09326b981d689..84f7de878cd58 100644 --- a/NEWS +++ b/NEWS @@ -2,9 +2,16 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.5.0beta3 +- Opcache: + . Fixed bug GH-19486 (Incorrect opline after deoptimization). (Arnaud) + - Session: . Fix RC violation of session SID constant deprecation attribute. (ilutov) +- Standard: + . Fix GH-19610 (Deprecation warnings in functions taking as argument). + (Girgias) + - URI: . Fixed memory management of Uri\WhatWg\Url objects. (timwolla) . Fixed memory management of the internal "parse_url" URI parser. diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 0a7ab7da1bd5f..875239515441e 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -7800,6 +7800,8 @@ static void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32 ZSTR_VAL(name)); } else if (zend_string_equals(name, ZSTR_KNOWN(ZEND_STR_THIS))) { zend_error_noreturn(E_COMPILE_ERROR, "Cannot use $this as parameter"); + } else if (zend_string_equals_literal(name, "http_response_header")) { + CG(context).has_assigned_to_http_response_header = true; } if (op_array->fn_flags & ZEND_ACC_VARIADIC) { diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index 4e0b5d45b5f39..842dbbf7c01df 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -17377,16 +17377,8 @@ static int zend_jit_trace_return(zend_jit_ctx *jit, bool original_handler, const addr = ir_CAST_FC_FUNC(addr); #endif ref = ir_CALL_2(IR_ADDR, addr, jit_FP(jit), jit_IP(jit)); - if (opline && - (opline->opcode == ZEND_RETURN - || opline->opcode == ZEND_RETURN_BY_REF - || opline->opcode == ZEND_GENERATOR_RETURN - || opline->opcode == ZEND_GENERATOR_CREATE - || opline->opcode == ZEND_YIELD - || opline->opcode == ZEND_YIELD_FROM)) { - zend_jit_vm_enter(jit, ref); - return 1; - } + zend_jit_vm_enter(jit, ref); + return 1; } zend_jit_vm_enter(jit, jit_IP(jit)); } diff --git a/ext/opcache/tests/jit/gh19486.phpt b/ext/opcache/tests/jit/gh19486.phpt new file mode 100644 index 0000000000000..8a0c610ed200a --- /dev/null +++ b/ext/opcache/tests/jit/gh19486.phpt @@ -0,0 +1,42 @@ +--TEST-- +GH-19486: incorrect opline after deoptimization +--INI-- +opcache.jit_blacklist_root_trace=1 +opcache.jit_blacklist_side_trace=1 +--FILE-- +getLakeArea(0, 0); + +class GameMap +{ + public $lakeID = []; + + public function getLakeArea(int $x, int $y): int + { + $this->floodFill(0, 0, 0); + } + + public function floodFill(int $x, int $y, int $id): void + { + if (($x < 0) or ($x >= 50) or ($y < 0) or ($y >= 50)) { + return; + } + if (isset($this->lakeID[$y][$x]) and ($this->lakeID[$y][$x] == $id)) { + return; + } + $this->lakeID[$y][$x] = $id; + $this->floodFill($x - 1, $y, $id); + $this->floodFill($x + 1, $y, $id); + $this->floodFill($x, $y - 1, $id); + $this->floodFill($x, $y + 1, $id); + } +} + +?> +--EXPECTF-- +Fatal error: Uncaught TypeError: GameMap::getLakeArea(): Return value must be of type int, none returned in %s:%d +Stack trace: +#0 %s(%d): GameMap->getLakeArea(0, 0) +#1 {main} + thrown in %s on line %d diff --git a/ext/standard/tests/http/http_response_header_deprecated_parameter.phpt b/ext/standard/tests/http/http_response_header_deprecated_parameter.phpt new file mode 100644 index 0000000000000..1dd032a30527e --- /dev/null +++ b/ext/standard/tests/http/http_response_header_deprecated_parameter.phpt @@ -0,0 +1,14 @@ +--TEST-- +$http_reponse_header as a parameter name should not warn +--FILE-- + +--EXPECT-- +string(2) "OK"