Commit Graph

698 Commits

Author SHA1 Message Date
Dmitry Stogov
f4cfaf36e2 Use better data structures (incomplete) 2014-02-10 10:04:30 +04:00
Xinchen Hui
0f53e37494 Merge branch 'PHP-5.6' 2014-01-03 11:09:07 +08:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Xinchen Hui
47c9027772 Bump year 2014-01-03 11:06:16 +08:00
Xinchen Hui
c0d060f5c0 Bump year 2014-01-03 11:04:26 +08:00
Kalle Sommer Nielsen
d14670ccdb Eliminate another TSRMLS_FETCH() in i_zend_is_true()
# Affected extensions have all been updated, ext/opcache and ext/zip
# both have macros for cross version compatibility
2013-12-18 07:25:05 +01:00
Dmitry Stogov
5a87b7ff39 Fixed bug #66252 (Problems in AST evaluation invalidating valid parent:: reference. Constant expessions have to be evaluated in context of defining class). 2013-12-10 14:19:17 +04:00
Dmitry Stogov
2cb0e1e4c1 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Added validation of class names in the autoload process

Conflicts:
	NEWS
2013-11-29 12:55:11 +04:00
Dmitry Stogov
967abd6153 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Added validation of class names in the autoload process
2013-11-29 12:54:22 +04:00
Dmitry Stogov
2d31eadbbf Added validation of class names in the autoload process 2013-11-29 12:53:02 +04:00
Dmitry Stogov
9647c61dc1 Constant expressions refactoring 2013-11-06 22:21:07 +04:00
Bob Weinand
b45043a1b7 converted several switches to ifs and made more opcache friendly 2013-11-01 16:16:58 +01:00
Bob Weinand
b56c1ca95e Fatal error about self referencing constants fixed 2013-10-31 19:05:29 +01:00
Bob Weinand
466c5dd1fe Fixed mem leaks, added tests and ternary operator 2013-10-31 18:21:37 +01:00
Bob Weinand
2361745806 Working commit for constant scalar expressions (with constants).
Tests will follow.
2013-10-31 08:57:12 +01:00
Nikita Popov
bdfa03d79d Save a TSRMLS_FETCH() for zval_ptr_dtor in executor
This gives me about 9% improvement on Zend/bench.php for a zts build.
2013-09-14 23:02:26 +02:00
Nikita Popov
96b1c2145c Provide more macros for handling of interned strings
* str_erealloc behaves like erealloc for normal strings, but will
   use emalloc+memcpy for interned strings.
 * str_estrndup behaves like estrndup for normal strings, but will
   not copy interned strings.
 * str_strndup behaves like zend_strndup for normal strings, but
   will not copy interned strings.
 * str_efree_rel behaves like efree_rel for normal strings, but
   will not free interned strings.
 * str_hash will return INTERNED_HASH for interned strings and
   compute it using zend_hash_func for normal strings.
2013-09-13 19:42:10 +02:00
Nikita Popov
0856714576 Always pass return_value_ptr to internal functions
Previous some places passed return_value_ptr only if the function
returned by reference. Now return_value_ptr is always set, even
for functions returning by-value.

This allows you to return zvals without copying their contents. For
this purpose two new macros RETVAL_ZVAL_FAST and RETURN_ZVAL_FAST
are added:

    RETVAL_ZVAL_FAST(zv); /* Analog to RETVAL_ZVAL(zv, 1, 0) */
    RETURN_ZVAL_FAST(zv); /* Analog to RETURN_ZVAL(zv, 1, 0) */

These macros behave similarly to the non-FAST versions with
copy=1 and dtor=0, with the difference that the FAST versions
will try return the zval without copying by utilizing return_value_ptr.
2013-08-31 13:16:41 +02:00
Stanislav Malyshev
c793a65690 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  non living code related typo fixes

Conflicts:
	Zend/zend_compile.c
