Commit Graph

462 Commits

Author SHA1 Message Date
Marcus Boerger
44b0637bcd - Deprecation severity shall be E_STRICT (as commented by ilia)
# Actually this conforms with other messages
2006-02-25 17:43:12 +00:00
Dmitry Stogov
19ebeed0d8 Unicode support: fixed call_user_func(array($this, "self::foo"))
Made check for "self/parent" before calling __autoload()
2006-02-22 08:54:02 +00:00
Dmitry Stogov
0f1209ab3d Portable unicode string API:
- use the same type (int) for zval.value.usr.len and zval.value.str.len
  - use union "zstr" as char*/UChar* mixture instead of void*
  - Z_UNISTR() and Z_UNILEN() no longer check for Z_TYPE()
  - nuke int32_t from ZE (not finisned)
2006-02-21 20:12:43 +00:00
Dmitry Stogov
2e5d0a3a9d WS 2006-02-21 08:00:39 +00:00
Marcus Boerger
a27e272670 - Synch zend_call_function() with VM function call helper 2006-02-20 20:03:36 +00:00
Marcus Boerger
3b3e006e33 - Add deprecation flag and message 2006-02-20 20:00:46 +00:00
Dmitry Stogov
b424a32610 Preparation for portable string API (use macroses to access zval). 2006-02-20 19:03:43 +00:00
Marcus Boerger
d73533a9d4 - There is no %v in sprintf 2006-02-18 19:33:26 +00:00
Marcus Boerger
b7d473ac00 - WS 2006-01-22 22:15:55 +00:00
Marcus Boerger
f4a0ce710e - Fix method invocation issues 2006-01-22 18:55:02 +00:00
Antony Dovgal
79bebd9bf8 make sure ce_child is properly initialized 2006-01-18 21:06:18 +00:00
Dmitry Stogov
227295a4f1 Unicode stuff is changed according to decision maden on PDM.
Now IS_BINRAY data type is removed and IS_STRING starts behave as IS_BINARY in unicode mode. IS_STRING is incompatible with IS_UNICODE, so ALL functions should be improved to support unicode mode.
2006-01-17 12:18:53 +00:00
Marcus Boerger
ec20ba1a50 - MFB Second part of is_callable/call_user_func
- Clean a few warnings
2006-01-07 21:29:00 +00:00
Andi Gutmans
5de7cc3194 - Update copyright notices to 2006 2006-01-04 23:54:12 +00:00
Dmitry Stogov
925f3f1880 Fixed bug #35612 (iis6 Access Violation crash). (alacn dot uhahaa at gmail dot com) 2005-12-22 16:46:03 +00:00
Antony Dovgal
3ba24546ed MFB: fix leak appearing when __autoload() throws an exception 2005-12-20 11:25:39 +00:00
Dmitry Stogov
57f7f1952c Fixed bug #35612 (iis6 Access Violation crash) 2005-12-09 18:09:08 +00:00
Dmitry Stogov
7aaff40de5 Fixed bug #35509 (string constant as array key has different behavior inside object) 2005-12-05 08:56:32 +00:00
Dmitry Stogov
a42086c73c Fixed bug #35360 (exceptions in interactive mode (php -a) may cause crash) 2005-11-24 11:32:44 +00:00
Dmitry Stogov
804e3b4f5b Fixed SIGSEGV 2005-10-27 19:25:07 +00:00
Dmitry Stogov
22130a2b74 Fixed bug #34767 (Zend Engine 1 Compatibility not copying objects correctly) 2005-10-20 08:15:13 +00:00
Dmitry Stogov
49c3b14f53 Unicode support for PHP constants 2005-09-08 11:10:34 +00:00
Dmitry Stogov
59d2e3f3aa Fixed bug #34260 (Segfault with callbacks (array_map) + overloading) 2005-09-02 07:46:30 +00:00
Dmitry Stogov
24743055a3 Changed is_a() and is_subcalls_of() functions to not call __autoload() (in the same way as "instanceof" operator). 2005-08-23 07:23:30 +00:00
Dmitry Stogov
6b622046dc zend_is_callable() and zend_make_callable() were changed to return readable function name as zval (instead of string). 2005-08-22 12:22:16 +00:00
Dmitry Stogov
6fad26469c Fixed memory leak 2005-08-22 06:56:26 +00:00
Dmitry Stogov
90393d675f Unicode support 2005-08-19 13:20:16 +00:00
Dmitry Stogov
b0e24970bb Unicode support cleanup 2005-08-19 10:54:26 +00:00
Dmitry Stogov
d90d6c5d2b nstanceof operator shouldn't call __autoload() 2005-08-19 08:11:16 +00:00
Dmitry Stogov
af9ce19ef8 Fixed user function call in unicode mode 2005-08-12 14:58:29 +00:00
Andrei Zmievski
b80cb7bd2f Unicode support 2005-08-11 23:35:03 +00:00
foobar
916815b779 Bump up the year 2005-08-03 13:30:58 +00:00
Dmitry Stogov
650cdaed12 Fixed bug #33942 (the patch to #33156 crash cygwin except cli) 2005-08-02 17:01:17 +00:00
foobar
2a8cd27f4e bug #33865 2005-07-26 18:33:15 +00:00
Marcus Boerger
e11fc8bda4 - Fix error generation logic (found by johannes) 2005-07-21 16:52:32 +00:00
Dmitry Stogov
c25b8a3699 Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF). (Nuno) 2005-07-12 06:52:59 +00:00
Dmitry Stogov
d9c1a380ad Fixed bug #28072 (static array with some constant keys will be incorrectly ordered). 2005-07-07 15:16:57 +00:00
Dmitry Stogov
1d33a3e95e Fixed bug #31158 (array_splice on $GLOBALS crashes) 2005-07-04 10:01:10 +00:00
Dmitry Stogov
12b66c262a Fixed bug #30519 (Interface not existing says Class not found) 2005-06-24 08:45:17 +00:00
Dmitry Stogov
da2ab06111 Fixed bug #29896 (Backtrace argument list out of sync) 2005-06-22 15:26:05 +00:00
Dmitry Stogov
aedbdb087d Allowed return by refrence from internal functions 2005-06-16 14:56:13 +00:00
Dmitry Stogov
59a46c34fa Fixed double call to php_stream_close() on compiler errors 2005-06-09 16:57:43 +00:00
Dmitry Stogov
9affa32237 Fixed bug #30140 (Problem with array in static properties) 2005-06-08 13:21:28 +00:00
Dmitry Stogov
d2018ef2c0 Fixed bug #33116 (crash when assigning class name to global variable in __autoload). 2005-05-26 14:28:24 +00:00
Stanislav Malyshev
ba7123fc9b fix #29890 - crash when function call fails 2005-05-18 18:02:50 +00:00
Marcus Boerger
138c5457ac - Part 2 of #30126: Enhancement for error message for abstract classes 2005-05-02 15:57:35 +00:00
Marcus Boerger
f44dc4c930 - Part 1 of #30126: Enhancement for error message for abstract classes 2005-05-02 15:55:05 +00:00
foobar
fcba5e099c - Fixed bug #28839 (SIGSEGV in interactive mode (php -a))
(kameshj at fastmail dot fm)
2005-03-26 02:43:02 +00:00
Marcus Boerger
32c2e664a6 - Fix all incarnations of bug #30266
# most probably we should emit a fatal error here but that has to be
# discussed first
2005-03-19 14:25:42 +00:00
Marcus Boerger
d8db1c2cc5 - Actually this is a much better error decription 2005-03-13 13:22:02 +00:00
Marcus Boerger
565e832edf - Bugfix #32290 2005-03-13 13:15:08 +00:00
Marcus Boerger
a57b6bad69 - Be more gracious in reflection API 2005-02-13 23:04:49 +00:00
Marcus Boerger
6159f69023 - Bugfix #30682 (autoconversion from false/true to 0/1 missing in case of
static property default value)
2005-02-12 16:38:47 +00:00
Stanislav Malyshev
3925337a55 Fix #31720 Invalid object callbacks not caught in array_walk() (patch from Antony Dovgal) 2005-02-02 10:36:02 +00:00
Marcus Boerger
0236e31313 - Fix severity (found by johannes) 2005-01-28 20:24:20 +00:00
Stanislav Malyshev
e9003696bd fix crash 2004-11-17 12:06:27 +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
Marcus Boerger
c5a9a5a284 - Change zend_object_handlers->get_method() to allow aggregation for internal classes 2004-10-30 19:11:37 +00:00
Dmitry Stogov
3f35c6a6cc Added test cases for CV optimization patch 2004-10-05 06:53:39 +00:00
Andi Gutmans
11bcaedfc8 - Rename delete_global_variable() to zend_delete_global_variable() 2004-10-04 20:17:06 +00:00
Andi Gutmans
db507dd153 - Commit the variable fetch optimization.
- Extensions which delete global variables need to use new special function
- delete_global_variable() (I'm about to rename it) to remove them.
- Will post to internals@ or via commit messages if there's anything else.
2004-10-04 19:54:35 +00:00
Andi Gutmans
3e2b49ab5b - Return the warning until we check if we can change the type of str.len 2004-09-28 19:46:57 +00:00
Marcus Boerger
16c1f0ae74 - Fix warning
# What's the reason _zvalue_value.str.len is int instead of uint/zend_uint?
2004-09-27 08:50:41 +00:00
Andi Gutmans
f82ed13625 - Commit new VM architecture. This one allows people (aka Derick) to
- ask the engine to use function handler mode. Will update the README
- about that.
2004-09-23 21:43:32 +00:00
Anantha Kesari H Y
b04db9d9e0 Reverted the NetWare Specific Stack limit related patches as asked by Andi 2004-09-23 06:23:36 +00:00
Anantha Kesari H Y
b66e7aec62 NetWare specific stack limit checks 2004-09-22 15:51:56 +00:00
Stanislav Malyshev
3755c03291 fix crash when dtor is fialing on shutdown 2004-09-17 10:13:52 +00:00
Andi Gutmans
96ab56e146 - Roll back VM commit 2004-09-09 16:47:22 +00:00
Andi Gutmans
8eb8850c90 - Some architectural changes:
a) We specialize opcodes according to op_type fields. Each opcode has to
    be marked with which op_type's it uses.
 b) We support different execution methods. Function handlers, switch()
    and goto dispatching. goto seems to be the fastest but it really
    depends on the compiler and how well it optimizes. I suggest playing
    around with optimization flags.

