1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 17:08:14 +02:00
Commit Graph

559 Commits

Author SHA1 Message Date
Nikita Popov bbcfa5083e Remove Z_PARAM_ZVAL_DEREF
Since PHP 7.4 using this is very likely wrong, and we don't have
any core uses of it for that reason. Extensions shouldn't be using
it either. Accept as Z_PARAM_ZVAL and then assign using
ZEND_TRY_ASSIGN macros.
2019-07-18 10:44:27 +02:00
Nikita Popov 6efb354831 Merge branch 'PHP-7.4' 2019-07-11 17:09:23 +02:00
Nikita Popov cbda1b1c6a Add ZEND_DEP_ME macro 2019-07-11 17:09:03 +02: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
Dmitry Stogov bfca9592d0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Eliminate useless checks
2019-07-05 14:25:26 +03:00
Dmitry Stogov 55f7d3b70a Eliminate useless checks 2019-07-05 14:21:18 +03:00
Nikita Popov 88a71ed5f3 Merge branch 'PHP-7.4' 2019-06-14 13:12:08 +02:00
twosee 42cc58ff7b Turn add_index_zval and add_next_index_zval into inline function
Avoids expression warnings and allows explicitly namespaced use in
C++.

Closes GH-4250.
2019-06-14 13:10:27 +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
twosee 63171d88f2 Add do...while(0) for RETURN_* and ZVAL_* APIs
Closes GH-4255.
2019-06-12 16:17:16 +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
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
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
Anatol Belski 37d01ff81a Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix conditional compilation
  These macros should not expect any argument
2019-05-29 02:54:15 +02:00
Anatol Belski 1a4ace05ae These macros should not expect any argument 2019-05-29 02:29:02 +02:00
Dmitry Stogov 6a8b5599df Merge branch 'PHP-7.4'
* PHP-7.4:
  Put phpinfo() related code into cold code segment
2019-05-28 11:04:47 +03:00
Dmitry Stogov 072f28938f Put phpinfo() related code into cold code segment 2019-05-28 11:04:13 +03:00
Nikita Popov 20e983d9ce Merge branch 'PHP-7.4' 2019-05-14 14:59:36 +02:00
Nikita Popov 3f19f5112a Add RETURN_EMPTY_ARRAY() / RETVAL_EMPTY_ARRAY()
The usual wrappers around ZVAL_EMPTY_ARRAY()...
2019-05-14 14:59:10 +02:00
Nikita Popov cdb7ebd972 Merge branch 'PHP-7.4' 2019-04-29 09:58:56 +02:00
Nikita Popov 22e9a5e0c3 Fix typo in TRY_ASSIGN macro name 2019-04-29 09:58:45 +02:00
Dmitry Stogov e188e4170f Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:28:29 +03:00
Dmitry Stogov 2e4686b566 Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:16:47 +03:00
Dmitry Stogov 34db07567d Use ZEND_TRA_ASSIGN_REF_... macros for by reference arguments of internal functions. 2019-04-24 16:14:48 +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 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
Nikita Popov a9d4caeece Add ZEND_TRY_ASSIGN_BOOL API
Cherry-picked from master, this is of course also necessary in 7.4...
2019-02-08 12:30:54 +01:00
Nikita Popov 706ba151d2 Add ZEND_TRY_ASSIGN_BOOL API 2019-02-08 11:06:50 +01: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
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 e25e2bd9bd Change zend_try_array_init_size arg to uint32_t
If this is all the underlying API supports, it doesn't make sense to
accept something larger here...
2019-01-14 09:16:07 +01:00
Kalle Sommer Nielsen 1ff33f3161 Kill this new and insanely annoying warning
Nikita, if this is not the right way to go about it, then please amend it
2019-01-14 09:05:44 +02: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
Nikita Popov 466cf77aa4 Merge branch 'PHP-7.3' 2019-01-08 09:26:44 +01:00
Nikita Popov f7a7d32e65 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-08 09:26:31 +01:00
twosee 6305119a51 Prefix error_code with underscore in FastZPP implementation
To avoid conflicts with parameter names.
2019-01-08 09:25:35 +01:00
Dmitry Stogov d356f6d72b Removed add_get_assoc_*() and add_get_index_*() API functions 2018-12-19 16:47:48 +03:00