Commit Graph

51 Commits

Author SHA1 Message Date
Stig Venaas
99f151f1bd Adding fuctions array_unique, array_intersect and array_subtract. 2000-06-10 18:58:45 +00:00
Andi Gutmans
3701bc4207 - ARG_COUNT(ht) -> ZEND_NUM_ARGS() mega patch 2000-06-05 19:47:54 +00:00
Stanislav Malyshev
a23c64ee8b \0 is part of they key, but not of the variable 2000-06-04 15:43:04 +00:00
Zeev Suraski
5673378ea6 - Allow all functions that receive user-defined function callbacks to accept
an array that contains an object and a method name, in place of a function
  name, e.g. usort($array, array($obj, "ObjSort"))
(I checked the code in array.c and basic_functions.c, other code which uses
call_user_function() may still force the function_name argument to be of type
IS_STRING, which prevents this feature from working - and is no longer necessary)
2000-06-03 04:16:46 +00:00
Andrei Zmievski
4c818aec33 @- Added third argument to in_array(). If it's true, then in_array()
@  will use strict comparison instead of the default one. (Andrei)

Fixes bug #4753
2000-06-01 13:52:08 +00:00
Andrei Zmievski
01a4220954 @- Added array_merge_recursive() that will recursively merge values
@  under the same keys. (Andrei)
2000-05-30 17:03:56 +00:00
Andrei Zmievski
4197a68602 @ Fixed min()/max() segfault. (Andrei) 2000-05-24 19:07:17 +00:00
Zeev Suraski
e043439ff6 Update the license with the new clause 6 2000-05-18 15:34:45 +00:00
Andrei Zmievski
aa09d60d7d (PHP array_multisort) Fix the array_size test. 2000-05-18 12:29:45 +00:00
Andrei Zmievski
a859e83392 Update for sort functions - user can now specify sort type. 2000-05-18 00:47:57 +00:00
Andrei Zmievski
fdbea075fa @- Added array_rand() function. (Andrei) 2000-05-09 19:27:00 +00:00
Andrei Zmievski
105be1513d Fix an empty arrays condition and optimize a bit.
@ Fixed a crash in array_multisort() that happened when empty arrays
@ were passed to it. (Andrei)
2000-04-28 14:01:08 +00:00
Andrei Zmievski
9ffd5b5595 @- array_walk() now automatically resets the array. (Andrei) 2000-04-13 18:57:37 +00:00
Andrei Zmievski
c7100c4a1a Added natural comparison/sorting routines using code from Martin Pool.
@- Added natural comparison/sorting routines strnatcmp(), strnatcasecmp(),
@  natsort(), and natcasesort(). These are useful for comparing and sorting
@  strings that contain numbers. Based on the code from Martin Pool
@  <mbp@humbug.org.au>. See http://www.linuxcare.com.au/projects/natsort/
@  for more info on natural sorting. (Andrei)
2000-04-12 19:39:02 +00:00
Egon Schmid
3e2a1034cb Return type was missing. 2000-04-04 08:52:57 +00:00
Sterling Hughes
68d4298e71 #yikes stripes, didn't see that one
#its time to go to bed
Re-fixed return value of min and max
2000-03-29 12:43:13 +00:00
Sterling Hughes
cc2c9d8f0f 1. Holy protos Batman.
2.  Converted some functions from using "return" to RETURN_FALSE
2000-03-29 11:19:01 +00:00
Andrei Zmievski
7b02e9fc35 @- Fixed extract() for EXTR_PREFIX_SAME and EXTR_SKIP cases. (Andrei) 2000-03-24 14:56:19 +00:00
Stig Bakken
99e0b36321 @Cleaned up extension namespace (Stig)
Cleaned up extension namespace, and changed ext/standard into one single
extension.
2000-03-06 20:37:11 +00:00
Stig Bakken
d23e5d837a @- Implemented default_charset and default_mimetype config directives (Stig)
Implemented default_charset and default_mimetype configuration directives.
Started implementing ticks in PHP.
2000-02-25 21:27:03 +00:00
Egon Schmid
284491887f There are more '|' and should be mixed. 2000-02-24 15:06:33 +00:00
Andrei Zmievski
c401bbe22e Fix proto. 2000-02-24 14:07:35 +00:00
Egon Schmid
fe615efb5c More protos. 2000-02-24 08:39:02 +00:00
Zeev Suraski
86fa2aade2 the pipe is breaking all the time 2000-02-19 23:41:32 +00:00
Andrei Zmievski
a60e91b313 (request_shutdown) Prevent infinite loop on shutdown if there is an error
in shutdown function.
(php_array_walk) Print a warning if the walk function doesn't exist.