- Warning: Things might break so keep us posted on how things are going.
  (Dmitry, Andi)
2004-09-08 22:14:12 +00:00
Marcus Boerger
b7a8297bc1 - Boost up __autoload() calls by caching the lookup 2004-08-23 20:57:40 +00:00
Andi Gutmans
57ba9b8ccf - Second wave of garbage removal. 2004-08-19 20:29:04 +00:00
Marcus Boerger
5f0433db83 MFB: Enforce protocol on magic methods/functions 2004-08-02 08:27:57 +00:00
Andi Gutmans
d7c839d54f - More ptr_stack optimizations and cleanups 2004-07-30 21:00:37 +00:00
Marcus Boerger
0cd2da0309 - Execute destructors earlier (Florian Schaper, fschaper at intux org) 2004-07-25 07:14:49 +00:00
Wez Furlong
af9c0b84cd No point allocating 0 bytes 2004-07-18 09:55:02 +00:00
Wez Furlong
d80297b251 Fix bug #28438: win32 build fails in non-zts mode 2004-05-18 20:14:54 +00:00
Dmitry Stogov
09d1d232fc fix of fix related to __autoload. (ext/standard/tests/network/bug20134.phpt passes again) 2004-03-28 09:37:30 +00:00
Andi Gutmans
d6d52f6f2e /* The compiler is not-reentrant. Make sure we __autoload() only during run-time
* (doesn't impact fuctionality of __autoload()
     */
