Commit Graph

1972 Commits

Author SHA1 Message Date
Yasuo Ohgaki
15daf99288 Added fmod() function
# Is there any reason that math.c does not use errno?
2002-02-21 11:44:41 +00:00
Andrei Zmievski
513e598d1e Adding object aggregation capability along with tests. 2002-02-21 03:32:42 +00:00
Rasmus Lerdorf
229d207a58 Split CRC32 table out into a header file so other code can use it 2002-02-20 18:18:39 +00:00
Jason Greene
150d339231 Renamed zval_debug_dump() to debug_zval_dump() 2002-02-10 17:38:15 +00:00
Jason Greene
91ac18bc66 @Added zval_debug_dump which works similar to var_dump yet displays extra
internal information such as refcounts, and the true type names (Jason)
2002-02-10 06:52:35 +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
Derick Rethans
98e8a7ba08 - Fix for bug 15311 (type mismatch of php_dl when #ifndef HAVE_LIBDL) 2002-01-31 10:21:24 +00:00
Jon Parise
9aba9071b6 These are now defined in zend_config.w32.h. 2002-01-28 16:06:27 +00:00
Jon Parise
e40e7a669a zend_isinf() is already defined in Zend/zend_config.w32.h for Win32. 2002-01-27 18:19:18 +00:00
Jon Parise
f174bbc711 Use the zend_* versions of finite(), isinf(), and isnan(), as defined
in php_config.h.  Redefine the zend_* versions in the case of Win32.

This fixes the build on systems that don't provide a native version of,
say, isinf() (e.g. Solaris).
2002-01-27 07:41:20 +00:00
Jon Parise
d299bdc5d9 Add a comment indicating that this return statement will never be reached.
# Perhaps it should just be removed?
2002-01-27 07:15:07 +00:00
Sterling Hughes
0d59ff42d4 don't throw fatal errors, throw E_WARNING instead. 2002-01-27 06:18:05 +00:00
Derick Rethans
33b66a224b - Fixed highlight_* (make it more robust)
#- Thx Mr S for noticing this.
2002-01-25 15:43:58 +00:00
Derick Rethans
96a9eba020 - Added optional parameter to highlight_string and highlight_file which
makes these functions return a highlighted string instead of dumping
  to standard output. (Derick)
@- Added optional parameter to highlight_string and highlight_file which
@  makes these functions return a highlighted string instead of dumping
@  to standard output. (Derick)
2002-01-25 11:27:47 +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
Marko Karppinen
449b53e34a Ignore ordinal suffixes on numbers (bug #15210) 2002-01-24 22:24:58 +00:00
Sean Bright
a38bfb424e Fix for bug #15130. Way too much effort for this bug, but cleaned up code
a bit, use zend_parse_parameters(), etc, etc.  We only look for extensions
in the basename, not the full path.
2002-01-22 03:35:23 +00:00
Markus Fischer
fe6e7058ee - Fix crash with invalid localtime on Win32 systems. 2002-01-20 20:16:54 +00:00
Markus Fischer
1e2b854bba - mkdir(): made second (mode) parameter optional, default to 0777
switched to zend_parse_parameters().
# Added vim 'noet' setting
2002-01-11 10:44:24 +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
Sascha Schumann
a1dbb4ab16 (PHP touch) Operate on a stack buffer.. no need for allocating newtime
on the heap.
2002-01-10 07:25:00 +00:00
Sascha Schumann
edfd6d0988 Add three-parameter touch() which enables users to set
mtime/atime to different values.
2002-01-10 07:21:57 +00:00
jim winstead
831473d76e Rename finite/isinf/isnan to more standard is_*() names. 2002-01-09 23:59:05 +00:00
jim winstead
e68095972e Move type-handling functions into ext/standard/type.c (which had
a few otherwise unused functions in it).
2002-01-09 23:47:46 +00:00
Derick Rethans
aee570302f - Fix bug introduced in earlier patch 2002-01-09 16:03:36 +00:00
jim winstead
4fb4c6d4b3 More tweaking of wordwrap() with the cut parameter set. It was being a
little too aggressive and cutting words without breaking at spaces
first. (A couple of tests were incorrect.)
2002-01-05 23:49:58 +00:00
jim winstead
ca15b22212 New memcpy()-based wordwrap() implementation. The simple case
(single-character break, no forced break) appears to be about 60%
faster, and there's simply no comparison for non-simple cases with
non-trivial amounts of text. The old algorithm was O(n^2) (with an
unfortunately large constant factor) because of the use of strncat(),
the new one is O(n). Added some more tests, too.
@ - Made wordwrap() significantly faster. (Jim)
# test case: $t = join('',file('ChangeLog')); $w = wordwrap($t,10,"\n",1);
# new code completes in less than a second. i'm still waiting for the
# old code to finish.
2002-01-05 20:46:43 +00:00
jim winstead
62395159a9 Fix the Win32 compile. 2002-01-05 08:29:53 +00:00
Egon Schmid
87ad1fdb3b Fixed some protos. 2002-01-05 07:54:49 +00:00
jim winstead
b9d68b8e9d Apparently multi_convert_to_double_ex() didn't quite do what I
thought. Still need to handle numeric strings.
2002-01-05 03:56:38 +00:00
jim winstead
461e105069 Fixed pow(), and added finite(), isinf(), and isnan(). Also fixed
pow() tests.
@- Fixed pow(), and added finite(), isinf(), and isnan(). (Jim)
# Jeroen was on crack, and apparently flunked arithmetic. Names of new
# functions subject to change if people get persnickety about them.
# (They're currently the same as the underlying C library function
# names. Hope nobody forgets to update the tests if they change the
# names.)
# Oh, and pow() uses the new parameter-passing API now.
2002-01-05 03:45:11 +00:00
jim winstead
4b8f435b2a good grief, positive powers of 0 are well-defined. (code fix coming.) 2002-01-05 02:16:16 +00:00
jim winstead
9a171d03e8 Be more aggressive in making sure that substring matches are valid in
ereg_replace before trying to use them.
# i could have sworn i fixed this in php3. ereg() has similar logic, i
# guess i just missed ereg_replace. fixing this lets
# ext/standard/tests/reg/012.phpt pass on my debian/unstable box
2002-01-05 01:59:11 +00:00
Zak Greant
6823fb1fe7 Surprising how tests can fail when they don't have any supporting data :) Thanks for the catch Jan and Jim 2002-01-05 01:58:44 +00:00
jim winstead
f68b7c5f3e Fixed segfault in wordwrap() when wrapping to zero width and using
multi-character break or trying to force cut (bug #12768, now fails
and issues a warning because forcing a zero-width cut doesn't make
sense). Also converted to new paramater-passing API and avoid making
an extra copy of the return values.
# also added tests.
@- Fixed segfault in wordwrap() when wrapping to zero width and using
@  multi-character break or trying to force cut (bug #12768). (Jim)
2002-01-04 19:48:08 +00:00
Hartmut Holzgraefe
c9bc54abc3 fix for bug #14832: basename with 2nd parm corrupts source string 2002-01-03 20:20:35 +00:00
Thies C. Arntzen
21cc717bac protos fixes by Wolfgang Drews 2002-01-03 06:57:22 +00:00
Zak Greant
8c8b49ed20 Adding key_exists alias for array_key_exists, at the request of One-Who-Shall-Not-Be-Named-Because-He-Is-On-Vacation 2002-01-02 21:21:48 +00:00
Zak Greant
f01745896f chdir: corrected proto, converted to zend_parse_parameters 2001-12-30 10:13:08 +00:00
Zak Greant
59a45acca6 chroot: corrected prototype, converted to zend_parse_parameters 2001-12-30 09:50:41 +00:00
Zak Greant
2f6ffb545e Converted getenv to use zend_parse_parameters 2001-12-30 09:36:24 +00:00
Derick Rethans
57f3c395b8 - Removed is_array_multidimensional 2001-12-29 22:59:40 +00:00
Derick Rethans
ae07e93028 - Added test for recursive counting 2001-12-29 21:05:03 +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
Sebastian Bergmann
9063a96dfa PHP 4.0 -> PHP 4. Patch by Martin Jansen <mail@martin-jansen.de>. 2001-12-29 14:23:58 +00:00
Dan Kalowsky
b76eb3ae40 Making PHP compile again on MacOSX 10.1
# 10.1 does not have inet_pton support yet it seems so disabling it.
2001-12-27 15:42:05 +00:00
Markus Fischer
7cf14fb1e1 - Fix tiny leak. 2001-12-23 15:56:41 +00:00
Alex Waugh
e320de1e2e Undefine AF_UNIX under RISC OS 2001-12-23 00:46:13 +00:00
Derick Rethans
e8f3e3ffa0 - Let ceil also return a float in every case 2001-12-22 11:53:29 +00:00
Derick Rethans
6729156450 - Add test for floor and ceil 2001-12-22 11:52:56 +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
Zeev Suraski
431c793e0c Fix a warning 2001-12-22 03:04:32 +00:00
Derick Rethans
ca1bcd9ac3 - Fix for bug #14646, floor() always returns a float now. 2001-12-21 16:38:49 +00:00
Derick Rethans
e5c08b815f - Added open basedir checks to file functions. (Patch by
Christoph Kassen <chkassen@chkassen.de>)
2001-12-21 08:04:21 +00:00
Sean Bright
25058db066 Use memset() instead. 2001-12-21 03:50:07 +00:00
Sean Bright
33730ca2b9 Initialize variable to avoid bogus data and possible segfault. 2001-12-21 03:10:11 +00:00
Sean Bright
0ca4f69d31 Switched some functions to use zend_parse_parameters, cleaned up some
unused variables and some whitespace work.
2001-12-21 01:53:25 +00:00
Derick Rethans
d578e05f96 Mail should go to php-dev 2001-12-16 13:04:02 +00:00
Derick Rethans
3709eb6ab2 - Fix for bug #14544, bogus warning in pow()
#- I think I do not need to tell who screwed this up....
2001-12-16 10:59:20 +00:00
Hartmut Holzgraefe
424679e9fb proto fixes 2001-12-16 10:18:45 +00:00
Derick Rethans
f5f4a5cf37 - TSRMLS here and there, it's all about the Windows flair 2001-12-15 14:55:18 +00:00
Derick Rethans
143df7de6b - Added a second parameter to var_export which makes the function return
the variable representation in a string.
2001-12-15 14:45:59 +00:00
Stig Bakken
dd969337a0 return boolean where appropriate 2001-12-12 01:36:07 +00:00
Hartmut Holzgraefe
cc4b274a58 ereg functions will now take in account the real number of
subexpressions instead of simply assuming a fixed count of 10
2001-12-11 19:28:31 +00:00
Sebastian Bergmann
38933514e1 Update headers. 2001-12-11 15:32:16 +00:00
Derick Rethans
a7b9d5590b - Remove debug code 2001-12-08 23:46:19 +00:00
Derick Rethans
3cb1db985e - Added var_export, which shows a representation of a variable, much like
var_dump, but in such a way you can use it as PHP code.
@- Added var_export, which shows a representation of a variable, much like
@  var_dump, but in such a way you can use it as PHP code. (Derick)
2001-12-08 23:44:34 +00:00
Sterling Hughes
d95a4e2c19 Fix long2ip's handling of unsigned longs, by accepting a string argument and
then manually converting the string to an unsigned long using strtoul()
2001-12-07 13:20:18 +00:00
Egon Schmid
9f456af68b Fixed some protos. 2001-12-07 09:34:50 +00:00
Hartmut Holzgraefe
94737d086f proto fix 2001-12-07 07:27:00 +00:00
Hartmut Holzgraefe
49cc65cdae renamed rot13 to str_rot13() 2001-12-06 21:39:01 +00:00
Hartmut Holzgraefe
71028d46cf ported rot13() from php3 2001-12-06 19:02:27 +00:00
Hartmut Holzgraefe
c1626365f9 proto fixes 2001-12-06 18:59:22 +00:00
Hartmut Holzgraefe
38472b48d7 proto fix 2001-12-06 17:15:59 +00:00
Sterling Hughes
84ed9d387f use PHP_INFO_ALL and PHP_CREDITS_ALL instead of hardcoding them 2001-12-06 13:31:34 +00:00
Sascha Schumann
ab38ad27a5 increase timestamp, because make tries to regenerate this file without any reason 2001-12-05 21:45:33 +00:00
Sterling Hughes
886ad91adf Make the length parameter to fgets optional (defaults to 1024) 2001-12-04 19:40:48 +00:00
Derick Rethans
1f14640b3e - Added ob_get_level, which returns the nesting level of the output buffering
mechanism. (patch by Yasuo Ohgaki <yasuo_ohgaki@yahoo.com>)
@- Added ob_get_level, which returns the nesting level of the output buffering
@  mechanism. (Yasuo, Derick)
2001-12-03 07:43:53 +00:00
Frank M. Kromann
03b5cb6775 Make php_reg_replace available from shared extensions 2001-12-03 05:15:29 +00:00
Frank M. Kromann
e7ef5041d5 Make php_MD5* functions available from shared extensions 2001-12-03 05:14:28 +00:00
Frank M. Kromann
8e40864770 Make _php_math_number_format available from shared extensions 2001-12-03 05:12:48 +00:00
Frank M. Kromann
c07cf5c2a5 Make php_startpage and php_getlastmod available from shared extensions 2001-12-03 05:11:29 +00:00
Frank M. Kromann
b4d9b70c6e Make php_setcookie available from shared extensions 2001-12-03 05:10:10 +00:00
Hartmut Holzgraefe
34feef0d6b - switch to new paramter parser
- make sure To: and Subject: do not end with a newline character
2001-12-02 17:57:17 +00:00
Bernd Roemer
99639f5812 Allow unserializer_callback_func to be turned off. 2001-12-02 17:31:11 +00:00
Derick Rethans
896faf0b34 - Fix a bug in timezones +0100 and -0100 2001-12-02 11:35:28 +00:00
Derick Rethans
29cd309944 - Fix a crash when passing e.g. NULL to basename(). (Patch by Markus
Fischer <mfischer@guru.josefine.at>)
#- Simplyfied code using zend_parse_parameters().
2001-12-01 15:45:55 +00:00
Thies C. Arntzen
0fd809a770 improve last patch:
non existant object variables are now serialized as NULL, this saves us from
buffering the serialized data.
2001-12-01 15:17:50 +00:00
Thies C. Arntzen
7ff5198c53 serialized data would be incoorect if __sleep() returned a variable-name
which is non-existant in the object.
submitted by: Bernd Roemer <berndr@bonn.edu>
2001-12-01 15:06:37 +00:00
Derick Rethans
9190271cef - Added ob_flush and ob_clean functions, which do not end the buffer like
ob_end_flush and ob_end_clean do.
@- Added ob_flush and ob_clean functions, which flush and clean an
@  output buffer without destroying the buffer. (Derick)
2001-11-30 10:48:38 +00:00
foobar
ef64e8336f Updated file since .re changed. 2001-11-26 22:46:15 +00:00
Derick Rethans
534b0f7e06 - Also patch the file from which var_unserializer.c is generated 2001-11-26 22:33:44 +00:00
Derick Rethans
06cdf297a8 - Adding a callback mechanism to the unserializer. (patch by Bernd
Roemer <berndr@bonn.edu>)
#- An explainatory e-mail will be send to php-dev
2001-11-26 21:04:21 +00:00
Derick Rethans
f17f3371be - Added md5_file(), which calculaties the MD5 sum of a file.
(patch by: Alessandro Astarita <aleast@capri.it>) (Derick)
@- Added md5_file(), which calculaties the MD5 sum of a file.
@  (patch by: Alessandro Astarita <aleast@capri.it>) (Derick)
2001-11-18 18:48:17 +00:00
foobar
fc3906e93a WS fix 2001-11-18 03:34:23 +00:00
Sascha Schumann
9f3362933a Fix two incidents which have been reported about the new unserializer.
#1: forgot to handle negative numbers
#2: added zval_ptr_dtor which was not in the original code which
    might lead to crash

PR: #14082
2001-11-16 16:34:14 +00:00
Stanislav Malyshev
39f3075500 Check in ftok() function by Andrew Sitnikov <sitnikov@infonet.ee> 2001-11-15 09:53:40 +00:00
Sterling Hughes
42b9349d8b Many other reasons that setvbuf can fail than "wrong arguments", returning
false should be enough
2001-11-14 12:57:06 +00:00