Commit Graph

514 Commits

Author SHA1 Message Date
Arnaud Le Blanc
2dd8d6ff94 MFH: Fixed bug #46873 (extract($foo) crashes if $foo['foo'] exists) 2008-12-27 03:06:57 +00:00
Andrei Zmievski
dddbfccb9f MFH 2008-12-12 19:20:49 +00:00
Arnaud Le Blanc
6a6289a90d MFH: Fixed bugs #44181 & #44182 (extract() and references)
(robin_fernandes at uk dot ibm dot com)
2008-11-26 00:59:41 +00:00
Stanislav Malyshev
45572a498a restore BC for arrays
[DOC] natsort, natcasesort, usort, uasort, uksort, array_flip, array_unique
still won't work with objects
2008-11-24 18:12:17 +00:00
Arnaud Le Blanc
d69dfa4b9f MFH: initialize optional vars 2008-10-21 22:08:38 +00:00
Nuno Lopes
8a77e55566 clean some dead code (with static analysis help) 2008-09-23 15:18:26 +00:00
Felipe Pena
42feeddd40 MFH:
- Removed the undocumented object support in the leftover array functions [DOC]
  (natcasesort, natsort, array_walk, array_walk_recursive, array_unique, array_key_exists)
- Changed HASH_OF() to Z_ARRVAL_P()
- Fixed bug #45937 (array_walk and array_walk_recursive can alter private/protected object variable)
2008-08-29 03:05:43 +00:00
Lars Strojny
080157870f MFH: Allow mixed $initial (patch by Christian Seiler) 2008-08-20 20:35:40 +00:00
Felipe Pena
252d7d76a8 - MFH: New parameter parsing API 2008-08-17 22:14:14 +00:00
Felipe Pena
f2fc267e3a - MFH: New parameter parsing API (for min() and max()) 2008-08-10 17:50:44 +00:00
Felipe Pena
e304515ddb - MFH: Added parameter TSRMLS_DC in zend_is_callable() 2008-08-02 04:46:07 +00:00
Johannes Schlüter
b9f7b21ec1 MFH (DOC] Add array_replace/array_replace_recursive (Mett Wilmas) 2008-07-31 20:18:17 +00:00
Felipe Pena
a1ce847cd5 - MFH: Improved parameter handling 2008-07-24 03:07:22 +00:00
Felipe Pena
a2cc7ec96a - MFH: Fixed bug #45605 (array_uintersect_assoc gives incorrect error message) 2008-07-23 16:28:46 +00:00
Etienne Kneuss
8ceb0b6fd3 MFH: Fix resolution rule of count vs. handler 2008-07-09 21:29:52 +00:00
Matt Wilmas
572adc05e4 MFH: Initialize with length instead of 0 2008-06-02 11:20:59 +00:00
Antony Dovgal
779769563c fix uninitialized variable 2008-06-02 10:27:55 +00:00
Matt Wilmas
c1126cc5b6 MFH: Only check args once in php_array_diff_key/intersect_key, not on each iteration. This also makes sure ALL args are checked (pre-5.2.5 behavior)
- Also, use new hash_quick_del function where possible
2008-05-30 10:55:14 +00:00
Matt Wilmas
7da75d81e7 MFH: Add array_init_size() and use it where array size is known at initialization 2008-05-27 10:29:33 +00:00
Felipe Pena
d90f689d73 - Making compatible with 64bit plataform 2008-05-18 15:42:09 +00:00
Antony Dovgal
7633511047 fix compile warnings 2008-05-04 11:26:50 +00:00
Dmitry Stogov
2ecf4bb0a7 Lazy EG(active_symbol_table) initialization 2008-04-29 08:15:20 +00:00
Felipe Pena
eea093b47c MFB: Fixed bug #42177 (Warning "array_merge_recursive(): recursion detected" comes again...) 2008-03-12 19:18:42 +00:00
Felipe Pena
f7078d469c Fixed Bug #44212 (array_diff_assoc not reporting missing arguments) 2008-02-22 13:28:40 +00:00
Antony Dovgal
0970b9f5e9 MFH: recursion protection in count() 2008-02-15 09:33:09 +00:00
Felipe Pena
aefe056911 MFB: Fixed Bug #42838 (Wrong results in array_diff_uassoc) 2008-02-14 14:08:22 +00:00
Dmitry Stogov
4de1e20fbb Fixed memory leak 2008-02-14 08:46:25 +00:00
Felipe Pena
ea3a6ed11f array_slice() - Fixed behavior when NULL is given in third parameter (BC) 2008-02-12 01:31:12 +00:00
Antony Dovgal
038696fed1 MFH 2008-02-11 13:34:41 +00:00
Ilia Alshanetsky
6e9ef8e316 Fixed bug #44046 (crash inside array_slice() function with an invalid
by-ref offset).
2008-02-05 15:58:27 +00:00
Dmitry Stogov
382f1dddfa Fixed bug #43505 (Assign by reference bug) 2008-01-29 10:45:07 +00:00
Antony Dovgal
183ed5b686 MFH: fix #43596 (array_slice(): $length arg ignored when it is 0) 2008-01-29 00:39:46 +00:00
Rob Richards
90f168deae MFH: fix zts build 2008-01-25 15:52:48 +00:00
Antony Dovgal
2907ae9d73 MFH: endless loop (and stack overflow) protection in compact() 2008-01-25 13:42:36 +00:00
Antony Dovgal
67c8d8d95e MFH: fix #43559 (array_merge_recursive() doesn't behave as expected with duplicate NULL values)
patch by Felipe
2008-01-23 12:09:52 +00:00
Brian Shire
82874e094b MFH: Fix bug #42850 array_walk_recursive() leaves references, refix bug #34982 2008-01-14 22:09:52 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Jani Taskinen
9a4de086cb MFH: - Fixed bug #43541 2007-12-11 09:47:21 +00:00
Ilia Alshanetsky
98bfa2ac74 Fixed bug #43495 (array_merge_recursive() crashes with recursive arrays) 2007-12-05 19:55:31 +00:00
Ilia Alshanetsky
7192e8af15 MFB: Fixed bug #43482 (array_pad() does not warn on very small pad
numbers).
2007-12-03 14:13:27 +00:00
Ilia Alshanetsky
7cf9dcc81c Fixed bug #43386 (array_globals not reset to 0 properly on init) 2007-11-25 15:56:07 +00:00
Jani Taskinen
7f0ad5c1e9 MFH: - Fixed bug #43196 (array_intersect_assoc() crashes with non-array input) 2007-11-06 13:26:59 +00:00
Ilia Alshanetsky
35ab31e7ad Fixed bug #43197 (array_intersect_assoc() does not emit warning messages for
error inputs)
2007-11-05 23:53:23 +00:00
Jani Taskinen
b489251177 - MFH from HEAD:
. Folding tags
  . Parameter parsing
  . SPL debug info
  . array function improvements (not all yet)
  . Improvements to function calling with call_user_* functions
  . Improvements to debugging info in var_dump/print_r