2004-03-25 11:30:02 +00:00
Dmitry Stogov
2bbba73606 Using ALLOC_HASHTABLE/FREE_HASHTABLE instead of emalloc/free. 2004-03-25 08:14:33 +00:00
Dmitry Stogov
55cf45abf5 New autoload protection schema was implemented (Using HashTable instead of boolean flag) 2004-03-24 14:30:59 +00:00
Marcus Boerger
cbaa43ff12 Fix SEGV in certain conditions while calling static methods 2004-03-16 21:29:22 +00:00
Marcus Boerger
6e8c176a9d TSRM fix 2004-03-16 18:04:25 +00:00
Derick Rethans
b0dbd2abcc - Spaces to tabs 2004-03-16 14:59:06 +00:00
Andi Gutmans
833b97d4c2 - If the called method is static then don't define $this 2004-03-16 14:49:52 +00:00
Andi Gutmans
0041aff953 - Error out if get_method() isn't defined.
- Use calling scope of internal function callee when calling a method
  using static syntax (array("A", "func"));
2004-03-16 14:39:07 +00:00
Marcus Boerger
09e76476ef Improve error message 2004-03-16 10:14:57 +00:00
Andi Gutmans
1aedb9615a - Fix windows build 2004-03-14 18:00:40 +00:00
Andi Gutmans
37d713ea49 - Fix for bug #27504 2004-03-14 17:52:58 +00:00
Marcus Boerger
50ee116f08 Clearify the different method/class flags (as discussed with Andi). 2004-03-09 16:38:37 +00:00
Marcus Boerger
c3b06ea21e Check count. 2004-03-08 16:52:59 +00:00
Andi Gutmans
7c72f6ff61 - Fix crash in exception handling (zend_exception_error(...) and
zend_eval_string_ex() were buggy (Dmitry, Andi)
2004-03-01 13:29:45 +00:00
Zeev Suraski
eb6fd52e21 - Rename compatiblity mode to zend.ze2_compatibility_mode (it doesn't only affect auto-clone).
- Perform implementation checks even with simple inheritance (off when
  compatibility mode is enabled).
- Restore default arguments in interfaces and handle it correctly.
- Move registration of internal classes later in the startup sequence
  in order to have INI options available.
2004-02-25 10:57:10 +00:00
Zeev Suraski
00ed3bad29 Centralize exceptions code in zend_exceptions.[ch].
Remove zend_default_classes.h (use zend_exceptions.h instead)

NOTE:  This currently breaks the build, fixes to php-src and pecl coming
       soon
2004-02-12 10:38:14 +00:00
Zeev Suraski
d9630a595b Exceptions updates:
- Enforce exceptions to be derived from class Exception.  This allows
  users to perform catch-all.  It's not yet complete, so don't get
  comfortable with it just yet :)  Updates are coming soon.
- Implement zend_throw_exception() using zend_throw_exception_ex()
2004-02-12 10:24:40 +00:00
Andi Gutmans
559b14611d - Add API function to throw exception by using an object 2004-02-12 09:50:08 +00:00
Zeev Suraski
75390796be Fix bug #25038 2004-02-11 13:01:39 +00:00
Zeev Suraski
6b6fe2f76e Fix exceptions thrown without a stack frame
Always enable set_exception_handler()
2004-02-11 12:31:18 +00:00
Zeev Suraski
73a6bcf5cf Complete the fix for handling of exceptions happening during the
argument passing phase of function calls (fixes bug #26866)
2004-02-11 09:42:58 +00:00
Zeev Suraski
4b632eba46 whitespace 2004-02-11 09:42:10 +00:00
Zeev Suraski
da36a7c249 Fix bug #26869 2004-02-10 15:30:32 +00:00
Zeev Suraski
e28ab687d2 Fix exceptions happening inside internal functions called through
zend_user_function()
2004-02-04 23:48:39 +00:00
Zeev Suraski
14ac17fa95 Remove double initialization 2004-02-04 23:28:40 +00:00
Zeev Suraski
c5d842279c Reinstate early-binding for classes.
Note that this is available for downwards compatibility only - and it doesn't
work if you use new features (namely, interfaces).  Generally, people should
declare their classes before using them, but we just didn't want hell to break
loose (c)
2004-02-04 16:30:15 +00:00
Zeev Suraski
f5f7d569a0 Change destructor implementation (details will follow on internals@) 2004-02-04 09:56:20 +00:00
Zeev Suraski
c5a7b668cd - Clean garbage (delete was nuked a long time ago) 2004-02-03 15:37:37 +00:00
Zeev Suraski
9e60cb553f Rewrote exception support. Fixes a few limitations and bugs in the old
implementation, and allows exceptions to 'fire' much earlier than before.

Instructions on how to use the new mechanism will follow on internals@
shortly...

Note - this (most probably) breaks the current implementation of
set_exception_handler()
2004-02-03 12:17:09 +00:00
Zeev Suraski
c15d4ddb2b Forward-port fix for timeouts under Windows 2004-01-28 09:07:02 +00:00
Marcus Boerger
3ca44539a1 Switch from ZEND_ACC_DYNAMIC to ZEND_ACC_ALLOW_STATIC and disallow calling
internal non-static methods statically.
# As discussed with Zeev:
# - For BC standard userspace methods allow this with an E_STRICT message.
# - If you want to implement an internal method taht can be called both
#   statically and non-statically then use flag ZEND_ACC_ALLOW_STATIC.
# - Magic user space methods __*() cannot and __construct, __destruct,
# __clone can never be called statically.
2004-01-24 16:59:24 +00:00
Sebastian Bergmann
1e902b696d Change message as proposed by Jon. 2004-01-24 04:59:47 +00:00
Marcus Boerger
6020ffd007 Simplify detection of methods that must be called dynamic (with object) 2004-01-23 22:04:42 +00:00
Marcus Boerger
79e7145cc7 Disallow calling __clone/__construct/__destruct static
Send an E_STRICT when calling a non static method static
2004-01-23 20:58:23 +00:00
Marcus Boerger
3df0288490 Improove debug capabilities 2004-01-18 23:47:10 +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
Marcus Boerger
03e039b19d Fix __autoload() with derived classes 2003-12-29 12:35:44 +00:00
Marcus Boerger
c6cb00fe59 Fixed bug #26697 (calling class_exists on a nonexistent class in __autoload
results in segfault).
2003-12-23 10:45:10 +00:00
Dmitry Stogov
ae4a09b239 *** empty log message *** 2003-12-17 15:08:13 +00:00
Dmitry Stogov
20f73cd267 Access to globals/autoglobals from class __destructor was fixed.
(see "tests/lang/bug24908.phpt" and "tests/classes/destructor_and_globals.phpt")
2003-12-17 14:25:12 +00:00
Dmitry Stogov
2d9281352b Memory corruptions were fixed in zend_str_tolower_copy() 2003-12-15 07:17:27 +00:00
Marcus Boerger
39544e1c7f Bugfix: #26591 [NEW]: "__autoload threw an exception" during an uncaught
Exception
2003-12-11 18:18:52 +00:00
Marcus Boerger
310d6c567a Do not double copy the string 2003-12-10 10:24:35 +00:00
Andi Gutmans
d344648b07 - Fix __autoload() to preserve class case.
- Heads up, this patch might break stuff so please let me know if you
- bump into any problems.
2003-11-24 18:13:29 +00:00
Marcus Boerger
f3d385a587 Make __autoload() faster 2003-11-07 11:47:50 +00:00
Marcus Boerger
b28db6a2d3 Revert accidental commit 2003-10-24 18:42:00 +00:00
Marcus Boerger
071eaf8576 Zend/ZEND_CHANGES 2003-10-24 18:24:28 +00:00
Stanislav Malyshev
6a71c1d33f The freed one is a hashtable - may matter if Hashtables are allocated
differently
2003-10-14 14:36:23 +00:00
Stanislav Malyshev
b163778fee ws 2003-09-11 17:06:53 +00:00
Stanislav Malyshev
406ff728f1 Use scope from method, not from object 2003-09-11 17:04:26 +00:00
Marcus Boerger
1257b407a6 WS 2003-09-01 13:04:55 +00:00
Marcus Boerger
19ec7a09fc - Provide appropriate way to destroy internal zval's.
- Allow internal zval's of type string and disallow complex types.
- Define the default string for extensions at class level instead of ctor.
2003-08-24 17:32:47 +00:00
Marcus Boerger
d3473d1f58 - Provide a unified way to display uncaught exceptions, which shows
file/line/message info if possible.
- Add zend_eval_string_ex() to be able to handle exceptions in eval'd code.
- Use above function to fix memleaks in CLI.
2003-08-24 13:10:03 +00:00
Zeev Suraski
5b312b571e Clarify use of original_function_state_ptr 2003-08-07 07:37:19 +00:00
Marcus Boerger
e9a4c91ca4 - Fix warnings
- Fix code
2003-08-07 07:17:34 +00:00
Zeev Suraski
0a83ebfd56 clarify :) 2003-08-06 07:38:56 +00:00
foobar
cc011660e7 Fix the build 2003-08-05 23:50:59 +00:00
Zeev Suraski
92b4013e8d Try to put an end to the endless number of call_user_function variants.
zend_call_function() now takes a structure that should contain all of the
necessary information.  If further information is necessary in the future,
then we'll be able to add it without having to introduce a new function.

