Commit Graph

260 Commits

Author SHA1 Message Date
Marcus Boerger
cec053f707 Don't identify alias'ed functions 2003-08-24 16:35:58 +00:00
Marcus Boerger
1c2512ddea - Add fn_flag ZEND_ACC_ALIAS
- Unify way of function_entry generation by new macro ZEND_FENTRY
2003-08-24 11:09:45 +00:00
Marcus Boerger
baaa4c903d Internal classes can now have default properties. 2003-08-23 19:37:39 +00:00
Marcus Boerger
fbda310a41 - Flag ctor/dtor methods
- Use this to prevent memleaks when an exception gets thrown in ctors.
# I added the dtor flags for consistency, atm a compareable check in
# isn't necessary for destruction. But anyway i'll use this for the
# Relection API too.
2003-08-23 15:38:58 +00:00
Zeev Suraski
49c4866a47 - Improve tracking
- Fix several overloading issues
2003-08-18 22:31:11 +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
Zeev Suraski
68fa4e50f8 Get rid of an opcode 2003-07-30 17:49:27 +00:00
Zeev Suraski
c0b46739ca Improve array overloading - support unset($foo["bar"]) 2003-07-30 17:12:06 +00:00
Zeev Suraski
4839ce5952 Remove garbage 2003-07-30 17:02:41 +00:00
Zeev Suraski
2fd4ffce17 Add exec_finished() callback for modules - this is the last place where the
modules may touch the symbol table reliably
2003-07-30 16:13:52 +00:00
Zeev Suraski
03b6af07eb Support references in foreach()
Syntax:
  foreach ($arr as &$val)
  foreach ($arr as $key => &$val)
2003-07-24 12:38:33 +00:00
Stanislav Malyshev
237116aa27 Remove namespace leftovers 2003-07-23 08:58:46 +00:00
Zeev Suraski
3a898f6d4e More cleanup for assign-op handling of objects 2003-07-16 08:57:08 +00:00
Zeev Suraski
134338522f Rework zend_do_declare_property and related code into one code base 2003-07-07 16:22:56 +00:00
Zeev Suraski
938c0fbc19 Initial support for overloading of array syntax for objects (very initial) 2003-07-07 09:00:36 +00:00
Marcus Boerger
60c7abac61 Add final classes 2003-06-21 21:56:06 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Zeev Suraski
8d2a4e04ae Fix bogus implicit declarations of properties (squash bug #23671) 2003-06-09 13:51:53 +00:00
Zeev Suraski
d329ce93f2 Nicer handling of protected/private members in print_r() 2003-06-08 18:53:58 +00:00
Stanislav Malyshev
f7f5a5ea6b MEGA-patch: namespaces are R.I.P. 2003-06-02 12:13:11 +00:00
Marcus Boerger
7463e7239b Defining it once is enough 2003-06-01 11:15:01 +00:00
Marcus Boerger
472cc5b9f3 Faster interface inheritance & faster inheritance checks 2003-05-29 19:00:40 +00:00
Sebastian Bergmann
dccdb2f549 Fix warnings. 2003-04-11 17:30:42 +00:00
Sterling Hughes
0191ba5de1 allow expressions within constants, so the following is possible
class foo {
	const a = 1<<0;
	const b = 1<<1;
	const c = a | b;
}

this makes const a compile-time expression.  all other operators are
unaffected.
2003-04-10 15:43:47 +00:00
Sterling Hughes
5ae7fa422d add markers that make this file easy to parse for external sources 2003-04-07 21:48:17 +00:00
Andrei Zmievski
1885d00861 Simplify. 2003-04-02 18:15:08 +00:00
Andrei Zmievski
bdd3b6042c Implement a different way to catch documentation comments. 2003-04-02 16:51:49 +00:00
Andrei Zmievski
e6255b06b1 Revert portions of the doc comment patch. There should be no parser
errors now.
2003-04-02 16:13:12 +00:00
Stanislav Malyshev
800de8acb0 allow class_exists() to work with namespaces too.
add CLASS_IS_NAMESPACE macro
2003-04-02 15:28:31 +00:00
Andrei Zmievski
62f9eb8006 Split ZEND_NAMESPACE into user and internal namespaces. Hope this is
okay with engine folks.
2003-04-01 19:37:04 +00:00
Andrei Zmievski
5657b83691 Multi-purpose patch:
- The fields of zend_namespace were not completely initialized which
   led to a variety of problems.
 - The occurrence of class/interface/namespace definition is now
   captured.
 - Functions/classes/interfaces/namespaces can be preceded by doc
   comments which are stored for use by extensions.
2003-03-31 20:42:01 +00:00
Zeev Suraski
5097be302e Initial support for enforcing prototype of abstract/interface method implementations 2003-03-29 11:19:38 +00:00
Sebastian Bergmann
3fc852824f Eliminate TSRMLS_FETCH() calls in destroy_op_array() and zend_get_class_entry(). 2003-03-26 07:44:11 +00:00
Shane Caraveo
170de9b95c export functions needed by cli 2003-03-22 23:26:00 +00:00
Andrei Zmievski
39d5a63803 - Keep track of starting/ending line numbers for user functions.
- Store last parsed doc comment in a compiler global for future use.
2003-03-19 21:17:47 +00:00
Zeev Suraski
0eae231254 Fix handling of ::foo 2003-03-09 22:17:15 +00:00
Zeev Suraski
8bc88d8df4 Fix parsing rules of namespaces/classes 2003-03-09 20:53:57 +00:00
Zeev Suraski
0338111950 Require abstract classes to be explicitly declared 'abstract', in order to
avoid making developers traverse the entire class/interface hierarchy
before they can figure out whether a class is instantiable
(ok, so it makes sense :)
2003-03-06 22:53:23 +00:00
Zeev Suraski
44347cf64b Change opcode name 2003-03-06 14:42:36 +00:00
Zeev Suraski
ff76511a08 Add class type hints 2003-03-06 14:31:17 +00:00
Zeev Suraski
26dd8492ed Add support for interfaces 2003-03-05 11:14:44 +00:00
Zeev Suraski
98b990e336 Improve infrastructure 2003-03-02 13:33:31 +00:00
Zeev Suraski
f7b7800479 Add infrastructure for JIT initialization of auto globals 2003-03-02 10:04:53 +00:00
Zeev Suraski
535aa63293 Add 'final' 2003-02-24 12:05:58 +00:00
Stanislav Malyshev
e645f20d07 Allow namespaces to have a number of parts. I.e., now you can do:
namespace foo {
	function abc() {}
}
...
namespace foo {
	functio def() {}
}
2003-02-20 19:01:53 +00:00
Zeev Suraski
955636af69 Avoid using a C++ reserved word 2003-02-18 17:18:28 +00:00
Wez Furlong
e52aac940f Implement simple stream support in the ZE scanners. 2003-02-18 09:37:54 +00:00
Sebastian Bergmann
6d300baf84 ZTS fixes 2003-02-16 11:34:49 +00:00
Stanislav Malyshev
a4c3b2ce80 Namespace patch. Big changes:
1. Nested classes are gone.
2. New syntax for namespaces:
namespace foo {
	class X { ... }
	function bar { ... }
	var x = 1;
	const ZZ = 2;
}
3. Namespaced symbol access: $x = new foo::X; - etc.
For now, namespaces are case insensitive, just like classes.
Also, there can be no global class and namespace with the same name
(to avoid ambiguities in :: resolution).
2003-02-16 11:12:43 +00:00