1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 19:23:22 +02:00
Commit Graph

14239 Commits

Author SHA1 Message Date
Nikita Popov 09ea55cb4e Deprecate left-associative ternary
Deprecate nesting ternary operators without explicit parentheses.

RFC: https://wiki.php.net/rfc/ternary_associativity
2019-05-07 14:06:29 +02:00
Nikita Popov d9a2d76a43 Remove outdated info from README.ZEND_MM
[ci skip]
2019-05-07 09:54:46 +02:00
Nikita Popov f3e5bbe6f3 Implement arrow functions
Per RFC: https://wiki.php.net/rfc/arrow_functions_v2

Co-authored-by: Levi Morrison <levim@php.net>
Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
2019-05-02 15:04:03 +02:00
Dmitry Stogov 8cdd215894 Also, use ZEND_ACC_PRELOADED for classes 2019-04-30 02:07:02 +03:00
Nikita Popov 22e9a5e0c3 Fix typo in TRY_ASSIGN macro name 2019-04-29 09:58:45 +02:00
Peter Kokot b931dacc88 Remove unused TSRM/readdir.h header
This was once part of TSRM but then got refactored into the windows
implementation win32/readdir.h directly. Instead of including such files
directly code should use zend_virtual_cwd.h which is already part of the
php.h file.
2019-04-29 00:51:13 +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
CrazyMiaoo 9df15fc26b Add gcc global register for aarch64 2019-04-22 14:29:30 +03:00
Peter Kokot b1d3509e8c Refactor Zend/acinclude.m4 local macro
There is now only a single M4 macro in the legacy acinclude.m4 file. A
separate acinclude file was once used with a standalone Zend engine
building but with current build system this can be simplified a bit.
2019-04-21 15:53:19 +02:00
Peter Kokot b58bd11ae5 Remove zend.ico
The usage of the `zend.ico` image file was removed via
4b3e198023 and is in current code base
not used anymore.
2019-04-20 22:22:56 +02:00
Dmitry Stogov 5ffa5217fc Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Check assert only when RC_DEBUG is enabled
2019-04-18 14:27:05 +03:00
Dmitry Stogov 3a04adce82 Check assert only when RC_DEBUG is enabled 2019-04-18 14:26:15 +03:00
Nikita Popov e9aa0337ab Fix more dl() interned string assertions 2019-04-18 12:14:07 +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 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 38f9c8d93d Don't initialize return value before calling user functions 2019-04-18 02:31:12 +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
Nikita Popov f73f190c3f Fix internal_encoding fallback in mbstring
By introducing a hook that is called whenever one of
internal_encoding / input_encoding / output_encoding changes, so
that mbstring can adjust it's internal state.

This also makes internal_encoding work with zend multibyte.
2019-04-17 14:05:53 +02:00
Nikita Popov bd6ebf40b2 Don't overwrite iterator count during real init 2019-04-16 12:21:20 +02:00
Nikita Popov 2bdd212887 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-16 12:21:16 +02:00
Nikita Popov f9a755d0d2 Fix HT flags copying wrt iterator count
HT_FLAGS() includes the full flag word, including the iterator
count. When we're fully reassigning it, we need to make sure that
we either really do want to copy the iterator count (as in some
cases in array.c) or we need to mask only the actual flag byte.

Add an assert to hash_iterators_del() to make sure the iterator
count is non-zero (which is how I ran into this) and make sure that
the iterator count is correctly preserved during array splicing.
2019-04-16 12:14:45 +02:00
Christoph M. Becker 5ae49c43dc Prepare main branch for PHP 7.3.6 2019-04-16 11:56:03 +02:00
Nikita Popov 32fb2d9343 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-16 10:39:48 +02:00
Nikita Popov 9a9eed472b Fix second part of bug #77903
When a HT iterator is one past the end and we rehash, we need to make
sure that it is move to the new one past the end position, to make
sure that newly inserted elements are picked up.
2019-04-16 10:38:20 +02:00
Nikita Popov e1b4cabbd6 Partial fix for bug #77903
In the hash position APIs, make sure we always advance to the next
non-undef element and not just when the position is 0 (similar to
what foreach does). This can happen when the position of an
ArrayIterator is one past its current end and a new element is
inserted not directly at that position because the array is packed.

