Commit Graph

137 Commits

Author SHA1 Message Date
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
Rasmus Lerdorf
25c3a3a39d vim-6 does folding - clean up a bunch of missing folding tags plus
some misguided RINIT and RSHUTDOWN calls in a few fringe extensions
2001-06-05 13:12:10 +00:00
John Donagher
639b957f74 Add missing end-folding delimiter 2001-05-23 01:50:11 +00:00
Andrei Zmievski
f071e8c566 Always free the callback_name when using zend_is_callable(). 2001-05-10 16:30:12 +00:00
David Croft
34f03f2c5c @ - Added key_exists() to check if a given key or index exists in an
@ array or object (David Croft)
Added key_exists() to check if a given key or index exists in an array or object
2001-04-30 04:06:09 +00:00
Andrei Zmievski
221a5a60b6 Use correct string length. 2001-04-02 13:20:16 +00:00
Andrei Zmievski
d9aa966a44 @- Added array_map() function that applies a callback to the elements
@  of given arrays and returns the result. It can also be used with a
@  null callback to transpose arrays. (Andrei)
2001-03-19 21:20:02 +00:00
Andrei Zmievski
770c66125d @- Added array_filter(), which allows filtering of array elements via
@  the specified callback. (Andrei)
2001-03-16 20:46:33 +00:00
Andrei Zmievski
f7f2cf9de5 All user callbacks should be to EG(function_table). 2001-03-16 19:51:08 +00:00
Frank M. Kromann
6195f14633 Fixing build on Win32 by adding missing BLS_FETCH(); 2001-03-16 19:48:40 +00:00
Andrei Zmievski
561cc74389 @- Fixed all relevant array functions to avoid moving the internal array
@ pointer during operations. (Andrei)
2001-03-16 19:29:23 +00:00
Stanislav Malyshev
0fa068e1fa Prevent memory leak 2001-03-12 10:14:00 +00:00
Stanislav Malyshev
be83ba17da Use hash position with array_flip 2001-03-12 08:07:00 +00:00
Andrei Zmievski
40dd7eef96 This will have to do until the docs come along. 2001-03-12 03:10:15 +00:00
Andrei Zmievski
d73ef12429 @- Added array_reduce(), which allows iterative reduction of an array
@  to a single value via a callback function. (Andrei)
- Added array_reduce(), which allows iterative reduction of an array
  to a single value via a callback function.
- Fixed usage of zend_is_callable() in PCRE.
2001-03-12 03:06:53 +00:00
Andi Gutmans
eb6ba01d1c - Fix copyright notices with 2001 2001-02-26 06:11:02 +00:00
James Moore
118c015529 Adding php_rand() and php_srand(seed) as a wrapper around random, lrand48 and rand. 2001-02-22 00:24:19 +00:00
Andrei Zmievski
8d7972b69b Fix memory leak. 2001-02-21 17:22:26 +00:00
Jason Greene
ffa08fc26e Changed default behavior of array_search to match in_array
(strict was default on, and is now default off)
2001-02-20 16:44:57 +00:00
Andrei Zmievski
1424e36315 Rename to array_search(). 2001-02-20 14:23:03 +00:00
Jason Greene
1888a98a4b Moved the core of in_array into the function php_search_array, which is called by
in_array and search_array (new)

@ Added search_array which works similar to in_array but returns
@ the key instead of a boolean. (jason@php.net)
2001-02-20 05:36:40 +00:00
Jim Jagielski
e541a27eed For those lucky systems with both random() and *rand48(), the random()
family is the prefered choice. So if both exist, we now choose that.
2001-02-06 16:27:08 +00:00
Andrei Zmievski
21aeba29d0 @- Fixed extract() to properly prefix numeric keys when EXTR_PREFIX_ALL is
@  used. (Andrei)
@- Added EXTR_PREFIX_INVALID flag to extract() to automatically prefix
@  string keys that do not constitute valid variable names. (Andrei)
2001-01-22 17:27:02 +00:00
Andrei Zmievski
145f60a485 @- Changed extract() to check that prefixed name is a valid one. (Andrei)
Changed extract() to check that prefixed name is a valid one.
Optimized extract() a bit too.

# It'd be nice if someone made regression tests for extract().
2001-01-08 21:57:14 +00:00