2013-08-04 16:06:24 -07:00
Veres Lajos
8d86597d73 non living code related typo fixes 2013-08-04 16:05:36 -07:00
Xinchen Hui
e89537f2a3 Merge branch 'PHP-5.4' into PHP-5.5 2013-06-05 17:30:09 +08:00
Xinchen Hui
f597f5561e Merge branch 'PHP-5.3' into PHP-5.4 2013-06-05 17:26:10 +08:00
Xinchen Hui
3c87945c95 Fixed bug #64960 (Segfault in gc_zval_possible_root) 2013-06-05 17:25:00 +08:00
Dmitry Stogov
6e8aa09696 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #64529 (Ran out of opcode space)

Conflicts:
	NEWS
	Zend/zend_execute_API.c
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner_defs.h
2013-03-28 00:08:11 +04:00
Dmitry Stogov
85e5e60777 Fixed bug #64529 (Ran out of opcode space) 2013-03-28 00:03:40 +04:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Xinchen Hui
0a7395e009 Happy New Year 2013-01-01 16:28:54 +08:00
Xinchen Hui
831fbcf385 Happy New Year 2013-01-01 16:23:31 +08:00
Dmitry Stogov
438cd86378 Removed unnecessary checks 2012-12-13 17:29:30 +04:00
Dmitry Stogov
ff1e1d7a8e Removed redundand checks from release build 2012-12-13 14:46:44 +04:00
Dmitry Stogov
7651d64556 Optimized access to temporary and compiled VM variables 2012-12-04 10:14:39 +04:00
Dmitry Stogov
70f83f35d0 . The VM stacks for passing function arguments and syntaticaly nested calls were merged into a single stack. The stack size needed for op_array execution is calculated at compile time and preallocated at once. As result all the stack push operatins don't require checks for stack overflow any more.
. Generators implementation was improved using the new VM stack. Now it's a bit more clear and faster.
2012-11-30 13:39:23 +04:00
Stanislav Malyshev
531e2533dd Use zend_execute_internal always to call internal functions 2012-10-05 08:14:20 +02:00
Stanislav Malyshev
bda93f5405 use zend_execute_internal 2012-10-04 22:43:13 -07:00
Nikita Popov
526db7db14 Replace code with zend_clean_and_cache_symbol_table() call
I replaced other instances of this code with the function call, but missed
this one.
2012-09-16 21:54:48 +02:00
Nikita Popov
c9709bfbd7 Remove asterix modifier (*) for generators
Generators are now automatically detected by the presence of a `yield`
expression in their body.

This removes the ZEND_SUSPEND_AND_RETURN_GENERATOR opcode. Instead
additional checks for ZEND_ACC_GENERATOR are added to the fcall_common
helper and zend_call_function.

This also adds a new function zend_generator_create_zval, which handles
the actual creation of the generator zval from an op array.

