Commit Graph

1208 Commits

Author SHA1 Message Date
Nikita Popov
51ea7fc477 Merge branch 'PHP-7.4' 2019-08-23 17:01:49 +02:00
Nikita Popov
8807889ac2 Fix arginfo leak when using disabled_classes
Also remove the hack where scope is set to NULL in order to make
free_internal_arg_info work. Instead explicitly call it for class
methods.

This fixes the asan build for Zend/tests/bug77494.phpt.
2019-08-23 17:00:59 +02:00
Dmitry Stogov
c713f589c1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Initialize static_members_table
2019-07-22 12:03:35 +03:00
Dmitry Stogov
60dca2295d Initialize static_members_table 2019-07-22 12:02:16 +03:00
Dmitry Stogov
0e5ecc7a8f Merge branch 'PHP-7.4'
* PHP-7.4:
  Delay EG(exception) check on slow path
2019-07-08 14:13:02 +03:00
Dmitry Stogov
9a833438d1 Delay EG(exception) check on slow path 2019-07-08 13:56:34 +03:00
Nikita Popov
aa2320b274 Merge branch 'PHP-7.4' 2019-06-28 16:39:57 +02:00
Nikita Popov
3698303540 Fix arginfo leak in disable_functions
Arginfo is allocated if types are used, we need to free it.
2019-06-28 16:38:46 +02:00
twosee
61f78de486 Constify some char* arguments or return values of ZEND_API
Closes GH-4247.
2019-06-12 16:49:32 +02:00
Nikita Popov
e4fae9c061 Merge branch 'PHP-7.4' 2019-06-11 13:16:38 +02:00
Nikita Popov
8f8fcbbd39 Support full variance if autoloading is used
Keep track of delayed variance obligations and check them after
linking a class is otherwise finished. Obligations may either be
unresolved method compatibility (because the necessecary classes
aren't available yet) or open parent/interface dependencies. The
latter occur because we allow the use of not fully linked classes
as parents/interfaces now.

An important aspect of the implementation is we do not require
classes involved in variance checks to be fully linked in order for
the class to be fully linked. Because the involved types do have to
exist in the class table (as partially linked classes) and we do
check these for correct variance, we have the guarantee that either
those classes will successfully link lateron or generate an error,
but there is no way to actually use them until that point and as
such no possibility of violating the variance contract. This is
important because it ensures that a class declaration always either
errors or will produce an immediately usable class afterwards --
there are no cases where the finalization of the class declaration
has to be delayed until a later time, as earlier variants of this
patch did.

Because variance checks deal with classes in various stages of
linking, we need to use a special instanceof implementation that
supports this, and also introduce finer-grained flags that tell us
which parts have been linked already and which haven't.

Class autoloading for variance checks is delayed into a separate
stage after the class is otherwise linked and before delayed
variance obligations are processed. This separation is needed to
handle cases like A extends B extends C, where B is the autoload
root, but C is required to check variance. This could end up
loading C while the class structure of B is in an inconsistent
state.
2019-06-11 13:09:33 +02:00
Nikita Popov
7686b0b889 Merge branch 'PHP-7.4' 2019-06-05 14:53:50 +02:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Joe Watkins
29722c7a0d
Merge branch 'PHP-7.4'
* PHP-7.4:
  Revert "Fix bug #62397 - disable_functions does not work with eval."
2019-06-03 11:20:23 +02:00
Joe Watkins
ff96f25b12
Revert "Fix bug #62397 - disable_functions does not work with eval."
This reverts commit 050d299364.
2019-06-03 11:20:12 +02:00
Nikita Popov
321fe88935 Add Z_PARAM_NUMBER and use it for some functions 2019-06-03 10:14:05 +02:00
Nikita Popov
8a0965e3d6 Remove zpp L specifier
We don't use this internally anymore, and external usages should
be encouraged to move towards 'l'.
2019-06-03 09:39:17 +02:00
Dmitry Stogov
b4a3b49eab Merge branch 'PHP-7.4'
* PHP-7.4:
  Better hot/cold code splitting
2019-05-31 12:22:08 +03:00
Dmitry Stogov
1df9f238fe Better hot/cold code splitting 2019-05-31 12:20:21 +03:00
Nikita Popov
45a0656e95 Remove get() object handler
Now that set() is gone, there is little point in keeping get(), as
it is essentially just a different way of writing cast_object()
now.

Closes GH-4202.
2019-05-29 17:15:19 +02:00
Dmitry Stogov
6d89553c48 Merge branch 'PHP-7.4'
* PHP-7.4:
  Mark "cold" functions
2019-05-29 11:50:27 +03:00
Dmitry Stogov
e14d77335c Mark "cold" functions 2019-05-29 11:48:41 +03:00
Joe Watkins
9f94566ff8
Merge branch 'PHP-7.4'
* PHP-7.4:
  disabled functions must not have return type
  Restore the execute bit for run-tests.php
2019-05-29 08:32:06 +02:00
Joe Watkins
cc598d1ea9
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  disabled functions must not have return type
  Restore the execute bit for run-tests.php
2019-05-29 08:30:55 +02:00
Joe Watkins
6c73b2088a
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  disabled functions must not have return type
2019-05-29 08:30:41 +02:00
Joe Watkins
7821cc3b9f
disabled functions must not have return type 2019-05-29 08:30:08 +02:00
Nikita Popov
13f675b858 Merge branch 'PHP-7.4' 2019-05-27 09:38:33 +02:00
Nikita Popov
e6fac86dc3 Accept flags argument in zend_lookup_class_ex()
Instead of a single boolean, so we have space for extension here.
2019-05-27 09:36:25 +02:00
Peter Kokot
a1de3e8ae0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Update changelogs
  Fix bug #62397 - disable_functions does not work with eval.
2019-05-15 00:00:14 +02:00
Benjamin Eberlei
050d299364 Fix bug #62397 - disable_functions does not work with eval. 2019-05-14 23:49:55 +02:00
Nikita Popov
e9aa0337ab Fix more dl() interned string assertions 2019-04-18 12:14:07 +02:00
Nikita Popov
878e09c47c Merge branch 'PHP-7.4' 2019-04-18 12:10:21 +02:00
Nikita Popov
4aa78b67e7 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-18 12:10:09 +02:00
Nikita Popov
a5b7f3bd81 Fix more dl() interned string assertions 2019-04-18 12:08:09 +02:00
Nikita Popov
492a5d3ebe Merge branch 'PHP-7.4' 2019-04-18 10:11:51 +02:00
Nikita Popov
ed4c24274b Fix dl() module unloading in post deactivate
FOREACH_END_DEL() does not call the destructor by itself, we need to
explicitly call it. Due to the missing dtor call the functions were
not unregistered early, which resulted in later shutdown segfaults.
2019-04-18 10:10:15 +02:00
Dmitry Stogov
2de2cb2a87 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed dl() function. It failed in DEBUG build without opcache because of assert during string interning.
2019-04-17 19:32:46 +03:00
Dmitry Stogov
93c6a32b7c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed dl() function. It failed in DEBUG build without opcache because of assert during string interning.
2019-04-17 19:32:34 +03:00
Dmitry Stogov
ac12cc85aa Fixed dl() function. It failed in DEBUG build without opcache because of assert during string interning. 2019-04-17 19:31:28 +03:00
Dmitry Stogov
14b24340c8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #77877 (call_user_func() passes $this to satatic methods).
2019-04-11 14:31:40 +03:00
Dmitry Stogov
a1b7ccdfc6 Fixed bug #77877 (call_user_func() passes $this to satatic methods). 2019-04-11 14:24:04 +03:00
Nikita Popov
8971728383 Merge branch 'PHP-7.4' 2019-03-20 12:07:05 +01:00
Nikita Popov
abc457fe1d Fixed bug #74345
Export zend_release_fcall_info_cache(). It is only necessary to
call it if the fcc may not have been used -- if it is passed to
zend_call_function() and friends, then they will take care of
freeing trampolines.
2019-03-20 12:06:42 +01:00
Nikita Popov
92291ab726 Merge branch 'PHP-7.4' 2019-03-11 14:33:07 +01:00
Nikita Popov
ac79d42ba6 Free trampolines from get_closure in is_callable
Also extract this logic into a function, as it's duplicated a few times.
2019-03-11 14:00:33 +01:00
Nikita Popov
513b76794b Make zpp failures always throw, independent of strict_types
Previously zend_parse_parameters (and FastZPP) would handle invalid
arguments depending on strict_types: With strict_types=1, a TypeError
is thrown, with strict_types=0 a warning is thrown and (usually) NULL
is returned. Additionally, some functions (constructors always and
other methods sometimes) opt-it to throwing regardless of strict_types.

This commit changes zpp to always generate a TypeError exception in
PHP 8.
2019-03-11 11:32:20 +01:00
Dmitry Stogov
96a9990a81 Merge branch 'PHP-7.4'
* PHP-7.4:
  Use "quick" macro variants for known argument numbers
2019-02-18 17:53:43 +03:00
Dmitry Stogov
2ed013c38a Use "quick" macro variants for known argument numbers 2019-02-18 17:52:33 +03:00
Nikita Popov
903821b1c7 Merge branch 'PHP-7.4' 2019-02-15 11:28:14 +01:00
Nikita Popov
3cafa7f4df Assign (un)serialize_func during compilation
This avoids writing this cache at runtime, which is illegal if
preloading is used.

Not every serialize/unserialize function actually belongs to the
Serializable interface, but I think it's not a problem to assign
these anyway -- whether they are used ultimately depends on whether
Serializable is implemented.

Alternatively it might make sense to just drop these entirely. I
don't think this is performance critical functionality.
2019-02-15 11:20:28 +01:00
Dmitry Stogov
4474cf43e6 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #77613 (method visibility change) (reverted ZEND_ACC_CTOR and ZEND_ACC_DTOR flags removal)
2019-02-14 13:18:45 +03:00
Dmitry Stogov
43a7d95016 Fixed bug #77613 (method visibility change) (reverted ZEND_ACC_CTOR and ZEND_ACC_DTOR flags removal) 2019-02-14 13:12:50 +03:00
Dmitry Stogov
f45e0ce928 Remove ZEND_OVERLOADED_FUNCTION and corresponding call_method object handler 2019-02-07 21:05:46 +03:00
Dmitry Stogov
91ef4124e5 Refactor zend_object_handlers API to pass zend_object* and zend_string* insted of zval(s). 2019-02-04 13:20:25 +03:00
Peter Kokot
623911f993 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove local variables
2019-02-03 21:23:18 +01:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Nikita Popov
e93bbf4d5d Remove more leftovers from invalid static calls
Callbacks are now always valid or not valid, there is no in-between.
2019-01-30 13:13:47 +01:00
Zeev Suraski
a81202ac49 Adios, yearly copyright ranges 2019-01-30 11:48:28 +01:00
Zeev Suraski
02557f87bc Adios, yearly copyright ranges 2019-01-30 11:23:29 +02:00
Nikita Popov
6c73b50cf6 Remove static calls to non-static methods 2019-01-30 09:19:02 +01:00
Nikita Popov
682b54f687 Remove support for legacy constructors
This has been deprecated in PHP 7.0 by
https://wiki.php.net/rfc/remove_php4_constructors.
2019-01-29 13:04:20 +01:00
Dmitry Stogov
fd41b99d58 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77494 (Disabling class causes segfault on member access)
2019-01-24 13:08:00 +03:00
Dmitry Stogov
aa9a8dbda3 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77494 (Disabling class causes segfault on member access)
2019-01-24 13:07:31 +03:00
Dmitry Stogov
73f222d722 Fixed bug #77494 (Disabling class causes segfault on member access) 2019-01-24 13:06:36 +03:00
Dmitry Stogov
e6182bd4ea Improved ZEND_TRY_ASSIGN... API to avoid unnecessary double copying and reduce code bloat. 2019-01-18 00:53:48 +03:00
Nikita Popov
e219ec144e Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2

This is a squash of PR #3734, which is a squash of PR #3313.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2019-01-11 15:49:06 +01:00
Dmitry Stogov
493f830355 Reuse add_property_zval_ex() instead of code duplication 2018-12-19 17:24:56 +03:00
Dmitry Stogov
d356f6d72b Removed add_get_assoc_*() and add_get_index_*() API functions 2018-12-19 16:47:48 +03:00
Dmitry Stogov
85e1df6fdc Replace add_index_zval() and add_next_index_zval() functions by macros 2018-12-19 16:43:38 +03:00
Dmitry Stogov
cec091176c Replace zend_hash_apply... with ZEND_HASH_FOREACH... 2018-12-19 02:49:56 +03:00
Zeev Suraski
9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00
Zeev Suraski
54dc07f3dc Update email addresses. We're still @Zend, but future proofing it... 2018-11-01 17:20:07 +02:00
Dmitry Stogov
6f91090f6a Inlining in the most frequently used code paths 2018-10-23 12:46:44 +03:00
Dmitry Stogov
d57cd36e47 Immutable clases and op_arrays.
Squashed commit of the following:

commit cd0c36c3f9
Merge: 4740dabb84 ad6738e886
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 14:43:38 2018 +0300

    Merge branch 'master' into immutable

    * master:
      Remove the "auto" encoding
      Fixed bug #77025
      Add vtbls for EUC-TW encoding

commit 4740dabb84
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 14:12:28 2018 +0300

    Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes.

commit ad7a78b253
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:46:30 2018 +0300

    Added comment

commit 0276ea5187
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:42:43 2018 +0300

    Added type cast

commit c63fc5d5f1
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:36:51 2018 +0300

    Moved static class members initialization into the proper place.

commit b945548e93
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:21:03 2018 +0300

    Removed redundand assertion

commit d5a4108840
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:19:13 2018 +0300

    Removed duplicate code

commit 8dadca8864
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:05:43 2018 +0300

    Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros.

commit 9ef07c88bd
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 10:48:29 2018 +0300

    typo

commit a06f0f3d3a
Merge: 94099586ec 3412345ffe
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 10:47:07 2018 +0300

    Merge branch 'master' into immutable

    * master:
      Remove unused variable makefile_am_files
      Classify object handlers are required/optional
      Add support for getting SKIP_TAGSTART and SKIP_WHITE options
      Remove some obsolete config_vars.mk occurrences
      Remove bsd_converted from .gitignore
      Remove configuration parser and scanners ignores
      Remove obsolete buildconf.stamp from .gitignore
      [ci skip] Add magicdata.patch exception to .gitignore
      Remove outdated ext/spl/examples items from .gitignore
      Remove unused test.inc in ext/iconv/tests

commit 94099586ec
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 15 23:34:01 2018 +0300

    Immutable clases and op_arrays
2018-10-17 15:52:50 +03:00
Nikita Popov
1cfbb21790 Classify object handlers are required/optional 2018-10-16 20:53:59 +02:00
Peter Kokot
902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Dmitry Stogov
a2e8334613 Allocate only necessary space for static properties of internal classes in ZTS mode. 2018-10-01 19:05:31 +03:00
Dmitry Stogov
b634ded197 Class constants and default property values can't be IS_REFERENCE anymore. 2018-09-18 18:46:10 +03:00
Dmitry Stogov
689c6fb188 Replace ZEND_ACC_ANON_BOUND, ZEND_ACC_UNRESOLVED_PARENT and ZEND_ACC_UNRESOLVED_INTERFACES with single ZEND_ACC_LINKED. 2018-09-18 11:41:40 +03:00
Peter Kokot
b189c2432a Remove HAVE_STDARG_H
The C89 standard and later defines the `<stdarg.h>` header as part of
the standard headers [1]. On current systems it is always present and
can be included unconditionally.

Checking for presence and functionality of the `<stdarg.h>` header and
variadic function is not relevant anymore on current systems since this
is always available.

Also Autoconf suggests relying on at least C89 or above [2] and [3].

The following files were regenerated with re2c 1.0.3:
- Zend/zend_language_scanner.c
- Zend/zend_language_scanner_defs.h

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
[3] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-18 05:44:56 +02:00
Nikita Popov
dfa166e7ed Remove unused ZEND_FILE_LINE in i_zval_ptr_dtor 2018-09-16 17:16:26 +02:00
Dmitry Stogov
72bf2def6b Make visibilty check in is_callable() to be consistent with zend_std_get_method() 2018-09-13 12:24:59 +03:00
Dmitry Stogov
8939c4d96b Get rid of ZEND_ACC_CTOR, ZEND_ACC_DTOR and ZEND_ACC_IMPLEMENTED_ABSTRACT 2018-09-05 13:16:10 +03:00
Massimiliano Braglia
2527a0fcfd Fixed bug #75797
Fix zend_register_class_alias_ex() to use non-persistent strings
for (non-persistent) userland classes.
2018-08-22 13:39:08 +02:00
Xinchen Hui
78d823d9c3 Fixed zend_read_static_property 2018-08-14 13:01:50 +08:00
Anatol Belski
b1d2a89ac1 Fix length to copy 2018-07-31 17:31:57 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Dmitry Stogov
ebd1f5af3e API cleanup.
Removed useless filename and lineno arguments, used in DEBUG build.
The patch doesn't break source compatibility of public API (only binary compatibility).
2018-07-23 15:24:07 +03:00
Dmitry Stogov
41db5f73ce Fixed reference-counting in zend_parse_arg_str_weak() 2018-07-06 03:11:20 +03:00
Dmitry Stogov
8361c0a9a7 Avoid useless checks in object_init() 2018-07-06 01:24:15 +03:00
Dmitry Stogov
4a475a4976 Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized destructors.
zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places.
Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.
2018-07-04 19:22:24 +03:00
Dmitry Stogov
43aca3118a Avoid string comparisons for magic methods (all magic methods start with "__") 2018-07-02 17:03:02 +03:00
Nikita Popov
7ac06d66d4 Add zend_update_static_property_ex API
And cleanup the implementation to perform a normal by-value
assignment.
2018-06-29 22:56:59 +02:00
Nikita Popov
813b6fc950 Add zend_read_static_property_ex API
For symmetry with zend_read_property_ex.
2018-06-29 22:49:15 +02:00
Dmitry Stogov
6e77a60a75 Removed INIT_OVERLOADED_CLASS... macros 2018-06-29 14:41:35 +03:00
Dmitry Stogov
6dc0cd868d Fixed ZTS race condition (zend_class_entry->ce_flags of internal classes must not be modified, because internal class enties are shared between threads) 2018-06-27 12:33:20 +03:00
Dmitry Stogov
7f67513ca3 Lazy function copying from op_cache SHM into process memory 2018-06-25 19:53:58 +03:00
Dmitry Stogov
c8f355b12c Micro-optimization 2018-06-25 17:32:13 +03:00
Nikita Popov
2543e61aed Fixed bug #76509
In PHP static properties are shared between inheriting classes,
unless they are explicitly overwritten. However, because this
functionality was implemented using reference, it was possible
to break the implementation by reassigning the static property
reference.

This is fixed by switching the implementation from using references
to using INDIRECTs, which cannot be affected by userland code.
2018-06-25 15:04:09 +02:00
Dmitry Stogov
0b90cf85a6 Removed "dead" code (zend_hash_update() never fails) 2018-06-01 11:58:57 +03:00
Dmitry Stogov
d90c6f2443 Removed useless zval_ptr_dtor() 2018-05-29 17:58:06 +03:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Anatol Belski
bcb1dbf6e4 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #76337
2018-05-20 13:33:46 +02:00
xKhorasan
5681f6523b Fixed bug #76337 2018-05-20 13:33:03 +02:00
Dmitry Stogov
524f5245c5 Avoid useless checks, using zend_string_efree(), in cases where the string is known to be a temporary allocated zend_string. 2018-05-08 17:30:15 +03:00
Dmitry Stogov
fdb347a753 zend_is_callable() improvement 2018-05-03 19:25:53 +03:00
Nikita Popov
32692bb083 Merge branch 'PHP-7.2' 2018-04-26 16:17:23 +02:00
Nikita Popov
7c852a7961 Merge branch 'PHP-7.1' into PHP-7.2 2018-04-26 16:17:13 +02:00
shiguangqi2008@gmail.com
98ef183ed0 Fix memory leak in zend_disable_class() 2018-04-26 16:16:37 +02:00
Gabriel Caruso
d0ee2a8254 Add is_countable function
RFC: https://wiki.php.net/rfc/is-countable
2018-03-11 16:41:16 +01:00
Dmitry Stogov
7e329a82c7 Improved ZPP to reduce amount of generated code. 2018-02-16 11:37:20 +03:00
Gabriel Caruso
fef879a2d6 Use bool instead of boolean while throwing a type error
PHP requires boolean typehints to be written "bool" and disallows
"boolean" as an alias. This changes the error messages to match
the actual type name and avoids confusing messages like "must be
of type boolean, boolean given".

This a followup to ce1d69a1f6, which
implements the same change for integer->int.
2018-02-04 23:09:40 +01:00
Gabriel Caruso
ce1d69a1f6 Use int instead of integer in type errors
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
2018-02-04 19:08:23 +01:00
Dmitry Stogov
5c77bac9a7 A cheaper way to reset type flags. 2018-01-17 01:58:51 +03:00
Dmitry Stogov
c32d79b65f cleanup 2018-01-10 12:03:04 +03:00
Gabriel Caruso
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
d9f5ea691f zend_fcall_info_cache.initialized is removed (zend_fcall_info_cache is initialized if zend_fcall_info_cache.function_handler is set). 2017-12-27 15:15:03 +03:00
Dmitry Stogov
a6fcbb7c87 Use zend_hash_find() instead of zend_hash_find_ptr() to avoid double check 2017-12-27 13:26:06 +03:00
Nikita Popov
b2b2b437af Add _IS_NUMBER as cast_object() target type
convert_scalar_to_number() will now call cast_object() with an
_IS_NUMBER argument, in which case the cast handler should return
either an integer or floating point number, whichever is more
appropriate.

Previously convert_scalar_to_number() unconditionally converted
objects to integers instead.

Fixes bug #53033.
Fixes bug #54973.
Fixes bug #73108.
2017-12-26 12:39:06 +01:00
Nikita Popov
76a001e32a Merge branch 'PHP-7.2' 2017-12-13 21:25:38 +01:00
Nikita Popov
652d30acdc Merge branch 'PHP-7.1' into PHP-7.2 2017-12-13 21:25:21 +01:00
Levi Morrison
580bae4a2c Fix copy-and-paste bugs 2017-12-13 21:25:00 +01:00
Dmitry Stogov
6a9d2b2190 Cleanup type conversion 2017-12-07 19:24:55 +03:00
Dmitry Stogov
134248164c Only functions of temporary modules have to be unregistered here 2017-11-30 11:40:52 +03:00
Dmitry Stogov
084c17fe0b Use zend_string_tolower() where it's possible (to avoid reallocations).
Allow zend_string_tolower_ex() to create parsistent strings
2017-11-30 01:13:39 +03:00
Nikita Popov
8795893f4f Make sure string property/class const values are interned
This was done for user-definde class constant values, however this
is also important for properties and internal classes.
2017-11-25 17:12:37 +01:00
Xinchen Hui
d56a534acc RC manipulation cleanup 2 2017-11-02 12:13:35 +08:00
Nikita Popov
cb2884679c Remove zend_get_parameters(_ex) APIs
zend_get_parameters_ex() has been marked as deprecated for a long
time already. What zend_get_paramers() does is even more
questionable under PHP7. Both functions are obsoleted by the ZPP
mechanism, so I'm dropping them.
2017-10-30 22:00:42 +01:00
Dmitry Stogov
fcc08ce19f Prevent reference-counting on persistent zvals (internal constants, default properties and constants of internal classes).
New macro ZVAL_COPY_OR_DUP() is used perform duplication, if necessary.
This should eliminate related race-coditions in ZTS build and prevent reference-counting bugs after unclean shutdown.
2017-10-30 23:13:10 +03:00
Dmitry Stogov
8e01026b82 Extend zend_register_class_alias_ex() with additional argument to allow creating persistent or per-request aliases 2017-10-27 14:44:21 +03:00
Dmitry Stogov
272f5a1716 Extend zend_string API to avoid reallocation in zend_string_init_interned() 2017-10-19 00:02:56 +03:00
Dmitry Stogov
ef5ea48741 Always use IS_CONSTANT_AST (IS_CONSTANT is removed). 2017-10-10 10:11:05 +03:00
Joe Watkins
e2e3c981b5
Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed #75220 - Segfault when calling is_callable on parent
2017-09-27 06:09:24 +01:00
Joe Watkins
0d6c56a8ea
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed #75220 - Segfault when calling is_callable on parent
2017-09-27 06:08:49 +01:00
Joe Watkins
2dd77456fe
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed #75220 - Segfault when calling is_callable on parent
2017-09-27 06:08:01 +01:00
Nester
a680d701ce
Fixed #75220 - Segfault when calling is_callable on parent 2017-09-27 06:07:24 +01:00
Dmitry Stogov
44e0b79ac6 Refactored array creation API. array_init() and array_init_size() are converted into macros calling zend_new_array(). They are not functions anymore and don't return any values. 2017-09-20 02:25:56 +03:00
Dmitry Stogov
41e5f916bf Fixed bug #74878 (Data race in ZTS builds) 2017-09-18 11:27:10 +03:00
Dmitry Stogov
161c378cc8 Revert "Fixed bug #74878"
This reverts commit 9069734b57.
2017-07-10 12:21:58 +03:00
Nikita Popov
9069734b57 Fixed bug #74878 2017-07-07 22:41:48 +02:00
Anatol Belski
bc5811f361 further sync for vim mode lines 2017-07-04 18:12:45 +02:00
Julien Pauli
cf7ae70540 Merge branch 'PHP-7.1'
* PHP-7.1:
  Updated NEWS
  Updated NEWS
  Fix bug #74832, crash in extension loading
2017-06-29 20:25:18 +02:00
Julien Pauli
e57fce4d00 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Updated NEWS
  Fix bug #74832, crash in extension loading
2017-06-29 20:24:03 +02:00
Julien Pauli
3f4340a796 Fix bug #74832, crash in extension loading 2017-06-29 20:22:21 +02:00
Dmitry Stogov
c0be77aa75 Removed deprecated checks. 2017-06-27 13:12:09 +03:00
Nikita Popov
ee8e75aab4 Extract zend_get_callable_name() API
Instead of interleaving this inside zend_is_callable(), implement
this in a separate function instead.

Also add _deref() hash APIs. I've wanted these for a while, and
this is another place where they're useful, so finally do it...
2017-06-25 18:26:03 +02:00
Jakub Zelenka
eb6614e458 Constify str in add_assoc_string_ex and add_assoc_stringl_ex 2017-06-07 23:44:23 +02:00
Xinchen Hui
225f6cc11f Merge branch 'PHP-7.1'
* PHP-7.1:
  Correct the location
2017-05-27 12:12:17 +08:00
Xinchen Hui
1838f965bc Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Correct the location
2017-05-27 12:12:12 +08:00
Xinchen Hui
ece7d223e8 Correct the location 2017-05-27 12:11:53 +08:00
Xinchen Hui
8af21f3ca6 Merge branch 'PHP-7.1'
* PHP-7.1:
  Added NEWs
  Fixed bug #74657 (Undefined constants in array properties result in broken properties)
2017-05-27 12:09:28 +08:00
Xinchen Hui
cd3520c4d3 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74657 (Undefined constants in array properties result in broken properties)
2017-05-27 12:08:48 +08:00
Xinchen Hui
5269c4cacb Fixed bug #74657 (Undefined constants in array properties result in broken properties) 2017-05-27 12:06:43 +08:00
Dmitry Stogov
f00d1c72b4 Added ZEND_GET_CLASS, ZEMD_GET_CALLED_CLASS, ZEND_GET_TYPE instructions, to implement corresponding builtin functions. 2017-05-25 18:41:28 +03:00
Nikita Popov
b6a4aad820 Remove the ZEND_ACC_CLONE flag
This one is completely unused
2017-04-22 15:47:53 +02:00
Nikita Popov
6ad0a6fb04 Merge branch 'PHP-7.1' 2017-03-15 19:50:26 +01:00
Nikita Popov
2bba4a0d7f Fix bug #69676 2017-03-15 19:49:02 +01:00
Anatol Belski
c698299550 Interned strings unification for TS/NTS
Hereby, interned strings are supported in thread safe PHP. The patch
implements two types of interned strings

- interning per process, strings are not freed till process end
- interning per request, strings are freed at request end

There is no runtime interning.

With Opcache, all the permanent iterned strings are copied into SHM on
startup, additional copying into SHM might happen on demand.
2017-03-04 10:39:13 +01:00
Dmitry Stogov
141d1ba980 Introduced "zend_type" - an abstraction for type-hinting representation. 2017-01-13 11:37:46 +03:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Sara Golemon
52db03b3e5 Support ZEND_PARSE_PARAMS_THROW in new ZPP API 2016-12-29 18:26:19 -08:00
Anatol Belski
b204b3abd1 further normalizations, uint vs uint32_t
fix merge mistake

yet one more replacement run
2016-11-26 17:29:01 +01:00
Kalle Sommer Nielsen
2104bea5d7 Remove Netware support
If this does not break the Unix system somehow, I'll be amazed. This should get most of it out, apologies for any errors this may cause on non-Windows ends which I cannot test atm.
2016-11-12 11:20:01 +01:00
Anatol Belski
a6715786a7 finish 7.1 port
(cherry picked from commit f1fff032fc)
2016-10-14 01:44:31 +02:00
Stanislav Malyshev
54003ab663 Fix bug #73147: Use After Free in PHP7 unserialize()
(cherry picked from commit 0e6fe3a4c9)
(cherry picked from commit f42cbd749c)
2016-10-14 01:44:16 +02:00
Anatol Belski
f1fff032fc finish 7.1 port 2016-10-12 18:31:59 +02:00
Anatol Belski
b1ef60f90e Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #73147: Use After Free in PHP7 unserialize()
2016-10-12 17:56:13 +02:00
Stanislav Malyshev
f42cbd749c Fix bug #73147: Use After Free in PHP7 unserialize()
(cherry picked from commit 0e6fe3a4c9)
2016-10-12 17:51:15 +02:00
Nikita Popov
bf907b9961 Revert ReflectionType::__toString() behavior + deprecate 2016-09-28 19:21:51 +02:00
Dmitry Stogov
64a8048c53 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed inconsistent meaning of zend_startup_module_ex() return value used in zend_hash_apply()
2016-09-20 12:34:58 +03:00
Dmitry Stogov
3c16384ea2 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed inconsistent meaning of zend_startup_module_ex() return value used in zend_hash_apply()
2016-09-20 12:34:40 +03:00
Dmitry Stogov
4dd70b6e2f Fixed inconsistent meaning of zend_startup_module_ex() return value used in zend_hash_apply() 2016-09-20 12:29:57 +03:00
Stanislav Malyshev
19866fb76c Fix various int size overflows.
Add function for detection of string zvals with length that does not fit
INT_MAX.
2016-09-12 21:04:23 -07:00
Andrea Faulds
fc5497cb92 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-11 22:46:20 +01:00
Andrea Faulds
d690014bf3 Remove zpp fallback code (always use Fast ZPP)
Squashed commit of the following:

commit 3e27fbb3d2
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Sep 11 19:14:37 2016 +0100

    Keep dummy FAST_ZPP macro for compatibility

commit 8a7cfd00de
Author: Andrea Faulds <ajf@ajf.me>
Date:   Mon Sep 5 22:36:03 2016 +0100

    Remove FAST_ZPP macro and plain zpp fallback code
2016-09-11 22:44:46 +01:00
Anatol Belski
0a50cbabf6 fix unused assignment 2016-09-01 23:45:31 +02:00
Davey Shafik
12ee17d5e0 Implement \ArgumentCountError exception 2016-08-30 19:35:56 -07:00
Nikita Popov
664e5f392d Merge branch 'PHP-7.0' 2016-07-14 21:41:49 +02:00
Nikita Popov
a50a5c1bf1 Fix is_callable() on abstract method via object 2016-07-14 21:41:41 +02:00
Nikita Popov
0bda0422af Merge branch 'PHP-7.0'
Conflicts:
	Zend/zend_vm_execute.h
2016-07-14 18:39:48 +02:00
Nikita Popov
00047fcf84 Fix leak when dynamically calling abstract method 2016-07-14 18:39:08 +02:00
Aaron Piotrowski
d9a9cf8eca Merge branch 'master' into iterable 2016-07-03 22:42:10 -05:00
Dmitry Stogov
ebb99a1a3a Fixed compilation warnings 2016-06-21 16:55:17 +03:00
Dmitry Stogov
1616038698 Added ZEND_ATTRIBUTE_FORMAT to some middind functions.
"%p" replaced by ZEND_LONG_FMT to avoid compilation warnings.
Fixed most incorrect use cases of format specifiers.
2016-06-21 16:00:37 +03:00
Dmitry Stogov
421843977f Fixed bug #71266 (Missing separation of properties HT in foreach etc). 2016-06-07 23:18:52 +03:00
Aaron Piotrowski
340a00008d Add iterable to zend_get_type_by_const() 2016-06-03 17:56:13 -05:00
Aaron Piotrowski
72692e9a9c Add iterable pseudo-type 2016-06-03 17:42:04 -05:00
Dmitry Stogov
9b27df8df5 Fixed white-spaces 2016-05-24 12:37:20 +03:00
Dmitry Stogov
7b94b958cc Intern some known (and offten used) strings. 2016-05-12 13:47:22 +03:00
Dmitry Stogov
c19cb70dac Revert "Refactor zval cleanup into single function"
This reverts commit bac6fdb0c5.
2016-05-06 10:47:58 +03:00
Bob Weinand
bac6fdb0c5 Refactor zval cleanup into single function
Also use zval_ptr_dtor_nogc() everywhere in Zend in favor of zval_dtor()
2016-05-05 23:31:57 +02:00
Xinchen Hui
d08df44425 Merge branch 'PHP-7.0'
* PHP-7.0:
  Mark fcc as initialized for object calls
2016-05-03 11:13:41 +08:00
Bob Weinand
b4c5009220 Mark fcc as initialized for object calls
This results in 1% speedup (cycle count) on some real world applications
2016-05-03 02:07:06 +02:00
Dmitry Stogov
6499162ff0 - get rid of EG(scope). zend_get_executed_scope() should be used instead.
- ichanged zval_update_constant_ex(). Use IS_TYPE_IMMUTABLE flag on shared constants and AST, instead of "inline_change" parameter.
2016-04-28 04:13:34 +03:00
Dmitry Stogov
f0a2e8eb13 Removed "zend_fcall_info.function_table". It was assigned in many places, but is never used. 2016-04-27 13:46:38 +03:00
Andrea Faulds
1e82ad8038 Warn about invalid strings in arithmetic
Squashed commit of the following:

commit e05d3b6732
Author: Andrea Faulds <ajf@ajf.me>
Date:   Wed Mar 30 01:43:35 2016 +0100

    UPGRADING and NEWS

commit 6caf1d4585
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Mar 20 21:18:33 2016 +0000

    Fixes

commit 6dadb1b0ef
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Feb 14 02:15:01 2016 +0000

    Add test for numeric string errors in assignment

commit bd5f04e8dd
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Feb 13 23:53:05 2016 +0000

    Add test for numeric string errors

commit c72e92f16d
Author: Andrea Faulds <ajf@ajf.me>
Date:   Tue Jan 26 23:28:33 2016 +0000

    Add test for scientific notation in integer operations

commit d94c08852d
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Feb 14 01:25:57 2016 +0000

    Disable optimiser evaluation for numeric string errors

commit 30ee954ed1
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Feb 14 01:46:25 2016 +0000

    fixup

commit a6403b79e0
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Feb 13 22:00:27 2016 +0000

    Do not convert error-causing numeric strings ahead-of-time

commit f9dc354014
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Feb 13 19:15:38 2016 +0000

    Disable compile-time evaluation for numeric string errors

commit e05b0cc849
Author: Andrea Faulds <ajf@ajf.me>
Date:   Fri Feb 5 11:42:26 2016 +0000

    Make _zval_get_long_func_noisy function for inlining

commit 84d66321a5
Author: Andrea Faulds <ajf@ajf.me>
Date:   Tue Jan 26 23:10:00 2016 +0000

    Update tests

commit 5ac4a0cc4b
Author: Andrea Faulds <ajf@ajf.me>
Date:   Tue Jan 26 22:08:19 2016 +0000

    Use is_numeric_string_ex for zval_get_long etc.

commit c21f088485
Author: Andrea Faulds <ajf@ajf.me>
Date:   Thu Jan 7 21:13:04 2016 +0000

    Update tests

commit 63e214cf81
Author: Andrea Faulds <ajf@ajf.me>
Date:   Wed Jan 6 00:28:01 2016 +0000

    Warn on non-/bad numeric strings in arithmetic
2016-03-30 01:44:27 +01:00
Dmitry Stogov
c67c166f93 Removed zend_fcall_info.symbol_table 2016-03-02 17:50:55 +03:00
Nikita Popov
37d1bbe456 Merge branch 'PHP-7.0' 2016-02-21 13:01:28 +01:00
Nikita Popov
0bd64b50b8 Fixed bug #71617 2016-02-21 13:00:37 +01:00
Nikita Popov
2d605e5f24 Merge branch 'PHP-7.0' 2016-02-14 14:47:42 +01:00
Nikita Popov
c9357f82d3 Format string fixes
Conflicts:
	ext/pgsql/pgsql.c
2016-02-14 14:45:53 +01:00
Xinchen Hui
563659822d Merge branch 'PHP-7.0' 2016-01-02 17:56:54 +08:00
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Xinchen Hui
3537e95dae bump year which is missed in rev 49493a2 2016-01-02 17:51:24 +08:00
Xinchen Hui
ad51c709c3 Merge branch 'PHP-7.0' 2015-12-13 05:06:22 -08:00
Xinchen Hui
07b33992a2 Fixed bug #71109 (ZEND_MOD_CONFLICTS("xdebug") doesn't work) 2015-12-13 05:06:08 -08:00
Nikita Popov
04e3d82b55 Make duplicate class constant error for internal class
And drop two duplicate constant declarations from intl. These
were leaking previously.
2015-12-10 22:22:49 +01:00
Dmitry Stogov
a75c195000 Implemented the RFC Support Class Constant Visibility.
Squashed commit of the following:

commit f11ca0e7a5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Dec 8 12:38:42 2015 +0300

    Fixed test expectation

commit 211f873f54
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Dec 8 12:28:38 2015 +0300

    Embed zend_class_constant.flags into zend_class_constants.value.u2.access_flags

commit 51deab84b2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Dec 7 11:18:55 2015 +0300

    Fixed issues found by Nikita

commit 544dbd5b47
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Sat Dec 5 02:41:05 2015 +0300

    Refactored immplementation of https://wiki.php.net/rfc/class_const_visibility
    @reeze created an RFC here and I emailed internals here and didn't get any responses positive/negative.
2015-12-08 12:40:42 +03:00
Xinchen Hui
0495bf5650 Revert "fix typos "paramer" -> "parameters""
ABI BC break

This reverts commit 6ac12f1337.
2015-12-08 10:52:50 +08:00
Márcio Almada
6ac12f1337 fix typos "paramer" -> "parameters" 2015-12-07 14:48:26 +08:00
Márcio Almada
2dcfd8d16f fix typos "paramer" -> "parameters" 2015-12-07 01:59:53 -04:00
Xinchen Hui
34bff5b91c Merge branch 'PHP-7.0' 2015-11-23 23:16:11 +08:00
Xinchen Hui
7e9f416218 Fixed bug #70959 (ArrayObject unserialize does not restore protected fields) 2015-11-23 23:15:33 +08:00
Xinchen Hui
f8bf1f33a5 Fixed bug #70959 (ArrayObject unserialize does not restore protected fields) 2015-11-23 07:08:47 -08:00
Andrea Faulds
366ba41334 Add void return type 2015-11-18 17:30:49 +00:00
Xinchen Hui
2bed2152e6 Revert "Fixed bug Bug #70895 null ptr deref and segfault"
This reverts commit 8eef11d317.
2015-11-12 14:34:00 +08:00
Xinchen Hui
c245fd7d91 Revert "refix bug #70895"
This reverts commit 93240102e0.
2015-11-12 14:33:14 +08:00
Xinchen Hui
75f85288f4 Revert "Fixed bug #70898 (SIGBUS/GPF zend_mm_alloc_small (zend_alloc.c:1291))"
This reverts commit e4e54f33ce.
2015-11-12 14:32:35 +08:00
Xinchen Hui
e4e54f33ce Fixed bug #70898 (SIGBUS/GPF zend_mm_alloc_small (zend_alloc.c:1291))
Include tail \0
2015-11-12 14:18:02 +08:00
Anatol Belski
93240102e0 refix bug #70895
move this code to where it belongs, no behavior change to actual
throwing function, thus retaining compat with old ZPP
2015-11-12 01:39:02 +01:00
Anatol Belski
8eef11d317 Fixed bug Bug #70895 null ptr deref and segfault 2015-11-12 00:52:36 +01:00
Dmitry Stogov
ca36b7bc13 Added zend_internal_function.reserved[] fields, to allow extensions keep additional associated information.
We didn't have zend_internal_function.reserved[] in PHP5, but we always allocated space for zend_function union, and extensions were able to reuse zend_function.op_array.reserved[] even for internal function. Now this is not possible. And extensions have to use zend_function.op_array.reserved[] for user functions and zend_function.internal_function.reserved[] for internal.
2015-09-29 13:31:47 +03:00
Dmitry Stogov
560e4fa393 Removed or simplified incorrect SEPARATE_*() macros usage. 2015-09-29 11:17:43 +03:00
Bob Weinand
95dbe1d03e Short-circuit zend_parse_parameters_none() so that expensive zpp() call never happens in non-exceptional case 2015-09-20 02:43:22 +02:00
Stanislav Malyshev
9b1a224d4e Merge branch 'PHP-5.6'
* PHP-5.6: (21 commits)
  fix unit tests
  update NEWS
  add NEWS for fixes
  Improve fix for #70172
  Fix bug #70312 - HAVAL gives wrong hashes in specific cases
  fix test
  add test
  Fix bug #70366 - use-after-free vulnerability in unserialize() with SplDoublyLinkedList
  Fix bug #70365 - use-after-free vulnerability in unserialize() with SplObjectStorage
  Fix bug #70172 - Use After Free Vulnerability in unserialize()
  Fix bug #70388 - SOAP serialize_function_call() type confusion
  Fixed bug #70350: ZipArchive::extractTo allows for directory traversal when creating directories
  Improve fix for #70385
  Fix bug #70345 (Multiple vulnerabilities related to PCRE functions)
  Fix bug #70385 (Buffer over-read in exif_read_data with TIFF IFD tag byte value of 32 bytes)
  Fix bug #70219 (Use after free vulnerability in session deserializer)
  Fix bug ##70284 (Use after free vulnerability in unserialize() with GMP)
  Fix for bug #69782
  Add CVE IDs asigned (post release) to PHP 5.4.43
  Add CVE IDs asigned to #69085 (PHP 5.4.39)
  ...

Conflicts:
	ext/exif/exif.c
	ext/gmp/gmp.c
	ext/pcre/php_pcre.c
	ext/session/session.c
	ext/session/tests/session_decode_variation3.phpt
	ext/soap/soap.c
	ext/spl/spl_observer.c
	ext/standard/var.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	ext/xsl/xsltprocessor.c
2015-09-02 00:37:20 -07:00
Dmitry Stogov
66770f9c37 Added missing set of fcc->initialized flag. 2015-09-01 03:15:50 +03:00
Dmitry Stogov
37f0c6b5cb Add myself into list of authors of the most refactored files. 2015-08-31 11:38:16 +03:00
Dmitry Stogov
71af54e5f6 Mark error and exception functions as "cold" (Matt's idea) 2015-08-19 14:40:56 +03:00
Julien Pauli
9a138b47c9 Removed unused code 2015-08-18 14:33:04 +02:00
Xinchen Hui
0bddc18619 Fixed bug #70156 (Segfault in zend_find_alias_name) 2015-07-28 16:39:58 +08:00
Dreamsxin
7554e83037 Updated zend_update_static_property 2015-07-13 08:42:18 +08:00
Aaron Piotrowski
5df893ce3c Use NULL where possible for exception class
Matches usage of zend_throw_exception()/zend_throw_exception_ex().
2015-07-07 12:10:55 -05:00
Aaron Piotrowski
1adf3df81e Throw TypeError for invalid callback
Matches behavior of zend_internal_type_error() if E_ERROR is passed to
zend_wrong_callback_error().
2015-07-06 15:03:35 -05:00
Aaron Piotrowski
22c38b2ef5 Remove need to pass error level 2015-07-03 17:53:41 -05:00
Aaron Piotrowski
5a99c07ecc Enable throwing custom exceptions from errors 2015-07-03 17:53:40 -05:00
Dmitry Stogov
7aa7627172 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 13:59:27 +03:00
Dmitry Stogov
4bd22cf1c1 Improved zend_string API (Francois Laupretre)
Squashed commit of the following:

commit d96eab8d79
Author: Francois Laupretre <francois@tekwire.net>
Date:   Fri Jun 26 01:23:31 2015 +0200

    Use the new 'ZSTR' macros in the rest of the code.

    Does not change anything to the generated code (thanks to compat macros) but cleaner.

commit b352643910
Author: Francois Laupretre <francois@tekwire.net>
Date:   Thu Jun 25 13:45:06 2015 +0200

    Improve zend_string API

    Add missing methods
2015-06-29 16:44:54 +03:00
Nikita Popov
628d439402 Drop superfluous __toString handling code
This is already covered by the cast_object invokation above it. We
do not use this kind of fallback in any other casting code anymore.
2015-06-22 15:33:41 +02:00
Dmitry Stogov
8e10e8f921 Avoid zval duplication in ZVAL_ZVAL() macro (it was necessary only in few places).
Switch from ZVAL_ZVAL() to simpler macros where possible (it makes sense to review remaining places)
2015-06-12 12:33:23 +03:00
Dmitry Stogov
6bcf121f5b micro-optimization 2015-06-03 13:43:05 +03:00
Dmitry Stogov
ca64b41b99 Fixed zend_update_class_constants() to always resolve all constants.
Call zend_update_class_constants() only when necessary.
2015-05-21 04:13:10 +03:00
Dmitry Stogov
70c86732cb Use zend_string to represent pdo_column_data.name and avoid duplication. 2015-05-05 16:19:51 +03:00
Dmitry Stogov
388c2cbdbc Micro optimizations 2015-04-28 19:11:45 +03:00
Dmitry Stogov
49cf7c5d12 Don't propogate "fake" EX(called_scope) and EX(This) into each internal function.
They need quite seldom and it's cheaper to get them from corresponfing upper stack frame.
2015-04-23 12:16:37 +03:00
Dmitry Stogov
15a5f61cf4 Use fast method to check if first arguments should be passed by reference (not tested onbig endian). 2015-04-22 21:46:13 +03:00