php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch fix-anonymous-class-union-typehints for Scripting Engine problem Bug #80596

Patch version 2021-01-13 09:46 UTC

Return to Bug #80596 | Download this patch
Patch Revisions:

Developer: daniil@daniil.it

From f6aaae513c6fce8abf5daf0553e52b483ee5d720 Mon Sep 17 00:00:00 2001
From: Daniil Gentili <daniil@daniil.it>
Date: Wed, 13 Jan 2021 10:43:54 +0100
Subject: [PATCH] Fix anonymous class union typehints

---
 Zend/zend_compile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 83942be570..2ffcf8c202 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1154,7 +1154,7 @@ static zend_string *add_type_string(zend_string *type, zend_string *new_type) {
 	}
 
 	result = zend_string_concat3(
-		ZSTR_VAL(type), ZSTR_LEN(type), "|", 1, ZSTR_VAL(new_type), ZSTR_LEN(new_type));
+		ZSTR_VAL(type), strlen(ZSTR_VAL(type)), "|", 1, ZSTR_VAL(new_type), strlen(ZSTR_VAL(new_type)));
 	zend_string_release(type);
 	return result;
 }
-- 
2.30.0

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 04:01:28 2024 UTC