I feel like I should deglobalize the zend_create_execute_data_from_op_array
code a bit. It currently changes EG(current_execute_data) and
EG(opline_ptr) which is somewhat confusing (given the name).
2012-07-20 16:09:06 +02:00
Xinchen Hui
eac33b454c Typo when merging from trunk 2012-03-11 15:31:19 +00:00
Xinchen Hui
a38ffd5705 Fixed bug #61273 (call_user_func_array with more than 16333 arguments leaks / crashes) 2012-03-11 15:28:31 +00:00
Xinchen Hui
b7ae5e0d86 Fixed bug #61273 (call_user_func_array with more than 16333 arguments leaks / crashes) 2012-03-11 15:28:31 +00:00
Xinchen Hui
7536bf963d Fixed bug #61273 (call_user_func_array with more than 16333 arguments leaks / crashes) 2012-03-11 15:28:31 +00:00
Xinchen Hui
5f99d789b5 MFH: Fixed bug #60978 (exit code incorrect) 2012-03-02 03:25:41 +00:00
Xinchen Hui
27df8b6ff0 Revert -r319102 and -r322922 in 5.4 branch since they introduce #60978
Fixed #60978 in trunk without reverting previous fix
#see http://news.php.net/php.internals/57789
2012-02-08 03:03:05 +00:00
Xinchen Hui
ff63c09e6f Revert -r319102 and -r322922 in 5.4 branch since they introduce #60978
Fixed #60978 in trunk without reverting previous fix
#see http://news.php.net/php.internals/57789
2012-02-08 03:03:05 +00:00
Derick Rethans
33863b2cf8 - Reinstated correct return values after David's fix for #60218. 2012-01-29 15:25:40 +00:00
Derick Rethans
2c1285a573 - Reinstated correct return values after David's fix for #60218. 2012-01-29 15:25:40 +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
Dmitry Stogov
032d140fd6 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
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
Dmitry Stogov
f7278c161f Fixed bug #60138 (GC crash with referenced array in RecursiveArrayIterator) 2011-11-18 12:43:53 +00:00
David Soria Parra
ce06b4397c Fix #60218 (instantiating unknown class leads to memory leak in cli) 2011-11-12 17:05:08 +00:00
David Soria Parra
c4d5231a36 Fix #60218 (instantiating unknown class leads to memory leak in cli) 2011-11-12 17:05:08 +00:00
Arnaud Le Blanc
ea5a61e39b Improved ternary operator performance when returning arrays 2011-10-18 19:42:42 +00:00
Arnaud Le Blanc
07b7ba8b40 Improved ternary operator performance when returning arrays 2011-10-18 19:42:42 +00:00
Dmitry Stogov
4a25a7740d Fixed ZE specific compile warnings (Bug #55629) 2011-09-13 13:29:35 +00:00
Dmitry Stogov
e43ff1359e Fixed ZE specific compile warnings (Bug #55629) 2011-09-13 13:29:35 +00:00
Pierre Joye
d566f0c88e - fix build when no zend signal support 2011-09-08 09:17:21 +00:00
Pierre Joye
f20e705760 - fix build when no zend signal support 2011-09-08 09:17:21 +00:00
Rasmus Lerdorf
ca2234d18c Make timeouts work again for shutdown functions.
Fixes the faling lang/045 test
2011-09-07 18:48:17 +00:00
Rasmus Lerdorf
2af36bd041 Make timeouts work again for shutdown functions.
Fixes the faling lang/045 test
2011-09-07 18:48:17 +00:00
Rasmus Lerdorf
80931fee0c Since we have fci_cache = &fci_cache_local inside that block
and fci_cache is then later used outside the block, fci_cache_local
can't be block-scoped here
2011-08-07 00:50:46 +00:00
Rasmus Lerdorf
c44c0490d5 Since we have fci_cache = &fci_cache_local inside that block
and fci_cache is then later used outside the block, fci_cache_local
can't be block-scoped here
2011-08-07 00:50:46 +00:00
Ilia Alshanetsky
34d93f0c06 Zend Signal Handling 2011-06-22 14:23:21 +00:00
Ilia Alshanetsky
939875133a Zend Signal Handling (see RFC: https://wiki.php.net/rfc/zendsignals)
This needs to go into 5.4 as well, but will wait for Pierre to review win32 situation

# Patch by Lucas Nealan, Arnaud Le Blanc, Brian Shire & Ilia Alshanetsky
2011-06-02 21:16:50 +00:00
Dmitry Stogov
5dcdf5c467 Fixed bug #54367 (Use of closure causes problem in ArrayAccess) 2011-05-11 06:58:33 +00:00
Dmitry Stogov
92e5b10c41 Fixed bug #54268 (Double free when destroy_zend_class fails) 2011-04-15 12:43:20 +00:00
Dmitry Stogov
50ce16deff Fixed bug #54268 (Double free when destroy_zend_class fails) 2011-04-15 12:43:20 +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
b88f7753a1 Fixed bug #52939 (zend_call_function does not respect ZEND_SEND_PREFER_REF) 2010-10-13 08:51:39 +00:00
Dmitry Stogov
f4173a8ece Fixed bug #52939 (zend_call_function does not respect ZEND_SEND_PREFER_REF) 2010-10-13 08:51:39 +00:00
Dmitry Stogov
d3b6fbe39b Fixed bug #52940 (call_user_func_array still allows call-time pass-by-reference). (cataphract@php.net) 2010-10-01 11:53:04 +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
Dmitry Stogov
f0c8366a9e - use interned strings for auto globals
- $GLOBALS became a JIT autoglobal, so it's initialized only if used (this may affect opcode caches)
2010-07-08 14:05:11 +00:00
Dmitry Stogov
1a1178a685 eliminated unnecessary iterations during request startup/shutdown 2010-07-06 11:40:17 +00:00
Felipe Pena
c4be9c3890 - Fixed bug #51905 (ReflectionParameter fails if default value is an array with an access to self::) 2010-05-26 00:00:58 +00:00
Felipe Pena
79d2aaf0f1 - Fixed bug #51905 (ReflectionParameter fails if default value is an array with an access to self::) 2010-05-26 00:00:58 +00:00
Dmitry Stogov
3c179430ec Fixed crash in Zend/tests/unset_cv09.phpt 2010-04-26 13:51:46 +00:00
Antony Dovgal
a9a55f77c0 fix WS 2010-04-23 09:11:44 +00:00
Dmitry Stogov
f06d839e59 Use fast class fetch function 2010-04-23 08:56:03 +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
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
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
cf4ea31bff fix #51394 - try harder to find script lineno when exception happens 2010-04-01 19:36:56 +00:00
Stanislav Malyshev
a3857fd963 fix #51394 - try harder to find script lineno when exception happens 2010-04-01 19:36:56 +00:00
Felipe Pena
c302509726 - Fixed bug #50731 (Inconsistent namespaces sent to functions registered with spl_autoload_register) 2010-03-03 00:15:34 +00:00
Pierre Joye
5eb4db5e8f - Ensure that stderr output are not buffered, portability for tests 2010-01-25 14:47:19 +00:00
Sebastian Bergmann
d2281d1dff sed -i "s#1998-2009#1998-2010#g" **/*.c **/*.h **/*.php 2010-01-05 20:46:53 +00:00
Stanislav Malyshev
fc1e17ee76 fix regression bug #50394: Reference argument converted to value in __call 2009-12-18 19:12:11 +00:00
Dmitry Stogov
10b30b51bc Fixed unnecessary invokation of setitimer when timeouts have been disabled (Arvind Srinivasan) 2009-11-05 09:33:19 +00:00
Moriyoshi Koizumi
b91e3db105 - WS fix (spaces to tabs) 2009-09-15 00:09:13 +00:00
Stanislav Malyshev
d6ba6c69fb fix crash when unexpectedly passed by-ref parameter is modified 2009-08-18 20:51:49 +00:00
Stanislav Malyshev
9fd8469e94 fix for bug #49000 2009-07-30 05:01:53 +00:00
Matt Wilmas
d55300298e MFH: Added zend_eval_stringl and made create_function(), etc. binary-safe 2009-06-05 18:50:32 +00:00
Matt Wilmas
b907aa4331 MFH:
Restored double->long conversion behavior to that of PHP 5.2 (on most platforms) and prior:
 * Out-of-range numbers overflow/preserve least significant bits (no LONG_MAX/MIN limit)
 * See bug #42868 (presumably-rare platform with different results in 5.2)
 * On 32-bit platforms with 64-bit long type, a zend_long64 cast has been added,
    otherwise it's the same as 5.2
 * Use this conversion method everywhere instead of some plain (long) casts

Added 'L' parameter parsing specifier to ensure a LONG_MAX/MIN limit:
 * Essentially what 5.3's new conversion was doing in most cases
 * Functions with "limit" or "length" type params could be updated to use this,
    and prevent confusing overflow behavior with huge numbers (*also* in 5.2)
  - See bug #47854, for example; or even #42868 again

# Test updates coming
2009-06-04 18:20:45 +00:00
Dmitry Stogov
c8e5bc5988 Calculate hash value once 2009-04-08 13:17:58 +00:00
Matt Wilmas
021e5d168f MFH: Removed extra space from eval string 2009-03-19 18:34:16 +00:00
Dmitry Stogov
c6e55db534 Forgotten include 2009-03-18 10:41:39 +00:00
Dmitry Stogov
31c0af245e Fixed floating point mathematic speed degradation (Christian) 2009-03-18 10:18:10 +00:00
Felipe Pena
2bc612bc0c - Fixed typo 2009-03-05 16:49:47 +00:00
Felipe Pena
c43b935b65 - MFH: Fixed bug #47572 (zval_update_constant_ex: Segmentation fault) 2009-03-05 16:25:43 +00:00
Dmitry Stogov
c277ebc6c8 Fixed bug #47320 ($php_errormsg out of scope in functions) 2009-02-09 09:20:35 +00:00
Marcus Boerger
2aba368462 - MFH Catch exceptions in cli -a 2009-01-02 13:14:49 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Dmitry Stogov
7d4fd3fd38 Fixed bug #46409 (__invoke method called outside of object context when using array_map) 2008-11-27 19:01:23 +00:00
Felipe Pena
8f32490ca3 - Fixed bug #46665 (Triggering autoload with a variable classname causes truncated autoload param) 2008-11-25 21:14:23 +00:00
Etienne Kneuss
3919b16f04 MFH: Fix #46241 (stacked error_handlers, error_handling in general) 2008-11-19 02:00:53 +00:00
Antony Dovgal
512b812761 make sure the slash is actually thre before reading past it 2008-11-12 09:05:48 +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
Felipe Pena
2f26deb0e0 - Fixed Windows build 2008-11-05 11:00:38 +00:00
Marcus Boerger
7126de4912 - Next step in namespaces, using / as namespace separator. 2008-11-04 15:58:55 +00:00
Etienne Kneuss
b879459973 MFH: Use enum alternative instead of explicit value 2008-10-02 19:54:03 +00:00
Antony Dovgal
f5b09f1907 MFH: initialize variable 2008-10-01 14:31:01 +00:00
Dmitry Stogov
e46d328934 Fixed bug #46106 (Memory leaks when using global statement) 2008-09-17 15:11:28 +00:00
Etienne Kneuss
6ebc3a8b9b MFH: Fix #45656 (new Class silenting exceptions in autoloaders) 2008-09-15 10:19:53 +00:00
Dmitry Stogov
03f4121452 Fixed bug #45910 (Cannot declare self-referencing constant) 2008-08-26 08:38:26 +00:00
Marcus Boerger
32f9d0e180 - MFH Improve exception linking 2008-08-14 10:24:52 +00:00
Nuno Lopes
f87d4530c2 mark empty_fcall_info and empty_fcall_info_cache as constant. a few less bytes in the dirty page :P 2008-08-12 21:45:52 +00:00
Marcus Boerger
3053a62621 - MFH Fix shutdown order 2008-08-11 17:44:15 +00:00
Marcus Boerger
3f7a4b7e90 - MFH error handling, now with save, replace, restore 2008-08-08 17:47:31 +00:00
Marcus Boerger
5a59d41305 - MFH store error handling mode on stack when executing internal
or overloaded functions and methods. [...]
2008-08-08 13:21:52 +00:00
Dmitry Stogov
37a769353f Fixed bug #44100 (Inconsistent handling of static array declarations with duplicate keys). 2008-08-01 14:22:03 +00:00
Dmitry Stogov
64c721e04e *** empty log message *** 2008-07-26 19:14:38 +00:00
Dmitry Stogov
8ee5b58bbe Added checks for destroied objects 2008-07-26 18:32:20 +00:00
Dmitry Stogov
b25f9f6a6a Added support for overloaded functions (e.g. COM) in call_user_func(). 2008-07-26 17:01:40 +00:00
Dmitry Stogov
af05ce0af6 Fixed is_callable/call_user_func mess that had done different things for very similar arguments e.g. array("A","B") and "A::B" 2008-07-26 13:14:04 +00:00
Dmitry Stogov
691d4a6999 Fixed uninitialised data 2008-07-25 08:23:07 +00:00
Dmitry Stogov
feb8580166 LSB parent/self forwarding 2008-07-24 09:42:18 +00:00
Dmitry Stogov
d5ef2f466c Added support for lambda functions and closures 2008-07-14 09:49:03 +00:00
Felipe Pena
2af92fa836 - Fixed bug #45180 ('class::method' works differently than array('class', 'method')) 2008-06-05 18:50:29 +00:00
Felipe Pena
cc23d3bade - Fixed bug #45089 (__callStatic $name case sensitivity) 2008-06-03 18:11:12 +00:00
Dmitry Stogov
5521912b15 Use IS_CV for dirrent access to $this variable 2008-05-07 12:04:39 +00:00
Dmitry Stogov
0639a847ce Use lazy symbol table initialization for op_arrays called from internal php functions 2008-05-06 17:00:56 +00:00
Dmitry Stogov
833e01343d GC fix 2008-05-06 16:03:16 +00:00
Dmitry Stogov
3a86a06619 Added missing lazy initialization 2008-04-29 09:18:26 +00:00
Dmitry Stogov
2ecf4bb0a7 Lazy EG(active_symbol_table) initialization 2008-04-29 08:15:20 +00:00
Dmitry Stogov
d9dd1b9e14 Optimized ZEND_RETURN opcode to not allocate and copy return value if it is not
used.
2008-04-11 09:43:28 +00:00
Felipe Pena
f66f55edc5 MFH: Implemented "jump label" operator (limited "goto")
[DOC]
2008-03-28 14:35:01 +00:00
Rasmus Lerdorf
ea790cef01 On Windows I guess there is no point starting the timeout thread until
we actually have a timeout value.
2008-03-19 15:30:49 +00:00
Rasmus Lerdorf
d2f23dbe64 Make sure we set the signal handler when reset_signals is true, regardless
of the actual timeout value.
2008-03-19 15:22:17 +00:00
Rasmus Lerdorf
6c158374ba exit_on_timeout patch
After the sigsetjmp change, this is patch #2 in an effort to get some
sanity restored to signal handling in PHP.

This patch does two things.  First, it makes it possible to reset the
timeout without resetting the signal handlers.  This is important for
cases where an extension may have deferred signals in its MINIT in order
to implement critical sections. It also lays the groundwork for cleaning
up our signal handling and perhaps eventually implementing our own
signal deferring mechanism so we can have true critical sections.

The second thing this does is to make it possible to terminate the current
child process (only for Apache1 at the moment) on a timeout.  There are
a number of extensions that are unhappy about being longjmp'ed out of
and when this happens on a timeout they are left in an inconsistent state.
By turning on exit_on_timeout you can now force the process to terminate
on a timeout which will clean up any hanging locks and/or memory left
hanging after the longjmp.
2008-03-18 21:42:50 +00:00
Felipe Pena
2b10c53ae1 MFH: Dropped zend.ze1_compatibility_mode
[DOC]
2008-03-18 14:10:45 +00:00
Dmitry Stogov
8c885b8913 Implemented concept of "delayed early binding" that allows opcode caches to perform class declaration (early and/or run-time binding) in exactly the same order as vanila php.
The following pseudo-code explains how it should be used in opcode cache.

function cache_compile_file($filename) {
        if (!is_cached($filename)) {
                ...
                orig_compiler_options = CG(compiler_optins);
                CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES |
                                        ZEND_COMPILE_DELAYED_BINDING;
                $op_array = orig_compile_file($filename);
                CG(compiler_options) = orig_copiler_options;
                ...
        } else {
                $op_array = restore_from_cache($filename);
        }
        zend_do_delayed_early_binding($op_array);
}
2008-03-18 08:36:30 +00:00
Antony Dovgal
1f3b8cccc4 %v -> %s, this is 5_3 2008-03-09 20:52:29 +00:00
Dmitry Stogov
430e54d457 Fixed shared memory corruption of opcode caches 2008-03-04 11:43:51 +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
Marcus Boerger
da5b979f88 - MFH Add comment that explains why we need E_ERROR in those cases 2008-02-02 15:48:04 +00:00
Marcus Boerger
95a3cccf5f - Fix flag handling in message generation 2008-02-02 13:56:59 +00:00
Dmitry Stogov
9770b3cb00 Fixed bug #43323 (Wrong count abstract methods). (Felipe, Dmitry) 2008-01-29 11:12:57 +00:00
Dmitry Stogov
0b6825102d Changed EG(argument_stack) implementation. 2008-01-24 09:41:39 +00:00
Dmitry Stogov
71592cec06 Added garbage collector 2008-01-22 09:27:48 +00:00
Dmitry Stogov
fa47e900e2 Changed exception handling. Now each op_array doesn't contain ZEND_HANDLE_EXCEPTION opcode in the end 2008-01-21 19:39:55 +00:00
Marcus Boerger
ba8acfdfdf - Fix the fix 2008-01-15 11:47:05 +00:00
Marcus Boerger
22221def71 - Fix memleak (found by colder) 2008-01-14 18:13:12 +00:00
Dmitry Stogov
ed8e2fa031 Added missing warning message 2008-01-10 09:38:23 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Dmitry Stogov
43f6392e90 Fixed bug #43651 (is_callable() with one or more nonconsecutive colons crashes) 2007-12-25 10:58:30 +00:00
Dmitry Stogov
6484b3c458 Fixed bug #43344 (Wrong error message for undefined namespace constant) 2007-12-07 17:11:24 +00:00
Dmitry Stogov
648fbe9d58 Fixed bug #43128 (Very long class name causes segfault) 2007-11-22 13:27:13 +00:00
Johannes Schlüter
45f6b4ce2f - MFH Improved version of ternary shortcut (Marcus) 2007-11-21 09:41:35 +00:00
Dmitry Stogov
c3ab6bd091 Fixed bug #43136 (possible crash on script execution timeout. The EG(function_state_ptr) is completely removed, EG(current_execute_data)->function_state must be used instead) 2007-11-20 09:51:12 +00:00
Jani Taskinen
b489251177 - MFH from HEAD:
. Folding tags
  . Parameter parsing
  . SPL debug info
  . array function improvements (not all yet)
  . Improvements to function calling with call_user_* functions
  . Improvements to debugging info in var_dump/print_r
# I propably forgot already something but this all was pretty close tied
# to each other so it wasn't possible to do it in parts.
2007-11-02 19:40:39 +00:00
Dmitry Stogov
f10766f1fb Reimplemented support for namespaces in indexes id constant arrays (removed zval.idx_type) 2007-11-02 10:11:42 +00:00
Yiduo (David) Wang
4b4d634cb9 MFH: Added macros for managing zval refcounts and is_ref statuses 2007-10-07 05:22:07 +00:00
Dmitry Stogov
eb0c56ada1 Fixed bug #42820 (defined() on constant with namespace prefixes tries to load class). 2007-10-03 10:33:02 +00:00
Dmitry Stogov
220641af70 Fixed bug #42819 (namespaces in indexes of constant arrays) 2007-10-02 08:26:50 +00:00
Dmitry Stogov
3a3a7e7441 Fixed bug #42798 (__autoload() not triggered for classes used in method signature). 2007-10-01 09:32:48 +00:00
Dmitry Stogov
72d0454bf6 Added support for __callstatic() magic method (missing part). (Sara) 2007-09-29 09:34:24 +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
Dmitry Stogov
6c810b0d4c Improved memory usage by movig constants to read only memory. (Dmitry, Pierre) 2007-09-27 18:00:48 +00:00
Jani Taskinen
226c56fe76 MFH: Fixed compiler warnings 2007-07-21 00:35:15 +00:00
Dmitry Stogov
1c7fa8fb4c Fixed bug #41633 (Crash instantiating classes with self-referencing constants) 2007-06-13 16:48:10 +00:00
Dmitry Stogov
28bc39500a Fixed some class constant issues related to bug #41633 2007-06-13 14:50:13 +00:00
Antony Dovgal
04aefb4e18 MFH 2007-05-21 07:12:41 +00:00
Antony Dovgal
d7b30e457a MFH: fix #41421 (Uncaught exception from a stream wrapper segfaults) 2007-05-18 11:52:08 +00:00
Antony Dovgal
de4f3007e2 MFH: initialize retval_ptr_ptr before returning FAILURE
this fixes invalid read in #41209
2007-04-27 08:12:24 +00:00
Dmitry Stogov
e1814f0dbe WIN64 support 2007-04-16 08:09:56 +00:00
Antony Dovgal
79ed194a64 fix #40815 (using strings like "class::func" and static methods in set_exception_handler() might result in crash) 2007-03-15 16:44:12 +00:00
Marcus Boerger
b15d1f22ef - Catch empty class name error earlier 2007-03-03 13:45:14 +00:00
Dmitry Stogov
0291ad5fa6 Fixed bug #40236 (php -a function allocation eats memory) 2007-02-15 10:38:28 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Ilia Alshanetsky
96d9d6f0f1 Avoid strcpy() & strcat() 2006-12-28 00:17:48 +00:00
Antony Dovgal
bed14f8ab7 MFH 2006-12-21 11:08:00 +00:00
Dmitry Stogov
011e0cde62 Start timiout thread on Windows only if necessary 2006-11-10 11:49:35 +00:00
Johannes Schlüter
6841110122 - MFH: added missing return... 2006-10-18 17:04:49 +00:00
Johannes Schlüter
dcf249004c - MFH: Fix #38465 (ReflectionParameter fails if default value is an access to self:: 2006-10-18 16:35:15 +00:00
Antony Dovgal
630024d895 MFH 2006-10-11 16:11:56 +00:00
Dmitry Stogov
ecd52167d7 Fixed wrong return value 2006-09-28 07:16:31 +00:00
Antony Dovgal
d6ee9d4810 MFH: fix #38779 (engine crashes when require()'ing file with syntax error through userspace stream wrapper) 2006-09-11 14:30:08 +00:00
Dmitry Stogov
8bb047ee97 Fixed bug #36759 (Objects destructors are invoked in wrong order when script is finished). 2006-07-12 07:54:00 +00:00
Stefan Esser
7bbf35320d MFH: Added hook for compile_string() 2006-06-13 12:57:48 +00:00
Zeev Suraski
51d495850a Restore ZE1 compatibility mode (Zend Engine part - the modules patches
will follow later today)
2006-06-05 13:58:52 +00:00
Dmitry Stogov
26ccde4da9 Fixed bug #37558 (timeout functionality doesn't work after a second PHP starup on the same thread). (p dot desarnaud at wanadoo dot fr) 2006-05-25 07:46:25 +00:00
Marcus Boerger
637a40423c - MFH as discussed
. zend_exception_get_default() -> zend_exception_get_default(TSRMLS_D)
  . zend_get_error_exception()   -> zend_get_error_exception(TSRMLS_D)
  . added E_RECOVERABLE_ERROR
  . added ZEND_TOSTRING_FUNC_NAME
  . added __tostring function cache to zend_class_entry
  . added ZEND_NAMED_ME
  . modified ZEND_ME_MAPPING to support method flags
  . added ZEND_MN
  . method entries now use prefix "zim_" instead of "zif_"
  . drop EG(ze1_compatibility_mode)
  . changed cast handler, now without (int should_free):
    typedef int (*zend_object_cast_t)(zval *readobj, zval *retval, int type TSRMLS_DC);
  . changed get_iterator, now receives whether value is by ref:
    zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
  . added zend_objects_store_add_ref_by_handle
  . added zend_objects_store_del_ref_by_handle
  . convert_to_explicit_type(pzv, type)
2006-05-09 23:53:23 +00:00
Antony Dovgal
32872b157e there is no %v in 5_1 2006-04-20 22:49:20 +00:00
Dmitry Stogov
d82462485e FIX: For some reason SIGSEGV handler wasn't set, but was restoring. Now all SIGSEGV related code is commented. 2006-03-17 08:47:41 +00:00
Dmitry Stogov
161ae714ae zend_hash_apply() doesn't use ZEND_HASH_APPLY_... macros 2006-03-14 11:24:45 +00:00