We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5a800b commit 2839bf8Copy full SHA for 2839bf8
ext-src/swoole_thread.cc
@@ -777,12 +777,19 @@ void ZendArray::index_offsetUnset(zend_long index) {
777
zend_long i = index;
778
zend_long n = zend_hash_num_elements(&ht);
779
HT_FLAGS(&ht) |= HASH_FLAG_PACKED | HASH_FLAG_STATIC_KEYS;
780
- while (i < n) {
+ ArrayItem *item = (ArrayItem *) zend_hash_index_find_ptr(&ht, index);
781
+ delete item;
782
+ while (i < n - 1) {
783
+#if PHP_VERSION_ID >= 80200
784
+ Z_PTR(ht.arPacked[i]) = Z_PTR(ht.arPacked[i + 1]);
785
+#else
786
Z_PTR(ht.arData[i].val) = Z_PTR(ht.arData[i + 1].val);
787
+#endif
788
i++;
789
}
790
ht.nNumUsed--;
791
ht.nNumOfElements--;
792
+ ht.nNextFreeElement--;
793
lock_.unlock();
794
795
0 commit comments