Commit Graph

105 Commits

Author SHA1 Message Date
Marcus Boerger
e39f3f3f48 Simplify/Optmize magic method calls (__get/__set/__call/__clone/__destruct) 2004-09-28 22:55:22 +00:00
Zeev Suraski
34b00ca22a Fix bug in handling of protected properties 2004-07-22 11:54:27 +00:00
Stanislav Malyshev
e000da960b __set and __get will be called not only when variable doesn't exist but also when it's
invisible
2004-07-19 14:26:53 +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
Stanislav Malyshev
d673ec0184 be consistent with write_dimension 2004-07-14 09:04:13 +00:00
Stanislav Malyshev
28d72ce2fd fix #28957 2004-07-14 09:01:58 +00:00
Wez Furlong
6f5c0992a3 Fix leak on systems where alloca isn't really alloca. 2004-05-26 22:19:44 +00:00
Wez Furlong
d056b25c3f Add count_elements handler for overloaded objects. 2004-05-04 15:03:28 +00:00
Andi Gutmans
4a24cbe276 - Fix bug #26441 (When __set() returned a value it corrupted it) 2004-04-09 14:42:06 +00:00
Stanislav Malyshev
bd9b600c3c API change for read_property:
instead of bool silent it now gets fetch type
This can be used for creating proxy objects for write contexts
2004-03-21 18:07:27 +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
62b81df9b0 - This was too strict. 2004-02-12 14:31:13 +00:00
Zeev Suraski
e7e0f7d4b4 - Check return-by-reference bit when implementing interface prototypes
- Add infrastructure for built-in functions to hint whether they
  return by reference or not.  It is NOT currently used for anything,
  except for interface prototypes (you can use it to request that the
  function that implements your prototype returns by reference or
  doesn't return by reference).
  For downwards compatibility - by default, interface prototypes are
  agnostic as to whether the function that implements them returns
  by reference or not.  Use ZEND_BEGIN_ARG_INFO_EX() with
  ZEND_RETURN_VALUE/ZEND_RETURN_REFERENCE to change that.
- Fix ArrayAccess::getOffset() to conduct additional checks.
  If your getOffset() should work with multidimensional arrays - it
  must return by reference.
2004-02-12 13:49:55 +00:00
Zeev Suraski
473927ece8 Fix write-mode of overloaded objects when using array dimensions 2004-02-08 17:23:20 +00:00
Zeev Suraski
c5a7b668cd - Clean garbage (delete was nuked a long time ago) 2004-02-03 15:37:37 +00:00
Ilia Alshanetsky
0a8a950fcf Expose zend_std_call_user_call(), needed for implementation of things like
__call handlers.
2004-01-17 00:39:28 +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
Stanislav Malyshev
1e11e7401c Bug #24608 - fix interaction between __accessors and get_property_ptr 2004-01-05 11:45:46 +00:00
Derick Rethans
6923a16c26 - Fixed var_export() to show public, protected and private modifiers properly.
- Exported (un)mangle_property_name.
2004-01-03 13:51:02 +00:00
Marcus Boerger
db36fd0200 Fix __tostring() and concatenation 2003-12-27 20:16:49 +00:00
Marcus Boerger
06788f0438 Fixed bug #26675 (Segfault on ArrayAccess use)
Update NEWS
2003-12-22 16:27:14 +00:00
Wez Furlong
273c19334b export these symbols for use by SPL as a shared extension 2003-12-22 13:09:15 +00:00
Marcus Boerger
49efcd4f27 Fixed bug #24837 Incorrect behaviour of PPP using foreach. 2003-12-18 20:07:30 +00:00
Stanislav Malyshev
052032f5ec export externally used functions 2003-12-16 10:51:21 +00:00
Marcus Boerger
d4f64f88ba Reenable __tostring() magic for print,echo,concatenation,function naming...
but not for other internal things.
# As discussed with Andi
2003-12-15 16:59:21 +00:00
Marcus Boerger
904373a830 Handle getter failure and allow to bypass thrown exceptions. 2003-12-11 09:56:06 +00:00
Marcus Boerger
ff57d33fe2 Remove automatic call to __toString() since it is supposed to cause too
much trouble. See discussion on the mailing list.
2003-12-02 22:08:51 +00:00
Marcus Boerger
87577dd881 The macro REPLACE_ZVAL_VALUE cannot be used since we only have zval *
writeobj. to allow it the api needs to be changed to zval **writeobj.
2003-11-27 19:08:28 +00:00
Marcus Boerger
4dba05d9cc Add new interface ArrayAccess to use objects as Arrays 2003-11-24 20:57:54 +00:00
Marcus Boerger
e7365f316c Correct default handlers 2003-11-10 20:44:50 +00:00
Marcus Boerger
48d249de46 Fix those warnings 2003-11-10 16:23:12 +00:00
Marcus Boerger
296529b886 Split isset/isempty for object property and object dimension hooking. 2003-11-10 16:14:44 +00:00
Marcus Boerger
316854323d Handle exceptions in casting more gracefully.
This fixes bug #26166
2003-11-08 14:06:08 +00:00
Moriyoshi Koizumi
68bab385cb __tostring() handler should be binary-safe 2003-11-04 17:34:56 +00:00
Zeev Suraski
4de32429f5 Remove unused callback 2003-10-05 08:27:31 +00:00
Zeev Suraski
3f5acc73a5 Remove redundant callback, simplify API 2003-10-05 07:52:28 +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
Marcus Boerger
95649ab260 Tests show updating consts must happen once at runtime (revert optimization).
Add tests for static properties.
2003-09-04 16:00:01 +00:00
Marcus Boerger
1b39a5aa2c Fix static properties.
#
# There's only an errormessage missing which i'll wommit as soon as i find out
# how to do it best. But besides that damn message everything works now and all
# inheritance rules apply.
#
2003-09-03 16:13:40 +00:00
Marcus Boerger
9702c70a35 Synch/Unify error messages related to function/method calls 2003-09-02 14:08:59 +00:00
Marcus Boerger
744dd20520 Fix warnings 2003-08-17 19:14:30 +00:00
Sascha Schumann
b29b4441db Restrict scope of inline functions to compile unit
Submitted by: Jason Greene <jason@inetgurus.net>
2003-08-15 21:02:35 +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
c0b46739ca Improve array overloading - support unset($foo["bar"]) 2003-07-30 17:12:06 +00:00
Zeev Suraski
6a50660cfe Fix isset()/empty() for non-trivial object elements
(API change - read_property now accepts an extra element)
Fixes bug #24436
2003-07-22 13:49:33 +00:00
Zeev Suraski
7e72d8e826 Fix bug #24499 2003-07-21 12:13:16 +00:00
Zeev Suraski
3cfa6a68f4 Add get_dim callback 2003-07-07 10:53:27 +00:00
Zeev Suraski
ae6a1e7e4e whitespace 2003-07-07 09:12:15 +00:00
Zeev Suraski
765f349ecd fixlet 2003-07-07 09:01:22 +00:00
Zeev Suraski
938c0fbc19 Initial support for overloading of array syntax for objects (very initial) 2003-07-07 09:00:36 +00:00