Commit Graph

399 Commits

Author SHA1 Message Date
Xinchen Hui
72b0627315 Fixed bug #69521 (Segfault in gc_collect_cycles()). 2015-07-02 18:43:06 +08:00
Xinchen Hui
ab0771c60a Merge branch 'amortize-hash-compaction' of https://github.com/kaja47/php-src 2015-06-30 21:26:07 +08:00
Dmitry Stogov
7aa7627172 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 13:59:27 +03:00
Dmitry Stogov
4bd22cf1c1 Improved zend_string API (Francois Laupretre)
Squashed commit of the following:

commit d96eab8d79
Author: Francois Laupretre <francois@tekwire.net>
Date:   Fri Jun 26 01:23:31 2015 +0200

    Use the new 'ZSTR' macros in the rest of the code.

    Does not change anything to the generated code (thanks to compat macros) but cleaner.

commit b352643910
Author: Francois Laupretre <francois@tekwire.net>
Date:   Thu Jun 25 13:45:06 2015 +0200

    Improve zend_string API

    Add missing methods
2015-06-29 16:44:54 +03:00
Bob Weinand
70e86b8766 Also try __has_builtin() where builtins are used 2015-06-22 13:24:39 +02:00
Nikita Popov
23e1e1295f Clean up zend_hash_compare implementation
Split off zend_hash_compare_impl into separate function that does
not bother with recursion protection. We had two cases where
UNPROTECT_RECURSION was missing.
2015-06-20 17:35:16 +02:00
Nikita Popov
e8217a2727 Fix bug #69891 2015-06-20 17:23:58 +02:00
Nikita Popov
5bf7a3aac7 Fixed bug #69893 2015-06-20 17:14:48 +02:00
Nikita Popov
9589d26ef3 Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_hash.c
2015-06-20 16:50:37 +02:00
Nikita Popov
e09d3155a1 Merge branch 'PHP-5.5' into PHP-5.6 2015-06-20 16:40:53 +02:00
Nikita Popov
5fe078abba Fixed bug #69892 2015-06-20 16:40:14 +02:00
Dmitry Stogov
3186f913eb Fixed incorrect ZEND_FILE_LINE_CC usage 2015-06-05 13:54:10 +03:00
Xinchen Hui
0655abef1a Improve the fix for bug #69756 2015-06-05 18:42:21 +08:00
Dmitry Stogov
ed5fbf5e49 Fixed bug #69756 (Fatal error: Nesting level too deep - recursive dependency? with ===) 2015-06-05 10:04:58 +03:00
Xinchen Hui
497f9f2cda Fixed bug #69758 (Item added to array not being removed by array_pop/shift) 2015-06-05 11:54:22 +08:00
Stanislav Malyshev
60e92a3b84 set initialized flag after actual initialization happened 2015-05-31 19:37:56 -07:00
olshevskiy87
8bdec7a248 fix typos
Signed-off-by: olshevskiy87 <olshevskiy87@bk.ru>
2015-05-13 22:28:35 +04:00
Dmitry Stogov
0182eb4717 Eliminate useless checks 2015-04-27 15:54:41 +03:00
Dmitry Stogov
b250f46703 Optimized HashTable copy and cleanup function for cases without holes. 2015-04-24 22:43:50 +03:00
Dmitry Stogov
ef36d8a91e Optimized zend_hash_rehash(), added some exoectations to generate better code 2015-04-24 13:00:56 +03:00
Dmitry Stogov
6265687768 Added HashTable flag HASH_FLAG_STATIC_KEYS that is maintaned to be set if all hash table keys are numbers or interned strings.
Take this flag into account when copy or destroy HashTable to avoud useless checks for each key.
2015-04-24 09:34:50 +03:00
Dmitry Stogov
770cb1da71 Keep realpath and PCRE caches in consistency with opcache SHM. 2015-04-22 02:29:06 +03:00
Dmitry Stogov
c9da004a18 Slight zend_hash_find() optimization. 2015-04-21 23:27:44 +03:00
matason
52145ef8c6 Fix zend_hash_find documentation. 2015-04-07 22:26:16 +01:00
Dmitry Stogov
55cdde3dd6 Fixed bug #69376 (Wrong ref counting). 2015-04-07 02:35:52 +03:00
Xinchen Hui
ceb77b6472 Revert "Better to taverse reversely"
This reverts commit 51451ab84a.
2015-03-31 16:52:30 +08:00
Xinchen Hui
51451ab84a Better to taverse reversely 2015-03-30 15:26:59 +08:00
K
b3962ab940 zend_hash_do_resize: amortizing the cost of compaction
New implementation of hashtables introduced a compaction step which is
triggered when a hashtable is full but it contains at least one deleted
bucket. Therefore there is a possibility that a cleverly crafted code can
trigger this compaction step (which takes time proportional to the size of
hashtabe) by executing constatnt number of operations. When the hashtable
is full, deletion and subsequent addition or single element triggers a
table compaction and these two steps can be repeated ad infinitum. This
might be avenue for a DOS attack.

