Commit Graph

510 Commits

Author SHA1 Message Date
Dmitry Stogov
760fe72af6 Fixed comparison od references 2014-02-24 17:29:28 +04:00
Dmitry Stogov
1770ace249 Fixed object to string conversion 2014-02-24 13:49:53 +04:00
Dmitry Stogov
844887ed56 Fixed IS_RESOURCE handling 2014-02-24 13:12:53 +04:00
Xinchen Hui
91e2a91396 Missing handling of IS_REF in ext/standard/tests/strings/bug47842.php 2014-02-23 19:36:38 +08:00
Dmitry Stogov
6454684212 Use better data structures (incomplete) 2014-02-21 22:59:51 +04:00
Dmitry Stogov
52bd62eca8 Fixed assertions 2014-02-21 20:35:40 +04:00
Dmitry Stogov
8bae1daa0c Use better data structures (incomplete) 2014-02-19 14:35:28 +04:00
Dmitry Stogov
557994d50d Use better data structures (incomplete) 2014-02-19 01:12:05 +04:00
Dmitry Stogov
5de7115679 Use better data structures (incomplete; able to run bench.php) 2014-02-18 16:27:38 +04:00
Dmitry Stogov
2b9b9afa7a Use better data structures (incomplete) 2014-02-17 17:59:18 +04:00
Dmitry Stogov
be82a07776 Use better data structures (incomplete) 2014-02-12 18:08:11 +04:00
Dmitry Stogov
f4cfaf36e2 Use better data structures (incomplete) 2014-02-10 10:04:30 +04:00
Bob Weinand
363ff60475 Fixed memory leak in pow operator 2014-02-06 21:31:40 +01:00
datibbaw
aff56f3c45 add T_POW (**) operator
Fixed recognition of the operator

Added opcode, still doing multiply instead of pow()

opcode now always returns int(42)

The right answer, but always a float

Yanked code from pow() implementation.

Should not handle negative long as exponent ourselves

Added test cases from pow()

Moved precedence higher than '~'

Added GMP operator overloading

Added ZEND_ASSIGN_POW (**=) operator.

Added pow() as a language construct.

Adjusted test cases for changed precedence.

Reduced pow() to shell function around ZEND_API pow_function()

Reduced test case to only contain edge cases
Added overloading test case

Moved unary minus above T_POW

Revert "Added pow() as a language construct."

Bad bad bad idea.

This reverts commit f60b98cf7a8371233d800a6faa286ddba4432d02.

Reverted unary minus behaviour due to previous revert.
Convert arrays to int(0)
Exponent with array as a base becomes int(0)

Rebase against master

Fixed tokenizer test case
2014-02-06 14:41:21 +01:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Nikita Popov
96b1c2145c Provide more macros for handling of interned strings
* str_erealloc behaves like erealloc for normal strings, but will
   use emalloc+memcpy for interned strings.
 * str_estrndup behaves like estrndup for normal strings, but will
   not copy interned strings.
 * str_strndup behaves like zend_strndup for normal strings, but
   will not copy interned strings.
 * str_efree_rel behaves like efree_rel for normal strings, but
   will not free interned strings.
 * str_hash will return INTERNED_HASH for interned strings and
   compute it using zend_hash_func for normal strings.
2013-09-13 19:42:10 +02:00
Xinchen Hui
72f80b2997 Merge branch 'PHP-5.5' 2013-08-27 15:45:27 +08:00
Xinchen Hui
0119bbba6b Fixed compiler warnings
warning: 'local_dval' may be used uninitialized in this function
[-Wmaybe-uninitialized]

warning: 'dval2' may be used uninitialized in this function
[-Wmaybe-uninitialized]
2013-08-27 15:44:30 +08:00
Nikita Popov
3823321c5c Implement internal operator overloading
As pre RFC https://wiki.php.net/rfc/operator_overloading_gmp
2013-06-17 17:48:13 +02:00
Stanislav Malyshev
02e4d7a290 Merge branch 'pull-request/341'
* pull-request/341: (23 commits)
  typofixes
2013-06-10 14:30:59 -07:00
Adam Harvey
be1700d467 Fix compile failure introduced by the fix for bug #46408. 2013-01-15 10:08:26 +08:00
Lars Strojny
92965b033a Bug #46408: Fix double formatting for PostgreSQL bound parameters 2013-01-14 21:23:52 +01:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Xinchen Hui
b5d2c3174f Merge branch 'PHP-5.4' 2012-08-31 11:25:21 +08:00
Xinchen Hui
66fad45724 Merge branch 'PHP-5.3' into PHP-5.4 2012-08-31 11:24:10 +08:00
Xinchen Hui
5dc2cef370 Fixed bug #62976 (Notice: could not be converted to int when comparing some builtin classes) 2012-08-31 11:22:43 +08:00
Stanislav Malyshev
efdb7ce4b0 improve code in zend_operators 2012-07-14 21:06:40 -07:00
Stanislav Malyshev
582514d4c7 fix for bug#18556 - use simple tolower() function for internal things 2012-07-14 14:50:50 -07:00
Felipe Pena
60c5f9910f Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  - Optimize comparison between same HashTable pointer
  - Fixed bug #62205 (php-fpm segfaults (null passed to strstr))
  - fix missing include for unix sockets
  - Comment unused function to avoid warnings