As for caching - the 2nd, optional argument is a struct that can hold all
of the information that's necessary to invoke the function, including its
handler, scope and object it operates on (if any).  Note that you may only
use a cache if the arguments you provide to zend_call_function() are
identical to the ones of the last call, except for the argument and return
value information.


The recently introduced fast_call_user_function() was removed

I fixed most of the places that used fast_call_user_function() to use caching
but there are still some that need to be fixed (XML and reflection)
2003-08-05 10:24:40 +00:00
Stanislav Malyshev
f572897dea remove stack clean - it makes trouble 2003-08-05 07:56:49 +00:00
Marcus Boerger
65557ef672 Nuke unused variables 2003-08-04 19:56:12 +00:00
Ilia Alshanetsky
1007b0a826 Fixed bug #23104 (hash position of static arrays not being reset) 2003-08-04 17:10:52 +00:00
Stanislav Malyshev
2884e8a715 oops. forgot function 2003-08-04 11:03:38 +00:00
Stanislav Malyshev
7cb1730293 fix crash #24842 2003-08-04 11:02:53 +00:00
Zeev Suraski
f8bbafd604 ntroduce infrastructure for supplying information about arguments,
including:

- Whether or not to pass by ref (replaces the old arg_types, with arg_info)
- Argument name (for future use, maybe introspection)
- Class/Interface name (for type hints)
- If a class/interface name is available, whether to allow a null instance