This patch allows compaction to be performed only if the hashtable contains
at least 1/32 deleted elements, otherwise the hashtable is doubled in size.
Linear amount of work caused by compaction is amortized over multiple
malicious additions and deletions.
2015-03-26 19:05:38 +01:00
Dmitry Stogov
87cec4ccc9 Fixed mess in names 2015-03-18 00:13:39 +03:00
Dmitry Stogov
55da1fb008 Fixed zend_hash_del() 2015-03-17 23:13:39 +03:00
Dmitry Stogov
db10b72523 Use fastcall calling convention for most critical ZE subsystems. 2015-03-13 21:10:09 +03:00
Dmitry Stogov
2b42d71908 Changed HashTable layout:
Removed HashTable->arHash (reduced memory consumption). Now hash slots may be accessed using HT_HASH() macro.
Hash slotas are allocated together with Buckets (before them) and lay in reverse order from HashTable->arData base address (see comments in Zend/zend_types.h)
Indexes in hash table and conflict resolution chains (Z_NEXT) may be stored as indeces or offsets in bytes, depending on system (32 or 64-bit).
HashTable data filelds are reordered to keep the most useful for zend_hash_find() data in the same CPU cache line.
2015-03-13 17:13:19 +03:00
Xinchen Hui
1ebdbdfd78 Unused var 2015-03-05 23:09:58 +08:00
Dmitry Stogov
bb91bf83f9 Minimize copying of HashTable realocation 2015-03-05 17:22:10 +03:00
Dmitry Stogov
8ec8648c91 Improved code for class property inheritance 2015-03-04 17:41:01 +03:00
Dmitry Stogov
a64e12e2a1 pefree() -> efree() 2015-03-03 09:09:28 +03:00
Dmitry Stogov
0ef5a6b409 Avoid unnecassary check 2015-02-24 19:21:21 +03:00
Dmitry Stogov
e97ae4fee8 Make zend_array_destroy() to free the corresponding zend_array 2015-02-24 18:34:37 +03:00
Dmitry Stogov
e10e151e9b Merged zend_array and HashTable into the single data structure.
Now each HashTable is also zend_array, so it's refcounted and may be a subject for Copy on Write
zend_array_dup() was changed to allocate and return HashTable, instead of taking preallocated HashTable as argument.
2015-02-13 22:20:39 +03:00
Xinchen Hui
2766dbaf6d Unused vars 2015-02-13 10:53:40 +08:00
Dmitry Stogov
12abac8bb7 Limit HashTable size to avoid integer overflow checks 2015-02-13 02:12:42 +03:00
Dmitry Stogov
97fe15db43 Fix "forech" statemt behaviour according to https://wiki.php.net/rfc/php7_foreach
Squashed commit of the following:

commit 1e41295097
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Sat Jan 31 07:28:58 2015 +0300

    Generalize HashTableIterator API to allows its usage without involvement of HashTable.nInternalPonter

commit 5406f21b11
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:43 2015 +0300

    Reduced alghorithms complexity

commit b37f1d58d2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:30 2015 +0300

    Fixed test name

commit fb2d079645
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:05 2015 +0300

    API cleanup

commit 08302c0d6d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 14:20:46 2015 +0300

    Make array_splice() to preserve foreach hash position

commit cc4b7be41e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 12:24:31 2015 +0300

    Make internal function, operation on array passed by reference, to preserve foreach hash position

commit 5aa9712b0a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 09:49:35 2015 +0300

    Implement consistent behavior for foreach by value over plain object

commit 4c5b385ff5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 07:56:37 2015 +0300

    More careful iterators update.

commit 721fc9e80d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:43:28 2015 +0300

    Added new test

