Commit Graph

348 Commits

Author SHA1 Message Date
Felipe Pena
e4ca0ed09f - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
8775a37559 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
eebaaf423f - Added class member access on instantiation (e.g. (new foo)->bar()) support 2011-11-06 13:25:45 +00:00
Felipe Pena
ff48763f4b - Added class member access on instantiation (e.g. (new foo)->bar()) support 2011-11-06 13:25:45 +00:00
Felipe Pena
8db63e8874 - Drop T_SCALAR_CAST 2011-08-16 12:13:35 +00:00
Felipe Pena
17abf879ed - Drop T_SCALAR_CAST 2011-08-16 12:13:35 +00:00
Hannes Magnusson
306c42023e Callable typehint following the rules of is_callable($arg, false); 2011-08-16 10:44:47 +00:00
Hannes Magnusson
550980cfe5 Callable typehint following the rules of is_callable($arg, false); 2011-08-16 10:44:47 +00:00
Dmitry Stogov
ad4d6d1ce3 Added support for Class::{expr}() syntax (Pierrick) 2011-08-01 12:08:44 +00:00
Dmitry Stogov
74f68932b7 Added support for Class::{expr}() syntax (Pierrick) 2011-08-01 12:08:44 +00:00
Stefan Marr
0158804a15 Added __TRAIT__ magic constant [TRAITS] [DOC]
# __TRAIT__ behaves like __CLASS__ more or less but is constraint to traits.
# Since traits are not types, there are not many valid use cases, and trying
# to use __TRAIT__ to make traits more like classes is discouraged.
2011-07-31 17:39:30 +00:00
Stefan Marr
dbc6849bca Added __TRAIT__ magic constant [TRAITS] [DOC]
# __TRAIT__ behaves like __CLASS__ more or less but is constraint to traits.
# Since traits are not types, there are not many valid use cases, and trying
# to use __TRAIT__ to make traits more like classes is discouraged.
2011-07-31 17:39:30 +00:00
Pierre Joye
80496c9dc4 - add short array syntax as defined in https://wiki.php.net/rfc/shortsyntaxforarrays, 2nd solution using => only 2011-07-23 20:23:21 +00:00
Pierre Joye
cbe0ed86e7 - add short array syntax as defined in https://wiki.php.net/rfc/shortsyntaxforarrays, 2nd solution using => only 2011-07-23 20:23:21 +00:00
Felipe Pena
0fe6fd9e89 - Changed zend_resolve_class_name() prototype
# No needed to pass fetch_type as pointer here
2011-07-09 17:27:59 +00:00
Felipe Pena
70cacfd3a8 - Changed zend_resolve_class_name() prototype
# No needed to pass fetch_type as pointer here
2011-07-09 17:27:59 +00:00
Felipe Pena
0124c28610 - Fixed bug #55086 (Namespace alias does not work inside trait's use block)
patch by: Pierrick
2011-07-02 17:12:20 +00:00
Felipe Pena
d8e8e68f07 - Fixed bug #55086 (Namespace alias does not work inside trait's use block)
patch by: Pierrick
2011-07-02 17:12:20 +00:00
Felipe Pena
bcf7e60d4c - Fixed build on Windows 2011-06-24 00:38:53 +00:00
Felipe Pena
e9ce400f8b - Fixed build on Windows 2011-06-24 00:38:53 +00:00
Felipe Pena
72f7be3df0 - Improved parse error messages 2011-06-23 23:00:53 +00:00
Felipe Pena
0372e6ad80 - Improved parse error messages 2011-06-23 23:00:53 +00:00
Felipe Pena
80d432ca62 - Avoid zend_do_ticks() call for each statement in parsing 2011-06-12 01:43:10 +00:00
Felipe Pena
e613aae620 - Avoid zend_do_ticks() call for each statement in parsing 2011-06-12 01:43:10 +00:00
Felipe Pena
86ed2eeb5d - Avoid zend_do_ticks() call for each statement in parsing 2011-06-12 01:43:10 +00:00
Stanislav Malyshev
e18618905c scalar types cleanup 2011-06-03 01:09:32 +00:00
Stanislav Malyshev
d7c9c5af92 scalar types cleanup 2011-06-03 01:09:32 +00:00
Stanislav Malyshev
516c2f5920 removing scalar types in trunk 2011-05-15 00:36:13 +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
Dmitry Stogov
2188f26c45 Fixed bug #52614 (Memory leak when writing on uninitialized variable returned from method call) 2010-08-25 09:14:36 +00:00
Felipe Pena
eb0ba9068d - Allow write context on array dereferencing from method return
- New tests
2010-06-12 16:11:10 +00:00
Felipe Pena
99c31b31ec - Added array dereferencing support [DOC]
# http://wiki.php.net/rfc/functionarraydereferencing
2010-06-08 00:05:29 +00:00
Ilia Alshanetsky
33fae4caa0 Added support for numeric & scalar type hint as defined within
http://wiki.php.net/rfc/typecheckingstrictandweak RFC
2010-05-24 18:32:59 +00:00
Derick Rethans
1bc9247651 - Added scalar typehinting. 2010-05-20 19:18:35 +00:00
Stefan Marr
cd6415f1a9 Implemented Traits for PHP as proposed in the RFC [TRAITS]
# RFC http://wiki.php.net/rfc/horizontalreuse#traits_-_reuse_of_behavior
# Ok, here we go, I guess that will result in more discussion, which is fine
# by me. But now, the patch is here, and properly archived.
# 
# See below a list of notes to the patch, it also includes a list of
# points which should be fixed
# 
# Internals of the Traits Patch
# -----------------------------
# 
# Open TODOs
# """"""""""
# 
# - Reflection API
# - support for traits for internal classes
#   - currently destroy_zend_class does not handle that case 
# 
# Introduced Structures
# """""""""""""""""""""
# 
# Data structures to encode the composition information specified in the
# source:
#  - zend_trait_method_reference
#  - zend_trait_precedence
#  - zend_trait_alias
# 
# Changes
# """""""
# 
# zend_class_entry
#  - uses NULL terminated lists of pointers for
#    - trait_aliases
#    - trait_precedences
#    - do you prefer an explicit counter?
#    - the information is only necessary during class composition
#      but might be interesting for reflection
#    - did not want to blow up class further with not really necessary length counters
# 
# added keywords
#   - trait
#   - insteadof
# 
# Added opcodes
#  ZEND_ADD_TRAIT
#    - similar to ZEND_ADD_INTERFACE
#    - adds the trait to the list of traits of a class, no actual composition done
#  ZEND_BIND_TRAITS
#    - emitted in zend_do_end_class_declaration
#    - concludes the class definition and will initiate the trait composition
#      when the class definition is encountered during runtime
# 
# Added Flags
#   ZEND_ACC_TRAIT = 0x120
#   ZEND_ACC_IMPLEMENT_TRAITS = 0x400000
#   ZEND_FETCH_CLASS_TRAIT = 14
# 
# zend_vm_execute.h
#  - not sure whether the handler initialization (ZEND_ADD_TRAIT_SPEC_HANDLER,
#    ZEND_BIND_TRAITS_SPEC_HANDLER) is correct, maybe it should be more selective
# 
# zend_compile.c
#  - refactored do_inherit_method_check
#    split into do_inherit_method_check and do_inheritance_check_on_method
#  - added helper functions use a '_' as prefix and are not mentioned in the
#    headers
#  - _copy_functions
#    prepare hash-maps of functions which should be merged into a class
#    here the aliases are handled
#  - _merge_functions
#    builds a hash-table of the methods which need to be added to a class
#    does the conflict detection
#  - reused php_runkit_function_copy_ctor
#    - it is not identical with the original code anymore, needed to update it
#      think I fixed some bugs, not sure whether all have been reported back to runkit
#    - has to be renamed, left the name for the moment, to make its origin obvious
#    - here might be optimization potential
#    - not sure whether everything needs to be copied
#      - copying the literals might be broken
#        - added it since the literals array is freed by efree and gave problems
#          with doubled frees
#      - all immutable parts of the zend_op array should not be copied
#        - am not sure which parts are immutable
#        - and not sure how to avoid doubled frees on the same arrays on shutdown
#  - _merge_functions_to_class
#    does the final merging with the target class to handle inherited
#    and overridden methods
#  - small helper for NULL terminated lists
#    zend_init_list, zend_add_to_list
# 
# zend_language_parser.y
#  - reused class definition for traits
#    - there should be something with regard to properties
#      - if they get explicitly defined, it might be worthwhile to
#        check that there are no collisions with other traits in a composition
#        (however, I would not introduce elaborate language features to control that
#         but a notice for such conflicts might be nice to the developers)
2010-04-22 22:05:56 +00:00
Dmitry Stogov
453b49ed20 Added a number of small performance tweaks and optimizations
. ZEND_RECV now always has IS_CV as its result
  . ZEND_CATCH now has to be used only with constant class names
  . ZEND_FETCH_DIM_? may fetch array and dimension operans in a different order
