diff --git a/NEWS b/NEWS index b12686c5d3c..4bd0f98d345 100644 --- a/NEWS +++ b/NEWS @@ -83,6 +83,8 @@ PHP NEWS (DanielEScherzer) . Do not use RTLD_DEEPBIND if dlmopen is available. (Daniil Gentili) . Make `clone()` a function. (timwolla, edorian) + . Fixed bug GH-19081 (Wrong lineno in property error with constructor property + promotion). (ilutov) - Curl: . Added curl_multi_get_handles(). (timwolla) diff --git a/Zend/tests/ctor_promotion/ctor_promotion_callable_type.phpt b/Zend/tests/ctor_promotion/ctor_promotion_callable_type.phpt index ae10512ad54..85f36bc727b 100644 --- a/Zend/tests/ctor_promotion/ctor_promotion_callable_type.phpt +++ b/Zend/tests/ctor_promotion/ctor_promotion_callable_type.phpt @@ -4,9 +4,11 @@ Type of promoted property may not be callable --EXPECTF-- -Fatal error: Property Test::$callable cannot have type callable in %s on line %d +Fatal error: Property Test::$callable cannot have type callable in %s on line 5 diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index ef167efc697..8e03773246b 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -7698,6 +7698,8 @@ static void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32 uint32_t property_flags = param_ast->attr & (ZEND_ACC_PPP_MASK | ZEND_ACC_PPP_SET_MASK | ZEND_ACC_READONLY | ZEND_ACC_FINAL); bool is_promoted = property_flags || hooks_ast; + CG(zend_lineno) = param_ast->lineno; + znode var_node, default_node; uint8_t opcode; zend_op *opline;