2012-06-03 18:20:26 -03:00
Felipe Pena
d57b278ad1 - Optimize comparison between same HashTable pointer 2012-06-03 18:16:57 -03:00
Gustavo André dos Santos Lopes
acd711685a Fixed bug #62097
This fixes the fix for bug #54547 in 32-bit machines by accepting
float comparisons in 32-bit machines as long as the integer is
not larger than the mantissa.
2012-05-23 18:55:36 -05:00
Stanislav Malyshev
9344bf193c fix bug #54547 2012-05-13 14:40:44 -07:00
Felipe Pena
e4ca0ed09f - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
895a10caf1 - Fixed ZTS build 2011-08-30 01:33:42 +00:00
Derick Rethans
56a87c2806 - Zend engine part for bug #55158: Add SORT_NATURAL type to array_multisort
(patch by Arpad Ray).
2011-08-29 20:24:09 +00:00
Dmitry Stogov
c270347c0b MFH: Arithmetic speedup. Inlined most probable code-paths for arithmetic operations directly into executor. 2011-05-31 12:05:25 +00:00
Felipe Pena
927bf09c29 - Year++ 2011-01-01 02:19:59 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Scott MacVicar
1e48c71b96 Fix a bug where two doubles are equal but the maths operation makes it appear false.
Best example with INF where equals and identical produce different results.