Both user and builtin functions share the same data structures.

To declare a builtin function that expects its first arg to be an instance
of class 'Person', its second argument as a regular arg, and its third by
reference, use:

ZEND_BEGIN_ARG_INFO(my_func_arg_info, 0)
    ZEND_ARG_OBJ_INFO(0, someone, Person, 1)
    ZEND_ARG_PASS_INFO(0)
    ZEND_ARG_PASS_INFO(1)
ZEND_END_ARG_INFO();

and use my_func_arg_info as the arg_info parameter to the ZEND_FE() family
of macros.

The first arg to each ZEND_ARG_*() macro is whether or not to pass by ref.

The boolean arg to ZEND_BEGIN_ARG_INFO() tells the engine whether to treat
the arguments for which there's no explicit information as pass by reference
or not.
The boolean argument to ZEND_ARG_OBJ_INFO() (4th arg) is whether or not to allownull values.
2003-08-03 17:40:44 +00:00
Zeev Suraski
9d7122fb53 Generalize fetch_class 2003-08-03 08:21:08 +00:00
Stanislav Malyshev
47fef22bc5 change shutdown order so that dtors would coexist with object error handlers 2003-07-27 15:59:37 +00:00
Stanislav Malyshev
5bfd386bc3 make shutdown more granular so in case some dtor goes ape we still
can shut down cleanly
2003-07-27 13:47:58 +00:00
Stanislav Malyshev
5a7b07701b Fix bug #19859 - allow fast_call_user_function to support __call 2003-07-03 09:18:41 +00:00
Sterling Hughes
92e9e0ca7e optimize the case where the object is really a class name, as we don't need
to set EX(object) here.
2003-07-02 14:44:41 +00:00
Sterling Hughes
3fc83023b6 Timm Friebe points out that object detection should be done regardless of
the function pointer
2003-07-02 14:33:41 +00:00
Marcus Boerger
bef4696d3e small bugfix 2003-07-01 22:47:41 +00:00
Andi Gutmans
288dacca0c - ZE coding style requires if ( instead of if( 2003-06-30 20:22:35 +00:00