commit 15a23b1218
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:05:02 2015 +0300

    Reimplement iteration magic with HashTableIterators (see https://wiki.php.net/rfc/php7_foreach#implementation_details)

commit 10a3260b1f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:04:44 2015 +0300

    New test

commit eef80c5837
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 16:52:21 2015 +0300

    Fixed foreach by reference iteration over constant array

commit 61e7391873
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 14:59:54 2015 +0300

    Fixed temporary variable re-allocation pass

commit 92e90c09f0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 12:44:57 2015 +0300

    Fixed operand destruction in case of exceptions in iterator

commit dd2a36a207
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 10:02:34 2015 +0300

    Use GET_OP1_ZVAL_PTR_DEREF() (IS_TMP_VAR and IS_CONST can't be IS_REFERENCE)

commit 4638f7b914
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 07:43:28 2015 +0300

    Change "foreach" statement behavior (this is just a PoC yet)

    - "foreach by value" don't relay on internal array/object pointer and doesnt perform array duplication. It just locks it incrementing reference counter. If the original array is modified by some code, the copy on write is performed and "foreach" still work with the old copy.

    - it makes no difference if array given to "foreach by value" is reference itself

    - "foreach by reference" still use internal array/object pointer and should work similar to PHP-5. (This id not completely implemented)
2015-02-12 13:57:12 +03:00
Xinchen Hui
7062465be0 Merge branch 'PHP-5.5' into PHP-5.6 2015-02-12 10:59:59 +08:00
Xinchen Hui
f2940b7120 Fixed bug #69017 (Fail to push to the empty array with the constant value defined in class scope) 2015-02-12 10:59:28 +08:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Xinchen Hui
73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Dmitry Stogov
34723d1b75 Fixed malloc/emalloc mess 2015-01-15 18:05:58 +03:00
Dmitry Stogov
989daeb5bb Initialize ht->nTableMask 2015-01-15 15:21:38 +03:00
Xinchen Hui
8a0bc38535 Merge branch 'zend_sort' of https://github.com/laruence/php-src 2015-01-14 22:15:41 -05:00
Anatol Belski
8e3764e287 fixed zend_hash_init() when the lzcnt instruction isn't supported 2015-01-14 12:32:23 +01:00
Xinchen Hui
2193de0d18 Faster sorting algo 2015-01-14 18:02:41 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Dmitry Stogov
37466b0368 Use special flag (HASH_FLAG_INITIALIZED) instead of (nTableMask == 0) to indicate that HashTable is allocated.
Make nTableMask to be 0 for packed arrays.
Remove checks fo HASH_FLAG_PACKED in zend_hash_find/zend_hash_del and family (string keys are resolved through uninitialized_bucket).
Change HashTable layout for better locality.
2014-12-27 11:07:12 +03:00
Nikita Popov
2d212b426a Drop duplicate arg from hash_get_current_key_ex 2014-12-26 21:06:18 +01:00
Nikita Popov
3d12fc796b Small cleanups in hash implementation
* Drop unnecessary checks in non-inlined part of numeric key
   detection
 * Drop zend_hash_apply_deleter in favor of zend_hash_del_el.
   Also move block/unblock interruption macros in there.
2014-12-26 21:06:18 +01:00
K.
c462ff7ac2 zend_hash_do_resize: fix compacting condition
nNumUsed should always be greater or equal to nNumOfElements so original condition is never true and arrays are always doubled in size and compaction is never triggered
2014-12-23 15:32:15 +01:00
Anatol Belski
e60b7207db cleanup 2014-12-23 13:00:29 +01:00
Dmitry Stogov
441270db2c Simplify condition 2014-12-19 13:06:34 +03:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Dmitry Stogov
3727e26456 Improved zend_hash_clean() and added new optimized zend_symtable_clean() 2014-11-25 14:17:21 +03:00
Dmitry Stogov
ab7b38e336 Added new optimized zend_array_destroy() function 2014-11-25 12:58:29 +03:00
Anatol Belski
6b3b4fc944 joined identical conditional blocks 2014-11-18 13:19:46 +01:00
Anatol Belski
b9f1daa976 basic clang compatibility on windows 2014-11-07 10:17:59 +01:00
Dmitry Stogov
4f3763e202 Micro optimizations 2014-11-06 17:45:41 +03:00
Anatol Belski
e70dce7d99 fix datatype mismatch 2014-10-23 10:29:57 +02:00
Anatol Belski
53797ec1c9 move the more common case up 2014-10-23 10:29:56 +02:00
Dmitry Stogov
8793aa407e Optimized HashTable size calculation 2014-10-23 00:26:32 +04:00
Anatol Belski
d5ccf4d276 eliminate one branch when computing the initial table size 2014-10-22 19:23:29 +02:00
Anatol Belski
f59daf2104 micro optimized initial hash size calculation
most of the calls are with a size <= 8, so don't even bother any
bitshifts. For the bigger sizes, use an intrinsic (should be extended
with gcc ones though).
2014-10-22 17:56:24 +02:00
Dmitry Stogov
2a1250fa57 Micro optimization for zend_hash_next_index_insert_new() 2014-10-16 19:19:10 +04:00
Dmitry Stogov
bccc653185 Avoid double IS_INTERNED() check 2014-09-19 17:32:50 +04:00
Dmitry Stogov
1e0e1b4a73 Split big _zend_handle_numeric_str() into small always inlined function that makes initial check and regular big function 2014-09-18 18:50:05 +04:00
Dmitry Stogov
c2decc6afc optimized colision list traverse 2014-09-17 00:52:03 +04:00
Nikita Popov
311a67a2ed Remove HASH_NEXT_INSERT flag
We already pass ht->nNextFreeElement and the rest is handled by
ZEND_HASH_ADD.
2014-09-16 18:29:00 +02:00
Nikita Popov
0bf55b65d4 Remove two more always-true conditions 2014-09-16 18:28:59 +02:00
Dmitry Stogov
6991780793 Optimized FE_RESET and FE_FETCH 2014-09-16 01:34:27 +04:00
Nikita Popov
a7bfd006bd Remove always-true comparisons 2014-09-15 23:07:31 +02:00
Nikita Popov
ca43b99fc6 Update types in zend_hash
* String lengths are size_t
 * Indexes are uint32_t
 * Flags are uint32_t
 * Booleans are zend_bool
2014-09-15 23:07:31 +02:00
Dmitry Stogov
219794e1cd Split and optimize loop 2014-08-27 00:52:50 +04:00
Anatol Belski
4d997f63d9 master renames phase 3 2014-08-25 20:22:49 +02:00
Anatol Belski
6f9f0bf205 master renames phase 2 2014-08-25 19:28:33 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
864172d9a4 further fixes to ext/standard and zend 2014-08-16 17:31:40 +02:00
Anatol Belski
8ee2a4a9b5 first shot on merging the core fro the int64 branch 2014-08-16 11:16:11 +02:00
Dmitry Stogov
2ece977c80 Fixed conversion of empty packed array into hash 2014-08-14 13:44:37 +04:00
Dmitry Stogov
c1965f58d4 Use reference counting instead of zval duplication 2014-06-05 16:04:11 +04:00
Dmitry Stogov
b3b616cf7e Introduced immutable arrays. They don't need to be copyed and may be used directly from SHM. 2014-05-29 18:21:56 +04:00
Dmitry Stogov
40256e0f9c Use specialized functions instead of macros 2014-05-26 17:16:16 +04:00
Dmitry Stogov
b66728aabb Removed useless initializations 2014-05-26 11:42:58 +04:00
Dmitry Stogov
9eb89dddb1 Use optimized zend_array_dup() function. convert zend_hash_num_elements() and zend_hash_next_free_element() into macros. 2014-05-23 20:37:53 +04:00
Dmitry Stogov
21da8af578 Removed the old hack that was originally developed to support constants in array indeces, and isn't needed anymore after the Bob's patch. 2014-05-19 01:20:56 +04:00
Dmitry Stogov
d07c1941ec Use new hash iteration API and avoid old zend_hash_update_current_key() hack 2014-05-19 00:50:00 +04:00
Tjerk Meesters
e7b50a8ee9 Convert to unpacked before deleting elements
Return FAILURE immediately if a string index removal is attempted.

Moved condition higher up
2014-05-13 11:58:28 +08:00
Nikita Popov
b30c7fe263 Port JSON 2014-05-05 01:00:59 +02:00
Nikita Popov
69b5ee61d0 Fixed bug #67169: []= after_array_splice incorrect
This fixes a regression I introduced in beta 1.
2014-05-02 12:49:51 +02:00
Dmitry Stogov
b1ff152782 Reimplement strtr() 2014-04-24 19:14:29 +04:00
Nikita Popov
c98d373eb6 Fix strict array comparison
Fixes Symfony test failures
2014-04-23 20:34:45 +02:00
Dmitry Stogov
72c287bd23 Combine HashTable.flags and HashTable.nApplyCount into single 32-bit word 2014-04-21 18:25:34 +04:00
Dmitry Stogov
050d7e38ad Cleanup (1-st round) 2014-04-15 15:40:40 +04:00
Nikita Popov
ad2ef3d97e Add only_integer_keys option to zend_hash_reindex
This allows to either do a full reindex, or only reindex the integer
keys.
2014-04-09 12:31:21 +02:00
Nikita Popov
22d3eb3117 Add zend_hash_splice
This implements the original functionality of php_splice, but
as an in-place operation, thus avoiding copying the HT.

This is much faster (~10x) if the splice removes a small portion
of the array and doesn't insert many elements.
2014-04-09 12:31:21 +02:00
Nikita Popov
1aa8719e32 Add zend_hash_reindex
The implementation differs from the original in array.c in that it
rehashes the hashtable in the same loop. This is approximately two
times faster (not counting the rare case of a purely associative
array).
2014-04-09 12:31:21 +02:00
Dmitry Stogov
3d17219cd8 Refactored zend_hash_* iteration API zend_hash_fove_forward_ex(ht, pos) and family require second argument to be real pointer.
&(ht)->nInternalPointer should be passed instead of NULL.
zend_hash_update_current_key() may work only with internal pointer.
2014-04-07 23:14:17 +04:00
Dmitry Stogov
3167b49ce9 Allocate HashTable->arData and HashTable->arHash at once 2014-04-07 18:22:03 +04:00
Dmitry Stogov
3485b11499 "incremental" hash bucket initialization 2014-04-07 13:31:44 +04:00
Dmitry Stogov
76cc99fe60 Refactored ZVAL flags usage to simplify various checks (e.g. Z_REFCOUNTED(), candidate for GC, etc) 2014-04-03 15:26:23 +04:00
Dmitry Stogov
d8099d0468 Changed data layout to allow more efficient operations 2014-04-02 14:34:44 +04:00
Dmitry Stogov
60961bba3d Avoid useless memset() 2014-04-01 23:56:45 +04:00
Dmitry Stogov
042c937f69 Use STR_COPY() instead of STR_DUP() where possible 2014-04-01 17:10:15 +04:00
Dmitry Stogov
887189ca31 Refactored IS_INDIRECT usage for CV and object properties to support HashTable resizing 2014-03-26 18:07:31 +04:00
Anatol Belski
9d4001f1c8 fix C89 compat 2014-03-22 10:44:01 +01:00
Nikita Popov
f331ed1414 Revert "Add helper function for updating bucket contents"
Reverting this for now, because it would require further changes
thanks to the zend signals tsrms-but-only-sometimes awesomeness.
2014-03-21 01:32:49 +01:00
Nikita Popov
4e7e301dda Rename+move zend_hash_apply_deleter and reuse it
The interruption handling was normalized to wrap the entire deletion
operation (instead of leaving out the destructor call and/or the
deallocation) per the recommendation of somebody (don't remember who)
familiar with zend signals.

There is an always-inlined variant of the function for use in
the main deletion function, to ensure there is no performance
impact.
2014-03-21 00:14:52 +01:00
Nikita Popov
4efa58dd59 Make zend_hash_apply_deleter() void, to allow reuse
Also remove lies in the comment above the function. apply_deleter
is not safe against modification, if the modification involves
removing the next bucket.

Also modified the implementation of zend_hash_graceful_destroy()
to be fully graceful (the reverse variant already was).
2014-03-21 00:14:51 +01:00
Nikita Popov
c3a317117a Add helper function for updating bucket contents 2014-03-21 00:14:46 +01:00
Nikita Popov
994fcfcff9 Remove unnecessary check
In case of an update the key already existed, so the next free
element can not change.
2014-03-20 22:58:10 +01:00
Dmitry Stogov
62c448ab8b Fixed serialize/unserialize problems 2014-03-17 17:23:27 +04:00
Dmitry Stogov
51494f252f Don't include trailing zero into hash caclculation 2014-03-14 15:35:57 +04:00
Dmitry Stogov
3e4c22b499 Fixed possible HashTable modification in its destructor 2014-03-06 16:53:13 +04:00
Dmitry Stogov
e0f6bae56b Passing symbol_table into user error handlers 2014-03-04 14:17:17 +04:00
Xinchen Hui
a52659bc25 zend_hash_del didn't check the PACKED flag 2014-02-19 19:27:42 +08:00
Dmitry Stogov
5de7115679 Use better data structures (incomplete; able to run bench.php) 2014-02-18 16:27:38 +04:00
Dmitry Stogov
be82a07776 Use better data structures (incomplete) 2014-02-12 18:08:11 +04:00
Dmitry Stogov
f4cfaf36e2 Use better data structures (incomplete) 2014-02-10 10:04:30 +04:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Xinchen Hui
47c9027772 Bump year 2014-01-03 11:06:16 +08:00
Dmitry Stogov
6c2a806820 Avoid interned hash key duplication and hash key length recaclulation 2013-11-29 00:57:49 +04:00
Dmitry Stogov
5d25762646 Removed unused "pHashFunction" argument in _zend_hash_init() and family (must be 99% source compatible) 2013-11-28 18:40:46 +04:00
Dmitry Stogov
b63b81815f Some rare deprecated cases replaced by ZEND_ASSERT() (some extensions might need to be fixed) 2013-11-28 17:02:01 +04:00
Dmitry Stogov
aa427a10d4 Removed duplicated hash function implementation (100% source compatible) 2013-11-28 17:01:10 +04:00
Stanislav Malyshev
02457554a3 Merge branch 'PHP-5.5'
* PHP-5.5:
  backward compatibility
  HASH_KEY_NON_EXISTANT fix
2013-07-21 20:10:31 -07:00
Veres Lajos
4749457a49 HASH_KEY_NON_EXISTANT fix 2013-07-21 20:09:53 -07:00
Nikita Popov
42729c1baf Merge branch 'PHP-5.5' 2013-06-17 23:49:08 +02:00
Nikita Popov
86434be946 Fix bug #65051: count() off by one inside unset()
nNumOfElements was incremented after the pDestructor code, so any
code in the dtor would get a wrong number of elements.

Right now the bucket deletion code is replicated in four places,
it should probably be moved off into one function (or rather,
zend_hash_apply_deleter should be used everywhere). The codes are
subtly different though in that the HANDLE_UNBLOCK_INTERRUPTIONS()
happens in different places. In particular it seems odd that in
some cases interruptions stay blocked during the destructor call.
2013-06-17 23:44:13 +02:00
Nikita Popov
ae91084067 Remove unnecessary NULL checks from zend_hash
Our memory allocation functions (including the persistent ones)
are infallible, so no need to check for NULL.
2013-06-17 18:51:59 +02:00
Nikita Popov
1f34ccbe34 Fix bug #64555: foreach no longer copies keys if they are interned 2013-04-03 20:29:19 +02:00
Nikita Popov
fcc6611de9 Add support for non-scalar Iterator keys in foreach
RFC: https://wiki.php.net/rfc/foreach-non-scalar-keys
2013-03-12 17:27:31 +01:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Felipe Pena
8775a37559 - Year++ 2012-01-01 13:15:04 +00:00
Dmitry Stogov
dc18f8427c Fixed icorrect key length after updating constant index 2011-12-01 13:58:29 +00:00
Dmitry Stogov
e43ff1359e Fixed ZE specific compile warnings (Bug #55629) 2011-09-13 13:29:35 +00:00
Pierre Joye
710d46f38e - WS 2011-09-06 06:34:36 +00:00
Pierrick Charron
7f203d4385 Fix typo 2011-08-08 11:30:56 +00:00
Rasmus Lerdorf
1ac9192d46 Fix missing va_end() found by Coverity 2011-08-05 22:18:42 +00:00
Dmitry Stogov
8ff0701e8d Fixed bug #50816 (Using class constants in array definition fails). 2011-08-01 11:21:23 +00:00
Felipe Pena
5ca0f69921 - Fix ZTS build 2011-06-02 22:54:14 +00:00
Ilia Alshanetsky
939875133a Zend Signal Handling (see RFC: https://wiki.php.net/rfc/zendsignals)
This needs to go into 5.4 as well, but will wait for Pierre to review win32 situation

# Patch by Lucas Nealan, Arnaud Le Blanc, Brian Shire & Ilia Alshanetsky
2011-06-02 21:16:50 +00:00
Dmitry Stogov
50ce16deff Fixed bug #54268 (Double free when destroy_zend_class fails) 2011-04-15 12:43:20 +00:00
Dmitry Stogov
8fe3ea75cb Changed initialization order to workaround against crashes after memory overflow 2011-04-15 09:59:42 +00:00