Split shutdown function call into a separate function that's called with
zend_hash_apply() instead of as destructor to keep hash consistent.

This fixes bug #3419.
2000-02-11 21:14:42 +00:00
Zeev Suraski
80bdd19e03 Fine tune Andi's patch 2000-02-11 15:59:30 +00:00
Andi Gutmans
29280bb9ec - Get rid of some more evil MSVC5's and switch standard/ to use PHP_WIN32 2000-02-10 21:53:56 +00:00
Zeev Suraski
c12aa454ff Compile fixes 2000-02-05 15:44:20 +00:00
Zeev Suraski
3a816341f9 Cleanup patches 2000-02-05 15:16:12 +00:00
Andi Gutmans
bdefd5da15 - Change IS_UNSET -> IS_NULL 2000-01-04 13:22:58 +00:00
Sascha Schumann
43ae2bffbb Happy Y2K patch! Happy new year (or the new millennium, depending on whether
you start counting at 0 or 1).
2000-01-01 01:32:05 +00:00
Zeev Suraski
ccb4b18348 Happy new year (especially to Thies :)
- Zend branch patches merged in - get the PHP tree uptodate
- Clean
1999-12-31 14:06:31 +00:00
Zeev Suraski
235386b245 Change ALLOC_ZVAL() semantics 1999-12-26 21:21:33 +00:00
Andi Gutmans
3f6e00e48d - Use ALLOC_ZVAL() in PHP. Finding the places to put FREE_ZVAL(z) is much
more tricky and I'm not sure how many places this is. zval allocations
  were only made directly in 11 places.
1999-12-24 15:43:39 +00:00
Andrei Zmievski
80bab9d939 We're using ZVAL's now. 1999-12-21 17:14:31 +00:00
Zeev Suraski
489de5dce2 Support the latest update to call_user_function_ex() 1999-12-19 18:58:27 +00:00
Zeev Suraski
a1ad2872ee - The tree compiles again 1999-12-18 22:40:35 +00:00
Andrei Zmievski
457a13dac5 Finished array_multisort() function. Basically it sorts multiple arrays
similar to ORDER BY SQL clause.
@ Added array_multisort() function. (Andrei)
# Docs are coming soon
1999-12-13 19:42:26 +00:00
Sascha Schumann
9278d9d911 Remove unnecessary ARRAYLS_FETCH() calls 1999-12-12 10:50:30 +00:00
Andrei Zmievski
dbaf6c5c65 Added array globals in preparation for multisort() changes. 1999-12-11 22:42:01 +00:00
Sascha Schumann
3b515617a4 Make array.c thread-safe 1999-12-01 17:21:52 +00:00
Thies C. Arntzen
5cc10ecec2 @- Fixed float-compare in min(),max(),a[r]sort(),[r]sort(). (Thies)
convert_to_long() after compare_function() destroys float-compares!
1999-11-21 17:13:39 +00:00
Egon Schmid
0929985414 Maybe later on today. Must buy some beer first. 1999-11-21 14:06:30 +00:00
Thies C. Arntzen
2451ff5368 @- Implemented array_flip() function. Returns input-array with key, value
@  flipped. (Thies)
(PHP array_flip) new function. no clash detection, only works for IS_STRING and IS_LONG datatypes in src-array.
1999-11-21 12:37:53 +00:00
Thies C. Arntzen
ee1380e6b0 -renamed some macros
-return_value_used now used in a few more functions
1999-11-21 12:13:44 +00:00
Andi Gutmans
3bffcbef5b - Add array.c to the Win32 project 1999-11-19 15:06:57 +00:00
Andrei Zmievski
61142e4341 Just some rearranging. 1999-11-16 20:14:55 +00:00
Andi Gutmans
9e14736315 - Change used_return_value to return_value_used 1999-11-16 19:12:29 +00:00
Andi Gutmans
7239aad9c4 - Initial support for Thies' idea of passing functions a flag telling them
they don't need to return a value. Adjusted reset() to work with this.
  It is a bit problematic because if internal functions don't look at the
  flag and still return a value orginally this leaked. So I free the value
  in any case, which kind of makes the speed gain a bit smaller
1999-11-16 18:47:47 +00:00
Thies C. Arntzen
2b08dfec28 (PHP k[r]sort) now use compare_function from libzend to be consistent with the language-core. 1999-11-14 19:59:52 +00:00