From ff8f864a3d1f51b498b927e85c8fc94b1c135f47 Mon Sep 17 00:00:00 2001 From: Alliballibaba Date: Tue, 23 Dec 2025 22:48:12 +0100 Subject: [PATCH] Removes special empty array. --- internal/extgen/integration_test.go | 2 +- types.go | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/extgen/integration_test.go b/internal/extgen/integration_test.go index 59783578..45fe9ed5 100644 --- a/internal/extgen/integration_test.go +++ b/internal/extgen/integration_test.go @@ -752,7 +752,7 @@ if ($result !== ['HELLO', 'WORLD']) { exit(1); } -echo "Testing my_array_map with trim function\n"; +echo "Testing my_array_map with empty array\n"; $result = my_array_map([], function($x) { return $x; }); if ($result !== []) { echo "FAIL: my_array_map with empty array expected [], got " . json_encode($result); diff --git a/types.go b/types.go index f1256dea..12569fd9 100644 --- a/types.go +++ b/types.go @@ -468,10 +468,6 @@ func phpValue(zval *C.zval, value any) { // createNewArray creates a new zend_array with the specified size. func createNewArray(size int) *C.zend_array { - if size == 0 { - // use the global empty array instance - return (*C.zend_array)(&C.zend_empty_array) - } return C.__zend_new_array__(C.uint32_t(size)) }