There is still a bug here (as shown in the tests), but this is a
separate issue that also affects plain array iteration in foreach.
2019-04-16 10:23:11 +02:00
Dmitry Stogov 3f7bf35e16 execute_data->return_value is not used for internal functions 2019-04-16 00:08:16 +03:00
Dmitry Stogov cb3cfc9ff8 Removed tests that always (or almost always) true 2019-04-15 13:18:16 +03:00
Nikita Popov 7f6c22cb3d Fix last maybe uninit warnings on 7.4
Most of these only occur under GCC 5. Not fond of all the workarounds
(especially the PDO one), but it gets us a clean build...
2019-04-15 11:35:13 +02:00
Nikita Popov 3f19592f92 Disable strict aliasing warnings
It seems like GCC 5 likes to warn about exactly those trivial strict
aliasing violations that it's not going to miscompile anyway and the
warnings are gone in newer versions. Just disable the noise.
2019-04-15 10:43:49 +02:00
Nikita Popov e1ab686228 Avoid uninit warning in dtoa
This code is extremely convoluted, I have no idea whether or not
this one is legitimate. Suppressing with explicit initialization.
2019-04-12 15:12:39 +02:00
Nikita Popov 339b0af429 Avoid misc uninitialized variable warnings 2019-04-12 15:12:39 +02:00
Nikita Popov 3744533468 Enable -Wall on release builds for GCC
-Wall was already enabled for debug builds, enable it for release
builds as well.
2019-04-12 12:51:17 +02:00
Nikita Popov ce408504d5 Mark zend_bailout() as a noreturn function 2019-04-12 10:41:53 +02:00
Dmitry Stogov 55cc280429 Backported call frame initialization improvement 2019-04-12 02:35:42 +03:00
Dmitry Stogov 88a2268d6b Replace "ZEND_CALL_CTOR" hack by additional live-range 2019-04-12 00:49:45 +03:00
Dmitry Stogov db93c26e6d Added test 2019-04-11 21:37:10 +03:00
Markus Staab 7bb22df5cf Fixed typo 2019-04-11 16:56:36 +02:00
Nikita Popov c51eafe931 Remove restrict zend_portability define
We're not using this anywhere, and it causes warnings, so I'm
dropping it. If we do end up needing this, it should be reintroduced
with a ZEND_ prefix.
2019-04-11 15:32:30 +02: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 d087a356fe Suppress warnings using zend_quiet_write 2019-04-11 12:22:52 +02:00
Nikita Popov 30df87f77d Generate ZEND_COUNT for sizeof()
sizeof() is an alias of count(), so we should generate the same
code for them.
2019-04-11 10:48:52 +02:00
Nikita Popov 2191eac3b3 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-10 12:23:01 +02:00
Nikita Popov 6615b9c287 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-10 12:22:34 +02:00
Nikita Popov c7a86a38a3 Fix pgsql use after free trying to reuse closed connection
When a connection is closed, we also need to remove the hash entry
from the regular_list, as it now points to freed memory. To do this
store a reverse mapping from the connection to the hash string.

It would be nicer to introduce a wrapping structure for the pgsql
link resource that could store the hash (and notices), but that would
require large changes to the extension, so I'm going for a more
minimal fix here.
2019-04-10 12:18:57 +02:00
ROVAST 231fecee27 fix a spell mistake
possbile => possible
2019-04-10 10:45:13 +02:00
Dmitry Stogov ec5d4c79d2 Eliminated check for assignment to itself 2019-04-09 15:37:19 +03:00
Dmitry Stogov 5fdee9394f Micro-optimization 2019-04-09 14:38:49 +03:00
Dmitry Stogov fe0a0897ba Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Repare SWITCH VM
2019-04-09 01:17:10 +03:00