Commit Graph

117 Commits

Author SHA1 Message Date
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
Andrei Zmievski
74175e429d @- Changed extract() to return the number of variables extracted. (Andrei) 2001-01-08 20:57:59 +00:00
Stig Venaas
c5b11042b0 Hopefully solves some bad behavior in array_unique(), array_intersect()
and array_diff(). Now using SORT_STRING instead of SORT_REGULAR
@- Fixed misbehavior of array_unique(), array_intersect() and array_diff();
@  could in certain cases give wrong result or segfault (Stig Venaas)
2000-12-28 23:50:42 +00:00
Andrei Zmievski
a1614b8411 (PHP preg_replace) Fix to allow proper escaping of captured subpattern
references in the replacement string.
(PHP array_sum) Check that argument is an array.
2000-12-22 16:31:42 +00:00
Zeev Suraski
aa6d2ac5d0 Heads up people!
Updated the get_current_key() API - the relevant authors, please take
a look at the updated code and make sure it's ok...
2000-12-22 12:57:09 +00:00
Andrei Zmievski
753e46657f Make php_array_merge() an API function. 2000-12-11 05:36:24 +00:00
Sascha Schumann
949b0893dc The result of conv_z_macros and some manual conversion of
"return_value.*=.*IS_STRING" constructs to RETVAL_STRINGL.
2000-11-27 13:31:21 +00:00
Stig Venaas
a5c75761c2 Fixed memory leak in array_diff and array_intersect, was introduced with
last change.
2000-11-03 07:20:35 +00:00
Sascha Schumann
9866d899e9 Namespace protect mergesort (caused conflict on Darwin). 2000-11-02 15:32:52 +00:00
Andrei Zmievski
d4cf62f86f @- Fixed array_rand() to shuffle results when the number of requested
@  elements is the same as the number of elements in the array. (Andrei)
2000-10-27 14:08:33 +00:00
Andrei Zmievski
a35bf41670 Added array_sum() function. 2000-10-25 17:40:11 +00:00
Stig Venaas
e8c7fd7f5f Fixed array_type_data_compare(). I want strings to always differ from
numbers, but not say 7 and 7.0 to differ.
2000-10-22 11:18:21 +00:00
Stig Venaas
4edb210028 Made array_unique use array_type_data_compare instead of array_data_compare 2000-10-21 18:12:30 +00:00
Stig Venaas
508d1993ed Added array_type_data_compare which is like array_data_compare but
compares type first. Also rewrote array_intersect and array_diff,
so that the order is not changed.
@- Made array_intersect and array_diff not alter order (Stig Venaas)
2000-10-21 17:48:11 +00:00
Andi Gutmans
c54047b0b0 - Change to Z_BVAL macro 2000-09-19 18:19:02 +00:00
Zeev Suraski
c45b1c2c8b - Fix warnings
- Fix URL scanner startup crash
2000-09-19 17:37:34 +00:00
Andrei Zmievski
5470222d70 Forgot to update proto. 2000-09-12 19:04:50 +00:00
Andrei Zmievski
34574352be @- Added second argument to array_reverse() that indicatese whether
@  the original array keys should be preserved. (Andrei)
2000-09-12 19:03:59 +00:00
Andrei Zmievski
d89c5b231c @- Updated array_walk() to be able to accept array($obj, 'method')
@  syntax for the walk function. (Andrei)
2000-08-22 18:39:29 +00:00
Hartmut Holzgraefe
c1ceeaf830 typo fix in array_diff error message, fixes bug #6236 2000-08-18 12:45:01 +00:00
Hartmut Holzgraefe
867160a751 minor typo fix in proto 2000-08-18 12:28:28 +00:00