2010-04-20 11:16:39 +00:00
Dmitry Stogov
94dd83722b Changed the structure of op_array.opcodes. The constant values are moved from opcode operands into a separate literal table 2010-04-20 10:57:45 +00:00
Stanislav Malyshev
c93a4f192b restore $this support for closures to its former glory 2010-04-19 19:45:03 +00:00
Sebastian Bergmann
3defe76254 sed -i "s#1998-2009#1998-2010#g" **/*.re **/*.y **/*.l 2010-01-05 20:40:23 +00:00
Dmitry Stogov
7ef3db0e4e Fixed bug #47516 (nowdoc can not be embed in heredoc but can be embed in double quote) 2009-03-26 12:37:54 +00:00
Christian Seiler
c6d89bd4a8 [DOC] Remove $this support in closures for PHP 5.3 beta 1
- Implementation notes here:
  http://wiki.php.net/rfc/closures/removal-of-this
2009-01-26 22:54:34 +00:00
Felipe Pena
bfcea7ffa8 - MFH: Year++ 2009-01-02 20:45:43 +00:00
Dmitry Stogov
ea45b713c8 Added support for namespaces with brackets. (Greg) 2008-11-25 09:56:32 +00:00
Stanislav Malyshev
4cb8b8ba40 Improve use syntax
[DOC] use \foo\bar is the same as use foo\bar
2008-11-17 18:00:44 +00:00
Stanislav Malyshev
1b4134c07b Namespace resolution streamlining patch
[DOC] new resolution rules should be documented soon
2008-11-11 19:45:29 +00:00
Antony Dovgal
f26f2c0961 fix more invalid reads 2008-11-08 11:00:23 +00:00
Antony Dovgal
57b9a6449a fix typo causing invalid reads 2008-11-07 10:51:26 +00:00
Marcus Boerger
7126de4912 - Next step in namespaces, using / as namespace separator. 2008-11-04 15:58:55 +00:00
Matt Wilmas
2e6d655efd MFH: - Saved opcode when unary +/- is applied to IS_CONST op (e.g. for negative numbers)
- Made '+' in static_scalar context behave as '-' by calling add_function()
2008-08-29 17:54:29 +00:00
Marcus Boerger
4344e2ec9e - MFH Add missing ';'s 2008-08-12 10:23:02 +00:00
Dmitry Stogov
478acfd8b4 . Added support for using static HEREDOCs to initialize static variables and class members or constants. (Matt)
. Improved syntax highlighting and consistency for variables in double-quoted strings and literal text in HEREDOCs and backticks. (Matt)
. Optimized interpolated strings to use one less opcode. (Matt)
2008-07-26 15:30:28 +00:00
Dmitry Stogov
44325e6473 Fixed bug #45178 (memory corruption on assignment result of "new" by reference) 2008-07-24 11:47:51 +00:00
Dmitry Stogov
d5ef2f466c Added support for lambda functions and closures 2008-07-14 09:49:03 +00:00
Stanislav Malyshev
4f522eb576 allow aggregating use statements 2008-06-08 09:38:47 +00:00
Dmitry Stogov
5521912b15 Use IS_CV for dirrent access to $this variable 2008-05-07 12:04:39 +00:00
Felipe Pena
f66f55edc5 MFH: Implemented "jump label" operator (limited "goto")
[DOC]
2008-03-28 14:35:01 +00:00
Marcus Boerger
d3e5026564 - MFH Add E_DEPRECATED (Lars Strojny, Felipe Pena, Marcus)
[DOC] Finally added deprecation messages
2008-02-23 17:06:22 +00:00
Dmitry Stogov
ddcf7a2f49 Added NEWDOC 2008-02-12 09:27:45 +00:00
Dmitry Stogov
51278b6d22 Fixed ext/tokenizer test failures because of token renumbering 2008-02-12 08:49:08 +00:00
Stanislav Malyshev
fd597dce1b [DOC] Add compile-time __DIR__ constant which implements dirname(__FILE__) 2008-02-12 00:21:15 +00:00
Marcus Boerger
1ecdaa3885 - Fix warnings 2008-02-03 14:32:48 +00:00
Dmitry Stogov
5a3eb53723 Fixed bug #38469 (unexpected creation of cycle, json tests failed, leaks memory) 2007-12-28 13:22:00 +00:00
Dmitry Stogov
64e8f22355 Allowed import of global classes "use ::GlobalClassName;" 2007-12-13 10:02:03 +00:00
Dmitry Stogov
6484b3c458 Fixed bug #43344 (Wrong error message for undefined namespace constant) 2007-12-07 17:11:24 +00:00
Johannes Schlüter
45f6b4ce2f - MFH Improved version of ternary shortcut (Marcus) 2007-11-21 09:41:35 +00:00
Johannes Schlüter
4a8ed7ab68 - MFH ?: operator (Marcus)
[DOC] "expr1 ?: expr1" is a shortcut for: "expr1 ? expr1 : expr2" as
        exists in gcc and discussed some time back. Note that this is not
        an implementation ifsetor($var, default). While ifsetor would not
        generate any message for non existing variables or array indices
        the ternary shortcut does. Also the ternary shortcut does a boolean
        evaluation rather then checking for isset(). That way ther ternary
        shortcut can work on any expression while ifsetor can only work on
        variables. Also to be silent one has do do: "@$expr1 ?: $expr2".
2007-11-21 00:03:16 +00:00
Dmitry Stogov
9f230a0d79 Added support for "namespace::" prefix that is resolved to current namespace name. 2007-11-20 08:53:02 +00:00
Johannes Schlüter
18a656de6f - MFH: static can't be used as type hint, fixes #43126 (Etienne Kneuss) 2007-11-11 22:11:25 +00:00
Dmitry Stogov
b7d87bebc9 T_IMPORT -> T_USE 2007-11-07 09:13:50 +00:00
Dmitry Stogov
b599e434ad Fixed bug #35163 (Array elements can lose references) 2007-10-23 09:55:11 +00:00
Dmitry Stogov
41e9b6b61c Fixed bug #42802 (Namespace not supported in typehints) 2007-10-01 10:37:14 +00:00
Dmitry Stogov
166266df68 Added support for Late Static Binding. (Dmitry, Etienne Kneuss) 2007-09-29 07:28:34 +00:00
Dmitry Stogov
f32ffe9b43 Namespaces 2007-09-28 19:52:53 +00:00
Johannes Schlüter
9483a2ff23 - Readd support for ynamic access of static members (Etienne) 2007-09-27 00:32:40 +00:00
Stanislav Malyshev
c8f090c13e Revert variable class patch for 5.2 2007-08-13 21:16:57 +00:00
Johannes Schlüter
b3c6a9dffc - Add possibility to call static class members using variables (Etienne Kneuss) 2007-08-02 21:55:23 +00:00
Stanislav Malyshev
bc2b546dcc fix #41401 - parser precedence on unary operators
# now 1/-2*5 is -2.5 as it should be
2007-05-18 18:36:04 +00:00
Dmitry Stogov
80d2409fd8 Improved compilation of heredocs and interpolated strings. (Matt, Dmitry) 2007-05-18 13:12:05 +00:00
Ilia Alshanetsky
17c0c49a54 Addres limitation of __HALT_COMPILER() that allowed only one instance
per request.

# Patch by Greg Beaver
2007-04-04 00:42:42 +00:00
Dmitry Stogov
e470e22e20 - Fixed bug #35106 (nested foreach fails when array variable has a reference).
- Fixed bug #36214 (__get method works properly only when conditional operator is used).
- Fixed bug #39449 (Overloaded array properties do not work correctly).
- Fixed bug #39990 (Cannot "foreach" over overloaded properties).
2007-01-10 15:58:08 +00:00
Antony Dovgal
c348c293c8 MFH: fix #39903 (Notice message when executing __halt_compiler() more than once) 2006-12-20 16:31:10 +00:00
Marcus Boerger
7a5240e846 - MFH missing bits and pieces of the partial sync with head
# This time i added:
# ZEND_FE_RESET_VARIABLE
# ZEND_FE_RESET_REFERENCE
# and dapted parser,compiler,executor,interfaces to handle these flags
# their purpose is to be able to pass whetehr foreach is done by ref to
# the current() handler so that it can error out in case it is not capable
# to comply to the requested return signature/protocol/semantics (weyp).
2006-05-11 21:07:39 +00:00
Ilia Alshanetsky
e7f6a3fab2 As per agreement during PDM, remove the E_STRICT deprecation notice from
"var".
2006-03-12 16:52:18 +00:00
Andi Gutmans
61e93ccfe8 - Update copyright notices to 2006 2006-01-04 23:53:05 +00:00
Dmitry Stogov
cc50a96139 Fixed bug #34873 (Segmentation Fault on foreach in object) 2005-10-17 07:57:00 +00:00
Marcus Boerger
967413c58c - MFH Fix Bug #34243 ReflectionClass::getDocComment() returns no result 2005-09-21 09:56:51 +00:00
foobar
916815b779 Bump up the year 2005-08-03 13:30:58 +00:00
Dmitry Stogov
343af548a6 Fixed SIGSEGV on 'global ${"{$blah}_ID"};' 2005-07-04 13:24:46 +00:00
Dmitry Stogov
0a44789bf3 Fixed bug #30961 (Wrong linenumber in ReflectionClass getStartLine()) 2005-06-08 06:49:01 +00:00
Zeev Suraski
d33500ee20 Thought I committed it ages ago... Anyway, without further delays, the final
__halt_compiler() patch
2005-06-04 16:16:19 +00:00
Dmitry Stogov
1a72341328 Added array type hinting. (This patch requires full re-make) 2005-05-26 13:46:17 +00:00
Marcus Boerger
a29f5391db - Cleanup foreach handling 2005-02-11 22:26:45 +00:00
Dmitry Stogov
fc96c7f7fa foreash($a as $key => $val) optimization
Removed temorary array creation on each iteration.
2005-02-07 16:09:54 +00:00
Marcus Boerger
2d13dd0ef0 - Remove part of the cleanup which causes a problem with unnormal code
like tests/lang/040.phpt
# However there is a memleak introduced somewhen after august 04 for such
# code now, 5.0 and 4.3 are fine though.
2005-02-07 15:22:38 +00:00
Marcus Boerger
662cd8262e - Cleanup foreach statement 2005-02-05 14:01:59 +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
Sebastian Bergmann
6ccbb6b51b ZTS fix. 2004-09-16 05:43:29 +00:00
Andi Gutmans
d8efe626b5 - Fix bug #27669 (Dmitry).
Fixes:
<?
        class A
        {
                function hello()
                {
                        echo "Hello World\n";
                }
        }
        $y[0] = 'hello';
        A::$y[0]();
?>
2004-09-16 00:40:38 +00:00
Marcus Boerger
dc7cb19993 - Remove all for now
# - the optimization part can be done in apc or compareable products
# - NULL can be reintroduced later when needed
2004-08-02 16:38:09 +00:00
Sara Golemon
d96e7a170c Revert goto opcode 2004-07-29 17:45:31 +00:00
Sara Golemon
5865b3680a Add goto operator by popular request. 2004-07-29 15:23:47 +00:00
Marcus Boerger
86d46f7cc1 - Speed up by making null/false/true reserved word which allows to drop
an opcode (FETCH_CONSTANT) for every usage.
2004-07-16 06:50:57 +00:00
Andi Gutmans
173782b73e - Fix bug #27283 - Exceptions where the last catch() statement was sometimes
- skipped.
2004-04-20 14:14:55 +00:00
Stanislav Malyshev
1293330175 check writability on =& too 2004-03-28 16:37:57 +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
059c533b4a Fix __METHOD__ (noticed by Davey Sahfik) 2004-02-26 19:59:49 +00:00
Andi Gutmans
4f05437e08 - Improve precendence:
<?php

$obj->foo = "Blah";

if (!$obj instanceof StdClass) {
    print "No";
} else {
    print "Yes";
}
2004-02-23 18:17:16 +00:00
Andi Gutmans
4a14e5c30d - Decrease precedence of instanceof so that the following is true:
php -r 'var_export((object)1 instanceof stdClass);';
Patch by Jan Lehnardt
2004-02-23 08:40:39 +00:00
Marcus Boerger
c6cbafa273 Fix: <interface> [extends <interface> [, <ineterface>]* ] 2004-02-11 22:13:39 +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
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
8e30d96ad8 Redesign the clone() feature to fix some fundamental flaws in the previous
implementation.

Using clone directly is now done using
$replica = clone $src;

Clone methods must now be declared as follows:
function __clone($that)
{
}

Clone methods in derived classes can call the __clone method of their parent
classes using parent::__clone($that)
2004-02-02 12:28:19 +00:00
Andi Gutmans
ac5d5c7f35 - Re-allow conditional class declerations. Needless to say that I also
- think it's not great coding.. Use polymorphism instead :)
2004-01-11 19:37:15 +00:00
Andi Gutmans
6b87194bd9 - - A belated happy holidays (by two years) 2004-01-08 08:23:23 +00:00
Marcus Boerger
885eafac61 Fixed bug #26065 (Crash when nesting classes) 2003-12-27 22:59:49 +00:00
Andi Gutmans
535653ee8e - Nuke another rule (thanks to Jan for noticing this) 2003-12-19 14:39:17 +00:00
Andi Gutmans
f9f19c99b3 - Nuke unused code 2003-12-19 13:35:42 +00:00
Andi Gutmans
c0df450203 - Add E_STRICT, to be used to warn purists (like Jani :) 2003-11-18 09:25:04 +00:00
Andi Gutmans
530789987f - Head up! I'm reverting the patch which allows for expressions in constant
- declerations. Allowing the access of other constants in this code is
- flawed. We are reverting back to PHP 4's static scalars.
- Don't worry if you get the following msg when compiling:
- "zend_language_parser.y contains 3 useless nonterminals and 22 useless rules"
- I didn't nuke the code in case we have some brilliant ideas after beta 2
2003-10-28 23:44:23 +00:00
Andi Gutmans
df033b58a0 - Nuke const in function parameters. I just can't remember why this exists
- and it seems no one else remembers either. It has no semantic meaning.
2003-10-19 08:38:48 +00:00
Zeev Suraski
2ab30d7133 Allow foo::$bar() 2003-10-09 13:44:44 +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
03b6af07eb Support references in foreach()
Syntax:
  foreach ($arr as &$val)
  foreach ($arr as $key => &$val)
2003-07-24 12:38:33 +00:00
Zeev Suraski
cbec89a358 Fix complex expressions for class names in NEW 2003-06-22 10:50:43 +00:00
Zeev Suraski
f263aecc8e Simplify 2003-06-22 10:12:25 +00:00
Marcus Boerger
c8bebdaf67 WS 2003-06-21 21:56:44 +00:00
Marcus Boerger
60c7abac61 Add final classes 2003-06-21 21:56:06 +00:00
Stanislav Malyshev
8cd9792375 Fix bug #23384 - static class::constant constants should now
work in static & array expressions.
2003-06-15 13:58:50 +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
Stanislav Malyshev
f7f5a5ea6b MEGA-patch: namespaces are R.I.P. 2003-06-02 12:13:11 +00:00
Marcus Boerger
21d32c2430 Fix ~ operator in class constants. 2003-05-29 19:27:11 +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
Zeev Suraski
65f06d8027 Revert Harald's commit 2003-04-10 04:43:42 +00:00
George Schlossnagle
dd090f4a77 One line fix so that it will compile 2003-04-10 03:11:27 +00:00
Harald Radi
07e775bcde removing the *syntactical sugar* again
# commiting that on behalf of the community :)
# don't blame me, i'm just acting as a proxy
2003-04-09 20:23:06 +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
59af205988 Add __NAMESPACE__ auto-constant. 2003-04-01 09:22:41 +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
Andrei Zmievski
52372c31cd Since zend_do_begin_class_member_function_call assumes the previous
opcode is FETCH_CONSTANT, swap the calls around.
2003-03-30 18:51:04 +00:00
Stanislav Malyshev
43e87093c1 Un-nest namespaces - now namespace X { namespace Y {} } is a parse error
Also refine namespaced includes
2003-03-26 20:42:23 +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
12cbee7b05 Optimize 2003-03-09 22:23:27 +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
a89abf9162 Add ability to use ::interface_name in implements 2003-03-09 17:07:15 +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