# I propably forgot already something but this all was pretty close tied
# to each other so it wasn't possible to do it in parts.
2007-11-02 19:40:39 +00:00
Jani Taskinen
2d8dc07e3e MFH: fix typo 2007-10-31 13:39:26 +00:00
Scott MacVicar
3fa7ec8508 Fixed bug #43020 (Warning message is missing with shuffle() and more than one argument) 2007-10-18 14:33:14 +00:00
Yiduo (David) Wang
4b4d634cb9 MFH: Added macros for managing zval refcounts and is_ref statuses 2007-10-07 05:22:07 +00:00
Antony Dovgal
1297fa1b8f MF5_2: improved recursion detection in array_walk()
fixes #42752, though the leaks are still there
2007-10-02 10:04:38 +00:00
Jani Taskinen
27e8fa0d31 MFH: sync (adds php_prefix_varname() API function) 2007-10-01 12:34:19 +00:00
Ilia Alshanetsky
24c806c41b Fixed memory leak inside array_intersec (coverity issues #403,#404) 2007-09-22 15:38:00 +00:00
Ilia Alshanetsky
91e8740fe4 Fixed memory leak inside array_diff() (coverity issues #401,#402) 2007-09-22 15:32:11 +00:00
Antony Dovgal
43cc8937b2 MFH: plug leak on error (coverity issue #405) 2007-09-21 13:51:49 +00:00
Dmitry Stogov
9ee4848c3f Improved speed of array_diff_key(), array_diff_assoc() and array_udiff_assoc(). 2007-09-21 13:10:59 +00:00
Dmitry Stogov
8d377a698a Improved speed of array_intersect_key(), array_intersect_assoc() and array_uintersect_assoc(). (100 times faster on arrays with 100000 elements) 2007-09-20 09:22:59 +00:00
Jani Taskinen
c4be8ab831 - Fix the fix for bug #42233 2007-08-10 12:17:26 +00:00
Jani Taskinen
0d5dd8829b - Fixed bug #42233 (Problems with æøå in extract()). 2007-08-08 07:41:09 +00:00
Ilia Alshanetsky
67a2cca930 Fixed bug #41685 (array_push() fails to warn when next index is already
occupied).
2007-06-24 17:37:01 +00:00
Ilia Alshanetsky
24bdf0e368 Fixed bug #41686 (Omitting length param in array_slice not possible). 2007-06-18 16:53:09 +00:00
Antony Dovgal
03b0a479dd fix folding 2007-06-05 12:12:55 +00:00
Ilia Alshanetsky
c34806e145 Fixed bug #41121 (range() overflow handling for large numbers on 32bit
machines).
2007-04-19 23:21:22 +00:00
Wez Furlong
16fc958508 fixes #40848 2007-03-18 20:20:23 +00:00
Stanislav Malyshev
90eff54400 Fix UMR in array_user_key_compare() (MOPB24 by Stefan Esser) 2007-03-16 19:38:58 +00:00
Ilia Alshanetsky
1ac71c4fe9 Fixed bug #40709 (array_reduce() behaves strange with one item stored
arrays).
2007-03-04 17:21:16 +00:00
Antony Dovgal
2c36778e47 MFH: fix #40191 (use of array_unique() with objects triggers segfault) 2007-01-22 08:17:26 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Brian Shire
5bf3df531f Fixed bug #30074
extract with EXTR_REFS was setting EG(unitialized_zval_ptr)->is_ref=1, affecting subsequent usage
  Added test