<?php
var_dump(INF==INF);
var_dump(INF===INF);
2010-08-22 08:01:34 +00:00
Felipe Pena
87c87daaf3 - Fixed bug #52193 (converting closure to array yields empty array) 2010-06-26 17:14:33 +00:00
Felipe Pena
9ea7a70e24 - Fixed bug #52193 (converting closure to array yields empty array) 2010-06-26 17:14:33 +00:00
Dmitry Stogov
f94a437d9d Fixed a possible information leak because of interruption of XOR operator 2010-05-12 11:10:06 +00:00
Dmitry Stogov
4ae16d351c Fixed a possible information leak because of interruption of XOR operator 2010-05-12 11:10:06 +00:00
Dmitry Stogov
dd5c478be6 Added concept of interned strings. All strings constants known at compile time are allocated in a single copy and never changed. 2010-04-20 11:05:54 +00:00
Sebastian Bergmann
d2281d1dff sed -i "s#1998-2009#1998-2010#g" **/*.c **/*.h **/*.php 2010-01-05 20:46:53 +00:00
Ilia Alshanetsky
0ebe3a7690 Extend the previously added large string concatenation validation 2009-11-23 04:12:36 +00:00
Ilia Alshanetsky
63e4efe784 Fixed bug #50207 (segmentation fault when concatenating very large strings
on 64bit linux).
2009-11-19 14:04:34 +00:00
Matt Wilmas
b907aa4331 MFH:
Restored double->long conversion behavior to that of PHP 5.2 (on most platforms) and prior:
 * Out-of-range numbers overflow/preserve least significant bits (no LONG_MAX/MIN limit)
 * See bug #42868 (presumably-rare platform with different results in 5.2)
 * On 32-bit platforms with 64-bit long type, a zend_long64 cast has been added,
    otherwise it's the same as 5.2
 * Use this conversion method everywhere instead of some plain (long) casts

Added 'L' parameter parsing specifier to ensure a LONG_MAX/MIN limit:
 * Essentially what 5.3's new conversion was doing in most cases
 * Functions with "limit" or "length" type params could be updated to use this,
    and prevent confusing overflow behavior with huge numbers (*also* in 5.2)
  - See bug #47854, for example; or even #42868 again

# Test updates coming
2009-06-04 18:20:45 +00:00
Jani Taskinen
2a31dbbadf MFH:- Removed unnecessary TSRMLS_FETCH() calls 2009-05-11 08:31:15 +00:00
Jani Taskinen
daae8fb6fc MFH: cs + ws 2009-05-11 07:52:49 +00:00
Jani Taskinen
f3bd837434 MFH: sync 2009-05-10 23:08:52 +00:00
Jani Taskinen
1338aa26be sync with HEAD 2009-05-10 22:39:33 +00:00
Dmitry Stogov
69ce7ea442 optimization 2009-03-18 11:25:37 +00:00
Dmitry Stogov
31c0af245e Fixed floating point mathematic speed degradation (Christian) 2009-03-18 10:18:10 +00:00
Matt Wilmas
645e15c2ea MFH: Overflow comment 2009-02-17 15:15:18 +00:00
Matt Wilmas
a7eb83fef5 MFH: Fixed bug #47422 (modulus operator returns incorrect results on 64 bit linux) 2009-02-17 14:15:52 +00:00
Felipe Pena
f8689552a4 MFH:
- Fixed bug #46701 (Creating associative array with long values in the key fails on 32bit linux)
Patch by Shire
2009-01-05 20:31:54 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Christian Seiler
04c528609a - MFH: Changed floating point behaviour to consistently use double precision
on all platforms and with all compilers.
2008-12-02 16:19:10 +00:00
Felipe Pena
85ab423565 - MFH: Removed some TSRMLS_FETCH()s 2008-08-15 19:47:33 +00:00
Felipe Pena
cf7384aa40 - MFH: Constness (Added const qualifier to several function parameters) 2008-08-12 17:20:25 +00:00
Antony Dovgal
53a957e5f8 MFH: fix bug #45712 ($something == NaN returns true with 5.3, false with 5.2.*) 2008-08-07 08:36:24 +00:00
Moriyoshi Koizumi
023211d8d2 - MFH: Constify read-only arguments 2008-07-24 20:39:48 +00:00
Matt Wilmas
87dca00a8e MFH: Fixed overflow crash (at least on Windows) in div_function with LONG_MIN / -1 2008-05-29 11:45:13 +00:00
Antony Dovgal
7b1bc753c6 MFH: add zend_atol() 2008-03-19 12:41:23 +00:00
Felipe Pena
2b10c53ae1 MFH: Dropped zend.ze1_compatibility_mode
[DOC]
2008-03-18 14:10:45 +00:00
Dmitry Stogov
71592cec06 Added garbage collector 2008-01-22 09:27:48 +00:00
Dmitry Stogov
7390459e26 Yet another comparison optimisation for usual cases 2008-01-21 19:10:25 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Dmitry Stogov
ed5a424b4f Additional fix for bug #42868 2007-12-24 18:09:50 +00:00
Dmitry Stogov
2b981769a3 Fixed bug #42868 (Floats cast to integer produce unpredicatable results). (Zoe Slattery) 2007-12-17 10:02:13 +00:00
Dmitry Stogov
6a5a172795 MFH: math and comparison optimization + use macroses 2007-11-20 13:26:36 +00:00
Dmitry Stogov
19bf724c48 optimization 2007-10-29 14:36:55 +00:00
Yiduo (David) Wang
4b4d634cb9 MFH: Added macros for managing zval refcounts and is_ref statuses 2007-10-07 05:22:07 +00:00
Jani Taskinen
226c56fe76 MFH: Fixed compiler warnings 2007-07-21 00:35:15 +00:00
Antony Dovgal
e029945a02 MFH: minor optimization - make sure the objects are not the same instance before we start comparing their properties 2007-06-06 11:57:36 +00:00
Dmitry Stogov
b1aea75ac1 WIN64 support 2007-04-23 09:56:30 +00:00
Marcus Boerger
50ea26760d - Avoid sprintf, even when checked copy'n'paste or changes lead to errors 2007-02-24 02:17:47 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Ilia Alshanetsky
6895045565 Simplify & optimize code
# Patch by Matt Wilmas
2006-12-30 01:57:01 +00:00
Ilia Alshanetsky
ff9d0fcc78 is_numeric_string() optimization
# Original Patch by Matt Wilmas
2006-12-26 16:44:20 +00:00
Ilia Alshanetsky
dba3fe385d Fixed possible memory leak 2006-12-21 01:57:05 +00:00
Ilia Alshanetsky
5218d956f0 Fixed typo 2006-12-11 15:59:41 +00:00
Ilia Alshanetsky
19e4dc5058 Removed bool<>long optimization as it causes issues with strict type checks 2006-12-11 15:34:35 +00:00
Ilia Alshanetsky
7e1973d9fc Minor optimization (2-3%) from Brian Shire 2006-12-11 15:16:07 +00:00
Stanislav Malyshev
6b651f8e60 Improve tolower()-related functions on Windows and VC2005 by caching locale and using
tolower_l function.
# Gives 10-18% speedup on bench.php
# Does not change behaviour for non-windows
2006-12-04 18:37:15 +00:00
Antony Dovgal
9d6f7755b8 fix leak appearing when converting object to NULL
add test
2006-11-15 17:29:08 +00:00
Antony Dovgal
8e1c9371bb MFH: throw a warning when doing modulus by 0 (fr #39027) 2006-10-03 17:54:51 +00:00
Antony Dovgal
47600225e1 MFH: use if() instead of ?: 2006-09-27 15:40:19 +00:00
Dmitry Stogov
29ed52ffa4 New memory manager 2006-07-18 09:06:33 +00:00
Antony Dovgal
7f9a43653c fix logic 2006-07-18 09:00:10 +00:00
Antony Dovgal
7a089a43af MFH: fix DVAL_TO_LVAL() on AIX with old gcc 2006-07-18 08:17:28 +00:00
Marcus Boerger
c514ee0c9b - MFH Fix issue with comparing objects with objects 2006-07-09 18:03:42 +00:00
Marcus Boerger
fa57959f47 - MFH:
. Fix comparision edgecases involving objects (Tony, Marcus)
  . Use ZVAL_LONG() where appropriate
2006-07-09 16:58:05 +00:00
Zeev Suraski
51d495850a Restore ZE1 compatibility mode (Zend Engine part - the modules patches
will follow later today)
2006-06-05 13:58:52 +00:00
Antony Dovgal
9dd24c6d87 fix error messages when converting objects to other types
add new function
MFB will follow soon
2006-05-25 10:01:06 +00:00
Marcus Boerger
637a40423c - MFH as discussed
. zend_exception_get_default() -> zend_exception_get_default(TSRMLS_D)
  . zend_get_error_exception()   -> zend_get_error_exception(TSRMLS_D)
  . added E_RECOVERABLE_ERROR
  . added ZEND_TOSTRING_FUNC_NAME
  . added __tostring function cache to zend_class_entry
  . added ZEND_NAMED_ME
  . modified ZEND_ME_MAPPING to support method flags
  . added ZEND_MN
  . method entries now use prefix "zim_" instead of "zif_"
  . drop EG(ze1_compatibility_mode)
  . changed cast handler, now without (int should_free):
    typedef int (*zend_object_cast_t)(zval *readobj, zval *retval, int type TSRMLS_DC);
  . changed get_iterator, now receives whether value is by ref:
    zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
  . added zend_objects_store_add_ref_by_handle
  . added zend_objects_store_del_ref_by_handle
  . convert_to_explicit_type(pzv, type)
2006-05-09 23:53:23 +00:00
Marcus Boerger
647eafcb5d - MFH 2006-02-05 17:07:40 +00:00
Andi Gutmans
61e93ccfe8 - Update copyright notices to 2006 2006-01-04 23:53:05 +00:00
Marcus Boerger
882a9effe6 - Enforce termination to prevent possible SEGVs 2005-12-12 19:10:12 +00:00
Dmitry Stogov
9d1f2f30d3 Fixed bug #34199 (if($obj)/if(!$obj) inconsistency) 2005-09-12 11:48:57 +00:00
Dmitry Stogov
c10d6d3c89 Fixed bug #33999 (object remains object when cast to int) 2005-08-05 09:02:14 +00:00
foobar
916815b779 Bump up the year 2005-08-03 13:30:58 +00:00
Dmitry Stogov
747074f988 Reverted wrong fix for bug #30572.
Seems the bug was already fixed in other way.
But reverted patch produced a lot of valgrind errors, because IS_TMP_VAR operands don't initialize refcount.
2005-05-31 11:16:51 +00:00
Marcus Boerger
d100328de8 - Fix memory corruption found by rob 2005-04-08 14:33:00 +00:00
Derick Rethans
d91a531d2e - Added "G" modifier to ini setting number format. 2004-12-13 09:09:06 +00:00
Derick Rethans
ebca90f075 - MFH: Revert Joe's work around a bug in GCC patch as it breaks too many things. 2004-11-29 09:32:15 +00:00
Derick Rethans
e612284ea4 - Fixed bug #30630: Added a BSD based strtod function that is
locale-independent.
2004-11-03 23:13:32 +00:00
Andi Gutmans
b86cdbbddb - For Ilia:
- MFH: Fixed bug #30572 (crash when comparing SimpleXML attribute to a boolean).
- Hope this works well. I will MFH tomorrow if no one complains.
2004-10-29 00:55:11 +00:00
Andi Gutmans
a4dff681c8 - Revert Fixed bug #30228 (crash when comparing SimpleXML attribute to a boolean).
- Need to discuss where the real problem is.
2004-10-27 18:15:03 +00:00
Ilia Alshanetsky
bb928e70a7 Fixed bug #30228 (crash when comparing SimpleXML attribute to a boolean). 2004-10-26 22:38:34 +00:00
Andi Gutmans
abd42847b1 - If object handles are equal then save the comparison of properties in
- the == operator.
2004-10-20 17:57:28 +00:00
Andi Gutmans
1a4bfd6561 - Small improvement to DVAL_TO_ZVAL macro 2004-09-30 18:36:03 +00:00
Derick Rethans
4bae5cb4d0 - MFB: Added the sorting flag SORT_LOCALE_STRING to the sort() functions which
makes them sort based on the current locale. (Derick)
2004-09-11 14:22:35 +00:00
Andi Gutmans
3e201ac281 - Resolve undefined behavior (joe at redhat) 2004-09-11 00:23:20 +00:00
Andi Gutmans
56f8195fe5 - Nuke empty_string. It is a reminanent from the time where RETURN_FALSE()
used to return "" and not bool(false). It's not worth keeping it because
  STR_FREE() and zval_dtor() always have to check for it and it slows down
  the general case. In addition, it seems that empty_string has been abused
  quite a lot, and was used not only for setting zval's but generally in
  PHP code instead of "", which wasn't the intention. Last but not least,
  nuking empty_string should improve stability as I doubt every place
  correctly checked if they are not mistakenly erealloc()'ing it or
  calling efree() on it.
  NOTE: Some code is probably broken. Each extension maintainer should
  check and see that my changes are OK. Also, I haven't had time to touch
  PECL yet. Will try and do it tomorrow.
2004-07-19 07:19:50 +00:00
Zeev Suraski
428e722d88 - Fix comparison of objects
- Clarify convert_object_to_type()
2004-05-10 14:56:21 +00:00
Andi Gutmans
3317070941 - Fix comparison of two objects in non-compatibility mode. 2004-05-02 15:40:46 +00:00
Andi Gutmans
911922432f - Nuke more old junk 2004-04-03 17:01:13 +00:00
Andi Gutmans
1c7cfe739d - Nuke code which hasn't been in use for ages. 2004-04-03 11:09:39 +00:00
Stanislav Malyshev
9091bf8e5f centralize object-to-scalar conversion, make it work with get handler 2004-03-28 12:08:26 +00:00
Stanislav Malyshev
c331afa267 Use macros for object parts access 2004-03-28 10:44:48 +00:00
Derick Rethans
9ff10d086a - Revert bogus commit 2004-03-24 14:28:41 +00:00
Derick Rethans
2face60bef - Fixed NEWS
#- Can we *please* keep this in order?
2004-03-24 13:31:20 +00:00
Andi Gutmans
29ee03aa55 - Apply Ard's patch to support multiplication & overflow on both 32bit
and 64bit machines
2004-03-17 09:25:52 +00:00
Andi Gutmans
dae7093d93 - Restore E_NOTICE for longs and doubles. 2004-03-15 16:55:20 +00:00
Andi Gutmans
14d711b9bb - Nuke E_NOTICE. This caused a notice when doing if ($obj == NULL) 2004-03-15 14:15:47 +00:00
Andi Gutmans
f11c819ddb - Improve compatibility mode and compare objects according to property
- comparison (sucky but this is how PHP 4 behaved).
2004-03-14 15:56:03 +00:00
Andi Gutmans
515e28ed5b - Support old style of converting objects to long/double/bool.
- This is only enabled in compatibility mode, else it calls cast_object()
- and if that is not available we return 1 (true) so that the following
- code would work:
if ($obj) {
}
2004-03-14 15:45:09 +00:00
Marcus Boerger
2917102e3f Fix: Add return type void 2004-03-14 15:27:56 +00:00
Andi Gutmans
88de69b97c - Support Cast operator in convert_to_* so that we support internal
- extensions such as SimpleXML. This is for Sterling.
2004-03-14 13:52:36 +00:00
Andi Gutmans
4f897b2f3c - Fix memory leak in the following code (Dmitry):
<?php
$a = array();
$a .= "x";
?>
2004-03-14 13:14:48 +00:00
Andi Gutmans
52cd980702 - Initial commit which allows comparing overloaded objects with native
- types (only for internal classes and not for user-land classes).
2004-03-14 12:44:28 +00:00
Derick Rethans
e2c9926923 - Fixed bug #27354 (Modulus operator crashes PHP). 2004-02-22 20:02:26 +00:00
Zeev Suraski
f5e9ca64b1 Remove conflict 2004-01-10 12:48:04 +00:00
Zeev Suraski
a72c1ab93b Added error mask to set_error_handler()
Patch by Christian Schneider <cschneid@cschneid.com>
2004-01-10 11:43:42 +00:00
foobar
ccfc46b0aa - Happy new year and PHP 5 for rest of the files too..
# Should the LICENSE and Zend/LICENSE dates be updated too?
2004-01-08 17:33:29 +00:00
Moriyoshi Koizumi
033bc12d86 Fixes for POSIX compliancy. 2003-12-13 19:28:30 +00:00
foobar
a08c1e4dce - Brought ext/bcmath to the new millennium
# consistency..
2003-12-09 23:59:33 +00:00
Andi Gutmans
23b231d0eb - Revert the revert of these patches. This overloading can only be used
- by C extensions such as SimpleXML and *NOT* PHP code. Reasons given
- on the mailing list and problem with reentrancy inside the opcodes.
2003-12-02 21:09:24 +00:00
Andi Gutmans
a411d608fa - Don't automatically call __toString() in convert_to_string_ex().
- use __toString() in your code.
- Keep the auto-case in make_printable_zval.
2003-12-01 11:47:52 +00:00
Marcus Boerger
4dba05d9cc Add new interface ArrayAccess to use objects as Arrays 2003-11-24 20:57:54 +00:00
Moriyoshi Koizumi
138b1c7be3 Bugfix #26156 (REPLACE_ZVAL_VALUE works on uninit stack-based zvals) 2003-11-13 20:53:55 +00:00
Marcus Boerger
316854323d Handle exceptions in casting more gracefully.
This fixes bug #26166
2003-11-08 14:06:08 +00:00
Ilia Alshanetsky
c258f9c8a2 Fixed bug #26148 (Print the notice before modifying variable on type
mismatch).

# This only crashes in ZE1, however logic dictates that it may also crash
# in ZE2 because variable does not have a correct type.

Patch by: morten-bugs dot php dot net at afdelingp dot dk
2003-11-06 20:33:47 +00:00
Marcus Boerger
71ba442768 Fallback to default behaviour for unsupported object type conversions 2003-09-18 11:50:05 +00:00
Marcus Boerger
d7fdf15a41 - Allow partial type conversion support for objects.
- Add support for object to string conversion from userspace by method
  __toString() and add a test.
2003-09-18 11:38:33 +00:00
Zeev Suraski
36133c4d0b Simplify / fix 2003-09-15 08:13:34 +00:00
Zeev Suraski
e0508c13bb Commit 64-bit fixes to the standard operators
by Ard Biesheuvel (abies@php.net)
2003-09-14 17:37:01 +00:00
Marcus Boerger
744dd20520 Fix warnings 2003-08-17 19:14:30 +00:00
Zeev Suraski
cf90932a05 Improve infrastructure of numeric handling of elements in symbol tables.
When you want to work with a symbol table, and you don't know whether you
have a numeric ("string that looks like a number") or a string element in
your hands, use zend_symtable_*() functions, in place of zend_hash_*()
functions.
2003-07-22 16:06:07 +00:00
Sterling Hughes
dae3fefd10 revert back the optimization for now. 2003-06-30 01:41:15 +00:00
Sterling Hughes
f605f0b708 Very simple, but very effective optimization. Provides a signifigant speed
improvement to matches done via '=='.  This checks that the lengths of two
strings are equal before performing a memcmp() on them.
2003-06-29 01:49:10 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Marcus Boerger
472cc5b9f3 Faster interface inheritance & faster inheritance checks 2003-05-29 19:00:40 +00:00
Sterling Hughes
ae2bfb7880 Assume lazy consensus regarding the cast_object() patch. *Only* implemented
from a internals perspective.  This callback has been very useful for both
ext/mono and ext/simplexml
2003-05-27 18:52:25 +00:00
Sterling Hughes
ae9106521a move HANDLE_NUMERIC() from the hash table implementation upstream to the
places that actually need to use it.
2003-05-23 15:11:15 +00:00
Marcus Boerger
402f5f7a0d Use same parameter order as strcpy() 2003-05-21 22:36:09 +00:00
Marcus Boerger
7af8eadd57 Make zend_str_tolower_copy() a copy function (like stccpy).
Supply a dup version (like estrdup).
Fix tolower() handling.
# Havin copy and dup allows to use the faster version even with
# memory not allocated by emalloc.
2003-05-21 21:59:40 +00:00
Sterling Hughes
5619166fe4 optimize loops. The check only exists for integers because that's the more
common optimization, and you actually lose performance if you check for
a double too (wierd but true).
2003-05-21 18:46:34 +00:00
Sterling Hughes
34087ad2b5 bah humbug, use the pointer based version, which turns out to be an instruction
faster
2003-05-20 22:31:15 +00:00
Sterling Hughes
7c7d14a413 use pointer arithmetic for the normal zend_str_tolower() 2003-05-20 20:39:58 +00:00
Sterling Hughes
3079bb1bda make this faster and sexier 2003-05-20 19:09:33 +00:00
Sterling Hughes
a4fb3300b3 doesn't need to be register 2003-05-20 18:42:09 +00:00
Sterling Hughes
ca6ca5e2a6 optimize the lookups by avoiding a copy and then another pass
Naked Dancing Girls should be given to: Myself, Zeev, Marcus,
and George Schlossnagle (in no particular order)
2003-05-20 18:28:14 +00:00
Zeev Suraski
26dd8492ed Add support for interfaces 2003-03-05 11:14:44 +00:00
foobar
333406bdc2 - Added some missing CVS $Id$ tags, headers and footers. 2003-02-01 01:49:15 +00:00
Ilia Alshanetsky
7a3c54fc36 Fixed compiler warning regarding signed/unsigned int comparisons. 2003-01-30 23:36:08 +00:00
Andi Gutmans
c073b76aac - Change "is" to "instanceof" as it explains better what the operator means.
- "is_a" was also appropriate but ugly.
2003-01-14 21:29:23 +00:00
Sebastian Bergmann
2c5d4b8c23 Bump year. 2002-12-31 15:59:15 +00:00
Andi Gutmans
671fff2fde h WHitespace 2002-11-30 11:20:25 +00:00
Ilia Alshanetsky
a8f8d9d586 Silence compile warning, ctype.h is needed for tolower() function. 2002-11-04 17:05:11 +00:00
Ilia Alshanetsky
e842ef9f4b MFZE1 (floats & locale issue) 2002-10-12 21:15:35 +00:00
Ilia Alshanetsky
d3617c51b8 MFZE1 zend_str_tolower issue. 2002-10-09 14:21:40 +00:00
Ilia Alshanetsky
ee7b8f906d MFZE1 2002-09-26 18:56:11 +00:00
Andi Gutmans
43139dc755 - WS - Always use "if (" and not "if(" 2002-09-15 07:45:26 +00:00
Stanislav Malyshev
73cf316a53 MFZE1 2002-09-01 08:30:39 +00:00
Zeev Suraski
91f585744f MFZE1 2002-08-19 20:58:22 +00:00
Andi Gutmans
52406cb37c - Make new 'is' operator work with classes only and return false when
- the object isn't of the said class or the value isn't an object.
2002-08-08 16:32:34 +00:00
Harald Radi
99c90db11a make win32 debug output more verbose 2002-08-07 14:47:42 +00:00
Andrei Zmievski
82c72f2799 @- Adding 'is' operator that can be used to check the type of a variable,
@  or its class. (Andrei)
2002-07-30 04:07:15 +00:00
Derick Rethans
c652c4b512 - MFH of the crap removal 2002-07-15 18:11:04 +00:00
Andi Gutmans
f7d9b9f1ae - Really implement bool increment/decrement as flip-flop. 2002-07-15 04:11:13 +00:00
Derick Rethans
207845410b MFZE1 2002-07-14 11:48:45 +00:00
Derick Rethans
dcd67e0b14 - MFZE1 2002-07-14 09:37:42 +00:00
Derick Rethans
643f21e840 - MFZE1 2002-07-14 09:29:42 +00:00
Andi Gutmans
6339bd5912 - Fix bug 15037
- Bump version to alpha2-dev
2002-06-29 07:35:41 +00:00
Andi Gutmans
1f6cadcd28 - WS fix 2002-06-28 15:30:03 +00:00
Harald Radi
51e797f1e3 some type cleanup work 2002-04-23 18:06:54 +00:00
Andi Gutmans
fb6976e46d - Another couple of indirection fixes.
- Make class_entry->refcount be part of the structure and not allocated.
2002-03-12 19:22:29 +00:00
Stanislav Malyshev
6608f07322 Mega-commit: Enter the new object model
Note: only standard Zend objects are working now. This is definitely going to
break custom objects like COM, Java, etc. - this will be fixed later.
Also, this may break other things that access objects' internals directly.
2002-02-07 14:08:43 +00:00
Sebastian Bergmann
62dc854bb0 Happy New Year. 2002-01-06 15:21:36 +00:00
Sebastian Bergmann
d863d52a5d Update headers. 2001-12-11 15:16:21 +00:00
Stanislav Malyshev
d082fb373d MFZE1 2001-09-05 09:29:28 +00:00
Andi Gutmans
b0970f1421 - MFZE1 2001-08-26 15:16:06 +00:00
Andi Gutmans
ea48c0c46a - Fix a bug in method calls.
- Try to get the old copying behavior of objects to work (doesn't work yet).
2001-08-16 14:04:04 +00:00
Zeev Suraski
8722b31d8a MFZE1 2001-08-13 00:28:18 +00:00
Andi Gutmans
76a7a5bc18 - More work on making objects work 2001-08-11 18:26:47 +00:00
Andi Gutmans
532677e7ac - Fix some places which create objects. The fixes are ugly and will be
revised when things start working well
2001-08-11 18:04:07 +00:00
Zeev Suraski
adf89828d2 Whitespace 2001-08-11 15:44:24 +00:00
Zeev Suraski
8ce8324e59 More TSRMLS_FETCH annihilation 2001-07-30 04:54:16 +00:00
Andi Gutmans
cf510cb7fd - Fix build 2001-07-28 20:28:29 +00:00
Andi Gutmans
ff61394786 - More object macros. 2001-07-28 20:27:32 +00:00
Zeev Suraski
2c254ba762 Get rid of ELS_*(), and use TSRMLS_*() instead.
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:10:39 +00:00
Stanislav Malyshev
db97aea8d9 fix double->long conversion 2001-07-18 16:46:51 +00:00
Zeev Suraski
4cc86259dd Get rid of ZVAL_RESET... 2001-07-11 11:35:11 +00:00
Zeev Suraski
ed542331b7 Get rid of some inlines 2001-07-11 09:33:41 +00:00
Andi Gutmans
af089a2938 - Remove bogus comment. 2001-06-29 20:42:02 +00:00
Zeev Suraski
5e99993058 Fixed autoconversion of negative values to double (Fix bug #11685) 2001-06-26 21:11:35 +00:00
Zeev Suraski
429667883e Treat numeric strings as numbers in the increment operator 2001-05-10 12:58:31 +00:00
Andi Gutmans
27fd3a2e57 - Previous patch for too early freeing of resources seemed to have worked.
- Clean it up a bit.
2001-04-29 09:21:38 +00:00
Andi Gutmans
b11202d66b - Try and solve the too early resource destruction problem. 2001-04-29 06:33:50 +00:00
Zeev Suraski
4e71bbed0a include limits.h if available 2001-04-28 20:21:42 +00:00
Andi Gutmans
26c06df321 - Move all cases into switch(). 2001-04-28 18:20:46 +00:00
Zeev Suraski
882751dd7d Resources weren't being properly destroyed by the convert_to_*() functions 2001-04-28 02:06:35 +00:00
Andi Gutmans
acd56b0891 - More whitespace fixes while I'm at it. 2001-04-27 18:53:25 +00:00
Andi Gutmans
d2c9e8074c - Update copyright year 2001-02-26 05:43:27 +00:00
Andi Gutmans
4afacc0a7c - Remove two unused functions 2001-02-12 15:49:24 +00:00
Stanislav Malyshev
138ea941fa Add notice when auto-converting array to string 2000-12-18 08:47:17 +00:00
Stanislav Malyshev
98f2db94ec Fix #8279 (-2147483647 > 2147483647).
# Long addition/subtraction may not fit long.
2000-12-17 16:02:59 +00:00
Stanislav Malyshev
868c8769f8 Fix #8195: strncasecmp returns incorrect value 2000-12-12 09:47:30 +00:00
Zeev Suraski
f8dabac6d5 Fix build 2000-11-21 22:41:49 +00:00
Zeev Suraski
1fd09132c2 Initial steps to move the INI mechanism to the Zend engine 2000-10-29 11:38:26 +00:00
Andi Gutmans
bc37c9b1cd - Make increment of "" become "1" 2000-10-13 16:24:00 +00:00
Andi Gutmans
715774bed7 - Commiting Sterling's new multi_convert* functions 2000-09-05 17:55:57 +00:00
Stanislav Malyshev
1373a16280 Add strncasecmp function
@ Added strncasecmp function (Andi)
2000-07-26 11:32:15 +00:00
Sascha Schumann
7565347ba0 Move some stuff to zend_operators.h which is required by the
moved inline functions.
2000-06-14 19:55:32 +00:00
Sascha Schumann
df74f1dfab Add optional support for C0x inline semantics.
These are enabled by specifying `--enable-c0x-inline' on the command
line. We might add an autoconf check for this particular feature
later.
2000-06-13 17:58:33 +00:00
Andi Gutmans
390dccacac - Fixed problem when using uninitialized values in comparisons with strings.
-  They behave as empty strings again just like in PHP 3.
2000-06-10 14:39:06 +00:00
Sascha Schumann
039551788b Add a couple of casts 2000-06-08 06:07:38 +00:00
Zeev Suraski
bfac4633a5 - Support unordered hash comparisons
- Make == perform an unordered comparison with arrays/objects, and === perform an ordered comparison
2000-06-04 21:59:49 +00:00
Zeev Suraski
dae76aa1b5 Support comparisons of arrays (with arrays) and objects (with objects) 2000-06-03 10:34:19 +00:00
Zeev Suraski
d4b160c0d6 - Export normalize_bool
- This global/static syntax fix brought us back to the 4 documented conflicts
2000-06-03 03:05:01 +00:00
Andi Gutmans
015884dda5 - Use pointer arithmetic to speed up the function a bit 2000-05-28 18:59:40 +00:00
Andi Gutmans
b5447a4d7a - Fixed scanning decimal numbers in internationalized environments. They should
- always be in standard US format e.g. 23.3
2000-05-26 07:49:56 +00:00
Andi Gutmans
715ff77344 - Fix include() when used on resources (shouldn't work but shouldn't crash
either).
2000-05-18 10:21:24 +00:00
Andrei Zmievski
3df1e68fe9 Update for sort functions - user can now specify sort type. 2000-05-18 01:53:41 +00:00
Andi Gutmans
0aefa3e037 - Add support for string_compare_function() and number_compare_function().
UNTESTED!
2000-05-17 18:55:22 +00:00
Zeev Suraski
760a17729e Normalize results of compare_function() 2000-05-17 17:08:25 +00:00
Zeev Suraski
0d6a794d85 Get rid of chval - it's really not necessary and seems to be confusing people 2000-05-11 19:18:11 +00:00
Zeev Suraski
19de3be052 Make zend_binary_strcasecmp compile again 2000-05-08 10:24:26 +00:00
Sascha Schumann
36c1a9a39d Make strcasecmp() act correctly WRT SUS II.
Patch by: hholzgra@php.net
PR: #3556
2000-05-08 10:05:19 +00:00
Zeev Suraski
ddc36fb776 Make convert_to_string() allocations traceable 2000-04-28 13:31:51 +00:00
Andrei Zmievski
bbe0df125e Do proper ieeefp.h check. 2000-04-20 13:49:07 +00:00
Thies C. Arntzen
c1c8422dbf compile before commit! compile before commit! compile before commit! 2000-04-20 07:24:56 +00:00
Thies C. Arntzen
2b3a575ab3 revert andrei's path (i can't compile anymore on linux)
we're always using #ifndef HAVE_BLA instead of if !HAVE_BLA and if we need ieeefp.h for some weird platform (which one is that?) we need an autoconf check for it.
2000-04-20 07:23:55 +00:00
Andrei Zmievski
fe1147b01a Include proper files for finite. 2000-04-19 15:55:52 +00:00
Thies C. Arntzen
44e0d27685 ups, finite is already a macro on Win32 2000-04-17 13:25:16 +00:00
Thies C. Arntzen
8367275477 HPUX11 only has isfinite() 2000-04-17 10:39:13 +00:00