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
Andi Gutmans
1ecd31b66c
- Fix thread safe mode.
...
- Please don't use Java style function braces.
2001-09-03 20:21:00 +00:00
Jeroen van Wolffelaar
0cb6a31906
Fix array_rand and array_suffle to use php_rand correctly
2001-09-03 01:54:04 +00:00
Jeroen van Wolffelaar
b0300e26df
Fix prototype
2001-09-03 01:46:03 +00:00
Jeroen van Wolffelaar
f7306ce010
Merge RAND_REDESIGN into MAIN
2001-09-03 01:06:23 +00:00
Andrei Zmievski
392e1edee8
@- Made in_array() and search_array() allow the needle to be an array in
...
@ itself. (Andrei)
2001-08-31 04:52:10 +00:00
Rasmus Lerdorf
563ffb8984
Kill a warning
2001-08-28 21:50:37 +00:00
Andrei Zmievski
cae9763d0a
@- Fixed a crash bug in array_map() if the input arrays had string or
...
@ non-sequential keys. Also modified it so that if a single array is passed,
@ its keys are preserved in the resulting array. (Andrei)
2001-08-24 02:58:23 +00:00
Zeev Suraski
e140b35b04
API update
2001-08-21 12:57:53 +00:00
Zeev Suraski
c0404f4631
Whitespace
2001-08-11 17:03:37 +00:00
Andrei Zmievski
32440e3051
Fix a couple of leaks.
2001-08-07 16:41:33 +00:00
Sascha Schumann
23b9300fd1
more tsrm cleanup
2001-08-06 03:50:52 +00:00
Andrei Zmievski
bffbe675f9
@- Fixed a crash bug in array_map() when NULL callback was passed in. (Andrei)
2001-08-04 16:54:20 +00:00
Jeroen van Wolffelaar
49c16290f3
- Fix array_sum to switch to float on overflow. Fixes bug#12505
2001-08-03 19:18:51 +00:00
Zeev Suraski
c43806f415
Zend compatibility patch
2001-07-30 08:24:42 +00:00
Zeev Suraski
7b1c400631
More TSRMLS_FETCH annihilation (Zend compatibility patch)
2001-07-30 04:58:07 +00:00
Zeev Suraski
d87cc976e1
Redesigned thread safety mechanism - nua nua
2001-07-28 11:36:37 +00:00
Zeev Suraski
fe6f8712a4
- Get rid of ELS_*(), and use TSRMLS_*() instead.
...
- Move to the new ts_allocate_id() API
This patch is *bound* to break some files, as I must have had typos somewhere.
If you use any uncommon extension, please try to build it...
2001-07-27 10:16:41 +00:00
Rasmus Lerdorf
45d71e2951
Make range() function smarter
...
@ - Improve range() function to support range('a','z') and range(9,0)
@ types of ranges. (Rasmus)
2001-07-09 20:36:47 +00:00
Andi Gutmans
c977f29862
- Use ALLOC_HASHTABLE() instead of emalloc(sizeof(HashTable))
2001-06-19 16:03:35 +00:00
Rasmus Lerdorf
81e2cf03ac
Fix folding and clean up some extensions
2001-06-06 13:06:12 +00:00