2006-12-17 20:09:48 +00:00
Ilia Alshanetsky
e64cb1ae4d Optimize extract()
# Patch by Brian Shire
2006-12-10 19:43:03 +00:00
Antony Dovgal
df1a1c8441 MFH: fix #39576 (array_walk() doesn't separate userdata zval) 2006-11-22 10:42:41 +00:00
Antony Dovgal
eca1911b72 fix leak, add test 2006-11-15 22:10:19 +00:00
Ilia Alshanetsky
d4a64fba74 removed bogus char 2006-11-12 17:23:01 +00:00
Ilia Alshanetsky
e0d385a328 Optimized array functions utilizing php_splice(). 2006-11-12 17:13:22 +00:00
Hannes Magnusson
7b81e554ae MFH: Fixed bug#36975 (natcasesort() causes array_pop() to misbehave) 2006-11-12 01:14:39 +00:00
Ilia Alshanetsky
8581c7328f optimize zend_hash_init() with known hash table sizes. 2006-10-03 17:41:47 +00:00
Hannes Magnusson
59fabbb464 MFH: compact() doesnt throw "wrong param count" 2006-10-03 16:37:51 +00:00
Antony Dovgal
e1ff6fe881 support objects in array_walk*() 2006-09-19 09:35:27 +00:00
Antony Dovgal
dba1f1d42f MFH: fix #34066 (recursive array_walk causes segfault)
add tests
2006-09-19 09:04:16 +00:00
Ilia Alshanetsky
8e86a189ec Fixed bug #38464 (array_count_values() mishandles numeric strings). 2006-09-06 17:25:57 +00:00
Andrei Zmievski
3d7a1c3972 Make array_merge(_recursive) handle binary keys safely. (Patch by Matt W) 2006-07-30 03:31:18 +00:00
Andrei Zmievski
8474838a9a +1 for keys 2006-07-24 18:18:33 +00:00
Andrei Zmievski
bb430b3737 Gah. 2006-07-22 16:58:39 +00:00
Andrei Zmievski
d827c76379 Matt should be happy now. 2006-07-22 16:58:06 +00:00
Andrei Zmievski
1223119155 MFH 2006-07-21 23:54:19 +00:00
Marcus Boerger
31a8d6a6b3 - MFH array_fill_keys, better unicode support, use new param parsing API 2006-07-15 12:14:07 +00:00
Marcus Boerger
87c64280b0 - MFH Added array_fill_keys(). (Marcus, Mathew W) 2006-07-15 10:21:10 +00:00
Hannes Magnusson
ec420c3df8 Updated protos & vim folding 2006-06-26 18:48:56 +00:00
Andrei Zmievski
5735927d86 I swear it wasn't me. 2006-06-03 18:56:44 +00:00
Johannes Schlüter
9047558fe3 - MFH: Fix bug #37060 (Type of retval of Countable::count() is not checked) 2006-04-12 19:30:52 +00:00
Antony Dovgal
f7ce1d6260 prevent segfault when exception is thrown from Countable::count() 2006-03-22 22:05:51 +00:00
Antony Dovgal
90d7fbe798 MFH: make the code cleaner 2006-03-19 22:11:36 +00:00
Marcus Boerger
5a69b29082 - Warning fixes by Steph 2006-02-26 10:57:00 +00:00
Andrei Zmievski
7deff63e3c Move array globals declarations back to the header file. 2006-02-07 17:54:24 +00:00
foobar
5bd93221a8 bump year and license version 2006-01-01 12:51:34 +00:00
Antony Dovgal
b5aeda4e65 tweak the fix 2005-12-27 23:26:55 +00:00
Antony Dovgal
f046cdf3fa fix #35821 (array_map() segfaults when exception is throwed from the callback) 2005-12-27 22:32:01 +00:00
foobar
d0a54af4c5 MFH: Nuke php3 legacy 2005-12-05 22:54:01 +00:00
Ilia Alshanetsky
941a94ead4 Simplify code. 2005-10-30 13:48:30 +00:00
Ilia Alshanetsky
d22d6910ad Fixed Bug #35014 (array_product() always returns 0). 2005-10-30 13:44:26 +00:00
Dmitry Stogov
fa406902d5 Fixed bug #34982 (array_walk_recursive() modifies elements outside function scope) 2005-10-28 09:57:35 +00:00
Dmitry Stogov
f9fb94ff00 Reverted patch for bug #34934. Bug is marked as bogus. 2005-10-24 06:58:42 +00:00
Antony Dovgal
23d3ddea25 fix ws 2005-10-21 15:53:22 +00:00
Dmitry Stogov
75a548a7e9 Fixed bug #34934 (offsetExists is not called from array_key_exists) 2005-10-21 15:19:40 +00:00
Antony Dovgal
1b8ecbcf54 MFH: fix #34723 (array_count_values() strips leading zeroes) 2005-10-04 20:48:17 +00:00
Ilia Alshanetsky
8a5bd01a44 MFH: GLOBALS protection for extract() function. 2005-10-03 14:04:16 +00:00
Dmitry Stogov
9a74c68a4c Additinal fix for bug #34277 (array_filter() crashes with references and objects) 2005-09-12 09:58:50 +00:00
Dmitry Stogov
e615889d6b Fixed bug #34277 (array_filter() crashes with references and objects) 2005-09-01 12:00:37 +00:00
Dmitry Stogov
54931f5259 Fixed bug #33940 (array_map() fails to pass by reference when called recursively) 2005-08-10 08:22:01 +00:00
Dmitry Stogov
96d755978c Fixed bug #29253 (array_diff with $GLOBALS argument fails) 2005-08-10 07:43:07 +00:00
Dmitry Stogov
98e70ab585 Fixed bug #33989 (extract($GLOBALS,EXTR_REFS) crashes PHP) 2005-08-04 10:34:39 +00:00
foobar
23e671a51e - Bumber up year 2005-08-03 14:08:58 +00:00
Dmitry Stogov
1d33a3e95e Fixed bug #31158 (array_splice on $GLOBALS crashes) 2005-07-04 10:01:10 +00:00
foobar
340bcffdf0 - Unify (+ spl can't be build shared so COMPILE_DL_SPL 2005-06-30 11:15:00 +00:00
Dmitry Stogov
27374bfaf5 Fixed bug #31213 (Sideeffects caused by fix of bug #29493) 2005-06-21 12:10:51 +00:00
Wez Furlong
4de4565710 Fix compile on win32 at least. 2005-06-16 15:03:36 +00:00
Andrei Zmievski
be0458269e WS fix 2005-06-15 21:20:26 +00:00
Andrei Zmievski
ec09711101 Fix FCI cache for array_walk and user array compare functions. Bug
#33286. (Patch from m.bretz@metropolis-ag.de)
2005-06-15 20:51:33 +00:00
Dmitry Stogov
72c6d5cbaf Fixed memory allocation bugs in array_reduce() with initial value (#22463 & #24980) 2005-06-08 19:54:24 +00:00
Andrey Hristov
be3a9ccdf3 add function array_product() 2005-05-11 11:43:11 +00:00
Dmitry Stogov
c78ec1615a Fixed call to estrndup() with invalid length 2005-04-25 06:13:57 +00:00
Antony Dovgal
a13b29add7 fix #30833 (array_count_values modifying input array) 2005-04-12 14:00:54 +00:00
Ilia Alshanetsky
b30d8beebf Simplify argument checking code for array_combine(). 2005-03-22 01:45:17 +00:00
Marcus Boerger
e38141478a - Check another incarnation of bug #30266 2005-03-19 14:24:17 +00:00
Andrey Hristov
070147105f Fixed #30871 2005-03-12 10:11:46 +00:00
Marcus Boerger
faae6ac159 - Do not touch return_valu's refcount or is_ref 2005-03-11 00:14:02 +00:00
Andrei Zmievski
f8fc9a3256 Check that object can actually return a class entry. I need this for a
class-entry-less helper objects that should not be present in the class
table.
2005-03-05 00:45:47 +00:00
Derick Rethans
ff1687731d - Fixed bug #32021: Crash caused by range('', 'z') 2005-02-18 13:37:23 +00:00
Rob Richards
bb9ba8e36e fix segfault when retval_ptr is empty - such as when exception thrown 2005-02-10 22:59:26 +00:00
Stanislav Malyshev
7b241027fa fix memory leak if function call fails 2005-02-02 10:37:50 +00:00
Antony Dovgal
38d8e20f68 destroy return_value and fix leak in array_fill() 2004-12-23 16:35:48 +00:00
Antony Dovgal
33c24b5436 fix leak (init array only if we got valid start key) 2004-12-16 19:13:58 +00:00
Antony Dovgal
b6b8bf0010 fix array_walk_recursive() so it doesn't reuse cached fci between calls
and add test for it
2004-12-03 17:43:23 +00:00
Antony Dovgal
ccc6462cc5 revert my previous patch as it breaks more than fixes 2004-12-02 16:35:02 +00:00
Antony Dovgal
dbc0bb7514 fix #29954 (array_reduce segfaults when initial value is array) 2004-11-28 17:03:45 +00:00
Antony Dovgal
2a588879ef fix bug #30587 (array_multisort doesn't separate zvals before changing them) 2004-11-19 16:55:37 +00:00
Marcus Boerger
c18e248e60 - Remove doubled definition 2004-11-01 22:28:59 +00:00
Marcus Boerger
b0c2af58f7 - Add some comment 2004-11-01 21:06:42 +00:00
Marcus Boerger
2ce7bcd742 - Allow direct access to spl class entries (SPL cannot be build shared) 2004-11-01 20:57:23 +00:00
Marcus Boerger
db47e478c5 - Use new way for global variables
- Cache class lookup
2004-11-01 12:09:46 +00:00
Marcus Boerger
8e3a8b1e8e - Add interface Countable (PECL #30113) 2004-11-01 10:45:54 +00:00
Andi Gutmans
11bcaedfc8 - Rename delete_global_variable() to zend_delete_global_variable() 2004-10-04 20:17:06 +00:00
Andi Gutmans
db507dd153 - Commit the variable fetch optimization.
- Extensions which delete global variables need to use new special function
- delete_global_variable() (I'm about to rename it) to remove them.
- Will post to internals@ or via commit messages if there's anything else.
2004-10-04 19:54:35 +00:00
Derick Rethans
7795da58e6 - Added new boolean (fourth) parameter to array_slice() that turns on the
preservation of keys in the returned array.
2004-09-15 11:50:27 +00:00
Derick Rethans
4bae5cb4d0 - MFB: Added the sorting flag SORT_LOCALE_STRING to the sort() functions which
makes them sort based on the current locale. (Derick)
2004-09-11 14:22:35 +00:00
Ilia Alshanetsky
fe73e4d851 Fixed bug #29808 (array_count_values() breaks with numeric strings). 2004-08-26 00:26:19 +00:00
Andi Gutmans
0286913937 - Use FREE_HASHTABLE() 2004-08-12 06:17:42 +00:00
Moriyoshi Koizumi
51fc7b8ea5 - Bugfix #29493 (extract(array, EXTR_REFS) misbehaves with elements referred
twice or more times). (Patch inspired by Michael Manley. Thanks.)
2004-08-10 06:00:30 +00:00
Ilia Alshanetsky
739696d2d7 Fixed but #29437 (Possible crash inside array_walk_recursive()). 2004-07-29 00:35:07 +00:00
Andrey Hristov
e64af9a898 proto fix
(thanks to dave%php.net for spotting)
2004-07-26 06:32:54 +00:00
Andrey Hristov
d77a3f92e6 make behavior a bit field 2004-07-24 09:25:52 +00:00
Andrey Hristov
5e5d2640fb add array_:
intersect_key()
intersect_ukey()
diff_key()
diff_ukey()
The first two by a patch of Cristiano Duarte. The second two were
implemented in almost the same way except one small difference.
2004-07-21 21:17:56 +00:00
Andrey Hristov
0eef82a733 fixing bug #28974 : overflow in array_slice()
The same kind of overflow appeared in array_splice(), substr() and
substr_replace()
2004-07-11 21:15:04 +00:00