Commit Graph

180 Commits

Author SHA1 Message Date
Brad LaFountain
c90764d753 one last fix for array_shift 2002-08-03 00:40:46 +00:00
Brad LaFountain
9b0553c390 array_pop wasnt setting next index 2002-08-01 17:34:31 +00:00
foobar
922b7596a2 That was not correct.. 2002-08-01 16:44:47 +00:00
foobar
6df2b90c05 Reset index when doing array_pop() 2002-08-01 16:39:52 +00:00
foobar
06b3dd122f Nuke compile warning. 2002-08-01 12:07:15 +00:00
foobar
9d62cd7d45 - Removed the DOS line endings
- Changed the '//' comment (this is C, not C++) to /* */
# Brad, use some editor which works..
2002-08-01 12:06:46 +00:00
Brad LaFountain
4f5bd6b7d4 made array_shift re-index like it did before previous fix 2002-08-01 04:38:11 +00:00
foobar
9fe39b9604 Reverted the patch..it breaks the original behaviour of at least array_shift. 2002-07-31 13:49:50 +00:00
Brad LaFountain
70fb744365 fixed bugs 16063 and 16068
increased preformance of array_pop and array_shift
2002-07-30 22:54:12 +00:00
Derick Rethans
392a452c80 Silence warning 2002-07-08 07:33:22 +00:00
Derick Rethans
cc920570fd Unify error messages 2002-07-08 07:32:59 +00:00
Derick Rethans
7faa669915 - Fix for bug #14580: Made key() binary safe 2002-07-08 07:02:55 +00:00
Derick Rethans
1bf9b3d736 - Fix for bug #17654 2002-06-29 15:39:41 +00:00
Stig Venaas
7853832234 Made array_unique() always keep the first occurrences of duplicates,
making the behavior easier to understand, and maybe more useful.
2002-06-18 19:37:59 +00:00
Jan Lehnardt
df226a54d9 - WS-fixes 2002-06-18 13:16:33 +00:00
Jan Lehnardt
a8de8ec90c - whitespace fix 2002-06-10 16:34:25 +00:00
Harald Radi
8e19555608 fix the build 2002-06-10 12:21:58 +00:00
Andrei Zmievski
7f4c12b006 Fix bug #7045: shuffle() now provides consistent distribution of values
in the array.
2002-06-10 02:28:32 +00:00
Edin Kadribasic
e7ab5766d6 Fixed array_rand() on ZTS platforms.
@- Fixed array_rand() on thread-safe platforms such as Windows. (Edin)
2002-06-03 17:49:48 +00:00
Andrei Zmievski
1668570e4d Changing email address. 2002-05-13 17:28:38 +00:00
Andrei Zmievski
5ff970ba7d Fix Bug #14795. 2002-04-24 15:23:43 +00:00
Andrei Zmievski
4fc01022e6 Fix unwanted type conversion in array_merge_recursive (Bug #14990). 2002-04-24 15:01:53 +00:00
Sebastian Bergmann
6adb33006b Fix TSRMLS_CC. 2002-03-12 07:20:00 +00:00
Yasuo Ohgaki
e953dba0d7 Make use of TSRMLS_C/D 2002-03-12 06:56:57 +00:00
Zeev Suraski
bb685a402f Fix php_splice() to work with large values 2002-03-01 12:00:05 +00:00
Andi Gutmans
284eaf34cc - Add TSRMLS_FETCH()'s needed for the new object overloading in ZE2. 2002-02-05 20:43:49 +00:00
Andrei Zmievski
441c583a2c Converted extract() to use smart_str for variable name manipulation. This
sped it up a bit.
2002-02-01 20:17:32 +00:00
Rasmus Lerdorf
0d139d3c27 (extraxt) add EXTR_IF_EXISTS and EXTR_PREFIX_IF_EXISTS flags
@- Added EXTR_IF_EXISTS and EXTR_PREFIX_IF_EXISTS flags to extract()
@   EXTR_IF_EXISTS only extracts a variable if it already exists
@   EXTR_PREFIX_IF_EXISTS only extracts the variable if it exists and
@   then it prepends the prefix to it.  ie. if $PATH exists then
@   extract($_ENV,EXTR_PREFIX_IF_EXISTS,'e') would result in $e_PATH
@  This lets you do $a = $b = $c = true; extract($_REQUEST,EXTR_IF_EXISTS);
@  and you only get the global request variables you have defined imported
@  into your symbol table.  (Rasmus)
2002-01-25 09:01:02 +00:00
Andrei Zmievski
ddc039d0f5 Fix the recursive counting, it was broken for associative or non-sequential
arrays. Also update NEWS file.
2002-01-10 21:31:06 +00:00
Derick Rethans
aee570302f - Fix bug introduced in earlier patch 2002-01-09 16:03:36 +00:00
Derick Rethans
cef0a461f9 - Added extra parameter to count() that recursively counts elements in an
array and added is_array_multidimensional(). (patch by Vlad Bosinceanu
  <glipy@fx.ro>)
2001-12-29 20:59:59 +00:00
Andi Gutmans
211d712c59 @ Fix bug in krsort() where an extra character was being compared (Andi)
- Fix bug in krsort() where an extra character was being compared (Andi)
2001-12-29 20:47:25 +00:00
Zak Greant
2c9f5d8a91 Modified array_walk, arsort, asort, krsort, ksort, rsort, shuffle, sort,
uasort, uksort and usort.

Corrected prototype comments for all.

Converted to use zend_parse_parameters, except for the u.?sort functions.

Changed return values for failure from implicit NULL to explicit FALSE in
asort(), krsort(), and ksort().

Changed pval to zval in the u.?sort functions.

Added test to help ensure that fixes to code do not change function
behavior. Tests are quite large (~237k) but compress down to ~16k.
Please let me know if this is a problem!
2001-12-22 11:49:56 +00:00
Sebastian Bergmann
38933514e1 Update headers. 2001-12-11 15:32:16 +00:00
Derick Rethans
78e4644fa1 - Renaming key_exists to array_key_exists
@- Renamed key_exists tp array_key_exists. (Derick)
#- Not sure if this belongs in NEWS, but it was already in a released
#  version. And yes, I know I'm breaking BC here, but as it was not documented
#  yet, that doesn't matter.
2001-11-11 18:28:43 +00:00
Andrei Zmievski
2890b57e46 @- Added array_chunk() function that splits an array into chunks of specified
@  size. (Andrei)
2001-10-27 05:11:15 +00:00
Rasmus Lerdorf
72fc6bc4b1 As suggested on php-dev, array_fill() is probably a better name for this
function.
2001-10-23 18:46:35 +00:00
Rasmus Lerdorf
d98c96fc6c Use references instead of making a copy each time in array_init(). About
twice as fast for a high number of elements.  2.80 seconds for the copy
of 1,000,000 elements and 1.39s for the reference version.  Need to chunk
it every 62k or so because refcount is a short.
2001-10-22 20:49:27 +00:00
Rasmus Lerdorf
4d60dbb9ef Oops, leftover crud 2001-10-21 07:45:32 +00:00
Rasmus Lerdorf
798ec79319 Motivated by bug #13607 I wrote up a simple array_init() function that
lets you quickly create an array and initialize each element to a certain
value.
@ Add array_init() function (Rasmus)
2001-10-21 07:42:35 +00:00
Jeroen van Wolffelaar
78b881f389 Fix naming inside php_search_array, comp_func is not a compare function. 2001-10-07 13:49:08 +00:00
Jeroen van Wolffelaar
62feefddc7 Fix array_search and in_array. Now binary safe, and faster (returns when
found, and doesn't duplicate the key each time, but only when necessary)

Patch also by Edin Kadribasic
2001-10-05 21:58:41 +00:00
Jeroen van Wolffelaar
89ea50a588 Fix bug 13567 and don't depend on a boolean int-value to be either 1 or 0 2001-10-05 20:14:33 +00:00
Edin Kadribasic
e78b61542d Added array_change_key_case() function that returns array with
with all string keys lowercased or uppercased
@- Added array_change_key_case() function that returns array with
@  with all string keys lowercased or uppercased (EdinK)
2001-10-05 18:38:53 +00:00
Sterling Hughes
bcb426a207 Merge in qsort changes 2001-09-17 21:02:53 +00:00
Sterling Hughes
97fea0931c Make rand thread safe when ZTS is defined. 2001-09-16 20:49:57 +00:00
Derick Rethans
78747bd2df - Don't wrap lines... this is annoying while coding. 2001-09-09 13:29:31 +00:00
Sterling Hughes
ff2bc83c08 remove ARG_COUNT(ht)
# Is there any reason that the set_compare_func call is passed SORT_STRING
# instead of SORT_REGULAR??
2001-09-09 11:03:31 +00:00
foobar
42b5521af5 revert bad commit. 2001-09-05 19:47:55 +00:00
Daniel Beulshausen
9b8886410d fix zts+win32 build 2001-09-04 02:19:30 +00:00