Commit Graph

240 Commits

Author SHA1 Message Date
Xinchen Hui
0a7395e009 Happy New Year 2013-01-01 16:28:54 +08:00
Dmitry Stogov
65585b3aa2 Fixed compiler reenterability 2012-11-14 17:45:10 +04:00
Felipe Pena
79961dccab - Fixed Windows build 2012-04-30 15:55:57 -03:00
Felipe Pena
3120387617 - Changed last commit to use VK_ESCAPE on Windows 2012-04-30 10:31:49 -03:00
Felipe Pena
cc5b995c78 - Fixed bug #61827 (incorrect \e processing on Windows) patch by: ab@php.net 2012-04-29 19:35:52 -03:00
Pierrick Charron
f7cd0588a9 Fixed bug #61225 (Lexing 0b0*+<NUM> incorectly) 2012-03-02 02:36:31 +00:00
Etienne Kneuss
c51f737994 Fix #61095 (Lexing 0x0*+<NUM> incorrectly) 2012-02-20 18:28:57 +00:00
Dmitry Stogov
b515bfbdfb Improved traits implementation. Now to support __CLASS__ constant in traits php doesn't have to copy the complete compiled method, but can reuse the same code. The resolution of __CLASS__ constants in methods defined in traits are delayed till run-time. This approach also made possible to use __CLASS__ constant as default value for traits properties and method arguments. 2012-01-17 08:09:13 +00:00
Nuno Lopes
8b23cae172 fix memory leak in compile_string when there's a parse error (used e.g. in eval or assert) 2012-01-01 22:45:58 +00:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
a89f1d3cfa - Fixed bug #60350 (No string escape code for ESC (ascii 27), normally \e)
patch by: php at mickweiss dot com
2011-11-30 19:42:59 +00:00
Dmitry Stogov
4a25a7740d Fixed ZE specific compile warnings (Bug #55629) 2011-09-13 13:29:35 +00:00
Etienne Kneuss
f6c2b4776c Fix bug #55445 (Incomplete implementation of <?= being independant of short_open_tag) 2011-08-17 23:50:04 +00:00
Hannes Magnusson
550980cfe5 Callable typehint following the rules of is_callable($arg, false); 2011-08-16 10:44:47 +00:00
Derick Rethans
3ed828a892 - Fixed bug #55378: binary number literal returns float number though its value
is enough small
2011-08-07 17:36:31 +00:00
Stefan Marr
65cbcb3be9 Fixed Bug #55214 use of __CLASS__ within trait returns trait name not class name [TRAITS] [DOC] 2011-07-31 18:18:56 +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
Pierre Joye
6e4435d628 - add binary suport, FR #50638, as defined in RFC https://wiki.php.net/rfc/binnotation4ints, patch by Jonah Harris 2011-07-27 00:14:02 +00:00
Felipe Pena
0372e6ad80 - Improved parse error messages 2011-06-23 23:00:53 +00:00
Stanislav Malyshev
e18618905c scalar types cleanup 2011-06-03 01:09:32 +00:00
Rasmus Lerdorf
c24ef71e63 Decouple <?= from the short_tags setting and make it always enabled 2011-05-19 16:26:29 +00:00
Rasmus Lerdorf
a546b3207f oops, can't use that macro here 2011-05-16 17:26:10 +00:00
Rasmus Lerdorf
a5eeecb13f Suppress a dozen unused return value warnings in places where the return
value is really not useful to us.
2011-05-16 17:22:41 +00:00
Stanislav Malyshev
516c2f5920 removing scalar types in trunk 2011-05-15 00:36:13 +00:00
Felipe Pena
9e05a9ad13 - Removed unused variable (Pierrick) 2011-04-03 17:20:34 +00:00
Dmitry Stogov
bbc879b587 Fixed multibyte related issues 2011-03-14 16:00:59 +00:00
Moriyoshi Koizumi
cdb9ee0d1a Fix zend.multibyte oddities. Hope this will address all the known problems. 2011-03-06 07:00:30 +00:00
Ilia Alshanetsky
7a2157cf37 Fixed Bug #53629 (memory leak inside highlight_string()). 2011-01-03 14:39:48 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Felipe Pena
7c9fb17d00 - Fix build 2010-12-20 12:41:35 +00:00
Moriyoshi Koizumi
a304a0fc04 - Avoid allocating extra buffers. This makes parsing with zend.multibyte enabled as fast as with it disabled. 2010-12-20 03:16:09 +00:00
Moriyoshi Koizumi
bbf3d43c1e * Refactor zend_multibyte facility.
Now mbstring.script_encoding is superseded by zend.script_encoding.
2010-12-19 16:36:37 +00:00
Dmitry Stogov
ab93d8c621 Added multibyte suppport by default. Previosly php had to be compiled with --enable-zend-multibyte. Now it can be enabled or disabled throug zend.multibyte directive in php.ini 2010-11-24 05:41:23 +00:00
Pierre Joye
1d04f413cf - NULL deref fix, patch by Gustavo 2010-11-17 16:46:19 +00:00
Dmitry Stogov
f2df6a4a3e - Improved memory usage
. zend_function.pass_rest_by_reference is replaced by
    ZEND_ACC_PASS_REST_BY_REFERENCE in zend_function.fn_flags
  . zend_function.return_reference is replaced by ZEND_ACC_RETURN_REFERENCE
    in zend_function.fn_flags
  . zend_arg_info.required_num_args removed. it was needed only for internal
    functions. Now the first arg_info for internal function (which has special
    meaning) is represented by zend_internal_function_info structure.
  . zend_op_array.size, size_var, size_literal, current_brk_cont,
    backpatch_count moved into CG(context), because they are used only during
    compilation.
  . zend_op_array.start_op is moved into EG(start_op), because it's used
    only for 'interactive' execution of single top-level op-array.
  . zend_op_array.done_pass_two is replaced by ZEND_ACC_DONE_PASS_TWO in
    zend_op_array.fn_flags.
  . op_array.vars array is trimmed (reallocated) during pass_two.
  . zend_class_entry.constants_updated is replaced by
     ZEND_ACC_CONSTANTS_UPDATED in zend_class_entry.ce_flags
  . the size of zend_class_entry is reduced by sharing the same memory space
    by different information for internal and user classes.
    See zend_class_inttry.info union.
2010-09-15 07:38:52 +00:00
Felipe Pena
f6f0f65b9c - Fixed bug #48930 (__COMPILER_HALT_OFFSET__ incorrect in PHP >= 5.3) 2010-06-30 02:45:10 +00:00
Felipe Pena
f2419953d9 - MF5.3: Reverted fix for bug #48930 (due binary compatibility breakage)
# To commit a new common fix
2010-06-30 02:30:14 +00:00
Felipe Pena
3396a6d185 - Fixed bug #48930 (__COMPILER_HALT_OFFSET__ incorrect in PHP >= 5.3) 2010-06-27 21:46:16 +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
Ilia Alshanetsky
ab9de550e2 Allow arbitrary number of space characters between type-hint and method/function parameter 2010-05-23 18:09:32 +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
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
3defe76254 sed -i "s#1998-2009#1998-2010#g" **/*.re **/*.y **/*.l 2010-01-05 20:40:23 +00:00
Felipe Pena
5dd6b9ffa9 - Fixed bug #50145 (crash while running bug35634.phpt) 2009-11-17 11:18:40 +00:00
Matt Wilmas
09034cf3f4 MFH: Implemented manual scanning for strings/comments, plus misc. fixes 2009-05-05 01:35:44 +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
Dmitry Stogov
bcd9099b28 Fixed bug #47038 (Memory leak in include) 2009-03-25 15:23:58 +00:00
Brian Shire
dd031eee68 MFH: Fix scanner handling of NULL values in heredoc, nowdoc, strings, comments, and non-parsed content. 2009-03-16 01:40:14 +00:00
Brian Shire
9c16bfa194 MFH: Add proper EOF handling for language scanner. Fixes bug #46817. 2009-03-11 22:11:53 +00:00