[php-src] master: Merge branch 'PHP-8.6'

From: Date: Fri, 25 Sep 2026 15:02:51 +0000
Subject: [php-src] master: Merge branch 'PHP-8.6'
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-141563@lists.php.net to get a copy of this message
Author: Ilija Tovilo (iluuu1994) Date: 2026-09-25T17:02:40+02:00 Commit: https://github.com/php/php-src/commit/4bcb615126f60d31911e74b5b9b1335364888602 Raw diff: https://github.com/php/php-src/commit/4bcb615126f60d31911e74b5b9b1335364888602.diff Merge branch 'PHP-8.6' * PHP-8.6: Skip result type inference verification for simple get Changed paths: A Zend/tests/property_hooks/simple_get_result_type_inference_verification.phpt M Zend/zend_verify_type_inference.h Diff: diff --git a/Zend/tests/property_hooks/simple_get_result_type_inference_verification.phpt b/Zend/tests/property_hooks/simple_get_result_type_inference_verification.phpt new file mode 100644 index 000000000000..214a568e297d --- /dev/null +++ b/Zend/tests/property_hooks/simple_get_result_type_inference_verification.phpt @@ -0,0 +1,25 @@ +--TEST-- +Result type inference verification for simple get is skipped +--FILE-- +<?php + +class Foo { + private array $backing = []; + + public array $prop { + get => $this->backing; + } + + public function test(): void { + $prop = $this->prop; + } +} + +$foo = new Foo; +$foo->test(); +$foo->test(); +echo "Done\n"; + +?> +--EXPECT-- +Done diff --git a/Zend/zend_verify_type_inference.h b/Zend/zend_verify_type_inference.h index 807bf21e3910..cc4461b79b79 100644 --- a/Zend/zend_verify_type_inference.h +++ b/Zend/zend_verify_type_inference.h @@ -186,7 +186,8 @@ static void zend_verify_inference_def(zend_execute_data *execute_data, const zen && opline->opcode != ZEND_DO_FCALL_BY_NAME /* ZEND_FE_FETCH_R[W] does not define a result in the last iteration. */ && opline->opcode != ZEND_FE_FETCH_R - && opline->opcode != ZEND_FE_FETCH_RW) { + && opline->opcode != ZEND_FE_FETCH_RW + && (opline->opcode != ZEND_FETCH_OBJ_R || EG(current_execute_data) == execute_data)) { zend_verify_type_inference(EX_VAR(opline->result.var), opline->result_def_type, opline->result_type, execute_data, opline, "result_def"); /* Verify return value in the context of caller. */

« previous php.cvs (#141563) next »