Compare commits

..
Author SHA1 Message Date
Sara Golemon cb7b49dcf8 Update versions for PHP 8.0.3 2021-03-02 16:32:10 +00:00
Sara Golemon 763c61db29 Formatting of release date 2021-03-02 16:31:20 +00:00
Sara Golemon fcf5bd7e2a Prep NEWS for 8.0.3 final 2021-03-02 16:29:15 +00:00
Sara Golemon bb858252ac Update NEWS for PHP 8.0.3RC1 2021-02-17 15:12:32 +00:00
Dmitry Stogov 7f68a7afe6 Fixed bug #80745 (JIT produces Assert failure and UNKNOWN:0 var_dumps in code involving bitshifts) 2021-02-17 11:51:13 +03:00
Dylan T 408272b8d9 Remove generated zend_jit_x86.c on make clean
Not removing this causes build failure when reconfiguring and rebuilding after a `make clean`, e.g. enabling/disabling ZTS.

This makes https://bugs.php.net/bug.php?id=80561 more bearable. Ideally it would be rebuilt automatically on configuration change if necessary, but I have no idea how to implement this.

Closes GH-6702.
2021-02-17 09:45:12 +01:00
Dmitry Stogov fad87a24da Fixed bug #80742 (Opcache JIT makes some boolean logic unexpectedly be true) 2021-02-16 20:02:12 +03:00
Nikita Popov edb9229b8b Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Handle incomplete result set metadata more gracefully
2021-02-16 15:34:47 +01:00
Nikita Popov 9552cf6b84 Handle incomplete result set metadata more gracefully
Rather than segfaulting because sname is missing lateron, report
a FAIL here. As this indicates a server bug, the errors is reported
as an out of band warning, rather than a client error.

This fixes the PHP side of bug #80713.
2021-02-16 15:34:14 +01:00
Nikita Popov b63ea1047a Mark resource-like objects as non-comparable
As these hold on to some internal resource, there can't be two
"equal" objects with different identity. Make sure the lack of
public properties doesn't result in these being treated as always
equal.
2021-02-16 14:20:45 +01:00
Nikita Popov cb9785add1 Fixed bug #80723
This fixes the issue just for the Socket class. Presumably we'll
want to do the same for other "resource" objects.
2021-02-16 12:33:50 +01:00
Derick Rethans 2dc75a9e93 Merge branch 'PHP-7.4' into PHP-8.0 2021-02-16 11:31:43 +00:00
Derick Rethans 2d858fbfb1 Fixed dates 2021-02-16 11:31:34 +00:00
Derick Rethans f73e419996 Merge branch 'PHP-7.4' into PHP-8.0 2021-02-16 11:27:17 +00:00
Derick Rethans 6d3d9104e6 PHP-7.4 is now 7.4.17-dev 2021-02-16 11:26:47 +00:00
Nikita Popov 2d7ada2c0b Increase timeout on asan job
Regularly runs against the 5:10 hour limit on master. Increase it
to 6:00 hours.
2021-02-16 10:15:08 +01:00
Nikita Popov 4fb8252186 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Suppress OpenSSL error on missing optional config
2021-02-16 10:12:42 +01:00
Nikita Popov 7566742754 Suppress OpenSSL error on missing optional config
openssl_pkey_new() fetches various options from the config file --
most of these are optional, and not specifying them is not an error
condition from the perspective of the user. Unfortunately, the
CONF_get_string() API pushes an error when accessing a key that
doesn't exist (_CONF_get_string does not, but that is presumably a
private API). This commit adds a helper php_openssl_conf_get_string()
that automatically clears the error in this case. I've found that
OpenSSL occasionally does the same thing internally:
https://github.com/openssl/openssl/blob/22040fb790c854cefb04bed98ed38ea6357daf83/apps/req.c#L515-L517

Closes GH-6699.
2021-02-16 10:11:00 +01:00
Christoph M. Becker afe17cc1b6 Adapt test case for libcurl 7.75.0+
libcurl 7.75.0 finally adds support for `gophers://`, i.e. gopher over
TLS.  The protocol is neither standardized, nor is the protocol
registered with IANA, but well, it is there and the test case should
cater to that.
2021-02-16 00:28:34 +01:00
Nikita Popov f43097a2d7 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80747
2021-02-15 15:34:21 +01:00
Nikita Popov 64b1085464 Fixed bug #80747
If RSA key generation fails, actually report that failure.
2021-02-15 15:34:01 +01:00
Nikita Popov 882862563a Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix symtable cache being used while cleaning symtable
2021-02-15 14:58:59 +01:00
Nikita Popov 7b7d99839c Fix symtable cache being used while cleaning symtable
We need to first clean the symtable and then check whether a cache
slot is available for it. Otherwise, it may happen that a destructor
runs while cleaning the table and uses up all the remaining slots
in the cache.

This is particularly insidious because once we overflow the cache,
the first pointer we modify is symtable_cache_ptr, making it hard
to understand what happened after the fact.

Fixes oss-fuzz #30815.
2021-02-15 14:58:38 +01:00
Nikita Popov c70220205e Fix assertion failure in cufa optimization with named args
Fixes oss-fuzz#30764.
2021-02-15 12:43:31 +01:00
Nikita Popov 8b9dd0a301 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #78680: mysqlnd pam plugin missing terminating null
2021-02-15 11:32:54 +01:00
Daniel Black 3646604203 Fix #78680: mysqlnd pam plugin missing terminating null
The PAM service requires the terminating null to be part
of the communication.

Tested with MariaDB-10.4(pam) and Percona Server 5.7.32(auth_pam_compat).

Also changed MySQL Enterprise test to the server side plugin, authentication_pam
as opposed to the client plugin mysql_clear_password.

Add additional check for pamtest user and pam service file as
all are required for the test.

More importantly, test result should actually succeed.

Thanks Geoff Montee for bug report.

Closes GH-78680.
2021-02-15 11:32:07 +01:00
Nikita Popov 8e9eeca0b3 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix leak when breaking out of FilesystemIterator
2021-02-15 10:38:21 +01:00
Nikita Popov 44a80b64b9 Fix leak when breaking out of FilesystemIterator
We need to always destroy current, not just when iter.data is not
set.

Take this opportunity to clean up the iterator destructor code a
bit, to remove redundant checks and incorrect comments.
2021-02-15 10:37:59 +01:00
Benjamin Eberlei 6ec25f386f Fixed bug #80600 2021-02-12 17:16:48 +01:00
Nikita Popov 5199686873 Fixed bug #80718 2021-02-11 16:49:39 +01:00
Nikita Popov 226395a335 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80719
2021-02-11 16:13:56 +01:00
Nikita Popov c34c523467 Fixed bug #80719 2021-02-11 16:12:06 +01:00
Nikita Popov 7215261349 Update func info after password_get_info() change 2021-02-11 11:44:14 +01:00
Nikita Popov cec5e30889 Don't return null from password_get_info()
The get_info() handler should never fail, but even if it does,
we should still return a proper info array -- it doesn't make
sense that a completely incorrect hash returns an info array,
but a hash that is recognized but for which the options can't
be extracted would return null.
2021-02-11 10:21:31 +01:00
Nikita Popov d80d918547 Don't throw additional Error in require_once if exception already thrown
As pointed out in comments on bug #66216.
2021-02-11 09:41:19 +01:00
Nikita Popov 39c6aaa9cc Make mysqli_ssl_set() arguments nullable
This function internally converts zero length arguments to NULL
argument -- but we should also accept them in the first place.

Null arguments being accepted was actually documented, before
bug #78399 adjusted the docs to match current behavior.
2021-02-10 15:31:27 +01:00
Nikita Popov fd5ff37db7 Make finfo_open() $magic_database nullable
Empty string was interpreted as a special value here, which indicates
that the default magic database should be used. It makes more sense
to use null for this purpose.

The documentation also explicitly mentions that null can be used.
2021-02-10 12:18:42 +01:00
Nikita Popov ce7935e82a Don't pass null action to __doRequest
The parameter is not nullable, so it will be interpreted as
an empty string anyway.

The entire code here is pretty confusing though, and probably
deserves a second loop. The HTTP code only send SOAPAction/action
if soapaction is non-NULL -- but it always is, because it is
accepted through a non-nullable string parameter.

Regarding the SOAPAction header, it appears that always sending
it is actually a requirement of the standard:
> An HTTP client MUST use this header field when issuing a SOAP
> HTTP Request.
Although it does make a distinction between absence of value and
an empty string:
> The header field value of empty string ("") means that the intent
> of the SOAP message is provided by the HTTP Request-URI. No value
> means that there is no indication of the intent of the message.
The empty string interpretation appears to be the desired one.

However, for the action MIME tag the SOAP 1.2 Part 2 specification
says that
> The media type specifies an optional action parameter, which can
> be used to optimize dispatch or routing, among other things.
but also
> The SOAP Action feature defines a single property, which is
> described in Table 14. The value of this property MUST be an
> absolute URI[RFC 3986] and MUST NOT be empty.
which would indicate that we should not be sending an empty
action here.

As I'm not familiar with SOAP and this is long-standing behavior,
I'm just leaving this alone for now...
2021-02-10 12:00:20 +01:00
Nikita Popov 40ba9f6a1a Clarify that location is required in do_request
As far as I can tell, the location is always non-null here,
and the code wouldn't be able to meaningfully work without a
location.
2021-02-10 11:18:20 +01:00
Nikita Popov cff35ca0b2 Regenerate arginfo file
Somehow missed this in the previous commit.
2021-02-10 11:18:06 +01:00
Nikita Popov 788abb8cc8 Accept null $location in SoapClient::__setLocation()
Currently an empty string is used to unset the location. Once
again, it makes more sense to use a null value for this purpose
(though the special behavior of empty strings is retained).

The code comment above the function also explicitly indicates
that null should be accepted, and the function does return null
rather than an empty string for the old location value (if it
is missing).
2021-02-10 10:50:42 +01:00
Nikita Popov 32d128d219 Make SoapVar arguments nullable
$typeName, $typeNamespace, $nodeName and $nodeNamespace all
special-case the empty string and don't set the property entirely
in that case. It makes more sense to use null to indicate absence
here (though of course the empty string behavior is retained).
2021-02-10 10:36:32 +01:00
Máté Kocsis 45fa7596dc Add missing classes to stubs 2021-02-09 22:38:06 +01:00
Nikita Popov 57cb01a927 Properly check imagegd() signature
Unlike imagegd2(), this function only accepts two parameters,
so we should be checking for that.
2021-02-09 15:18:59 +01:00
Nikita Popov 838ae016d7 Make imagegd $file parameter nullable
It is explicitly documented to be nullable, and this matches other
functions like imagepng. It is also documented to accept a stream,
which it currently does not...
2021-02-09 15:15:20 +01:00
Nikita Popov d4aff25473 Use E_ERROR to report arginfo/zpp mismatch
When E_CORE_ERROR is used, we don't get correct file/line information.
2021-02-09 14:36:44 +01:00
Nikita Popov f5768eaa2e Make NumberFormatter ctor $pattern nullable
Whether the pattern is needed depends on the used style. If no
pattern is needed, null is a more sensible value than an empty
string.

fixup
2021-02-09 14:36:41 +01:00
Nikita Popov 186f9bab45 Make IntlDateFormatter ctor $pattern nullable
The implementation already made this argument nullable, but it
was not reflected in the stub.
2021-02-09 14:25:30 +01:00
Nikita Popov 44192ce80b Make Phar $fileNotFoundScript nullable
While "" is already treated the same way as absence, null is the
logically correct default here. Making this one argument non-nullable
is particularly pecular when considering that the preceding $alias
and $index arguments are both nullable.
2021-02-09 12:55:33 +01:00
Nikita Popov 3549f48edc Make createDocument() $namespace nullable
According to the DOM specification, this argument should be
nullable. It's also supposed to be a required argument, but
not changing that at this point.
2021-02-09 12:28:28 +01:00
Nikita Popov ab92ffee22 Make getElementsByTagNameNS $namespace nullable
According to the DOM specification, this argument is supposed to
be nullable.
2021-02-09 12:19:44 +01:00
Christoph M. Becker ff8da0dcff Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Avoid C4090 level 1 warning
2021-02-08 23:12:49 +01:00
Christoph M. Becker 4f508003a9 Avoid C4090 level 1 warning
This breaks the build for PHP 8 by default.
2021-02-08 23:11:37 +01:00
Christoph M. Becker 92f71d9d42 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix locale dependent parsing of PostgreSQL version number
2021-02-08 19:00:37 +01:00
Christoph M. Becker 03713ace23 Fix locale dependent parsing of PostgreSQL version number
Version numbers are not supposed to be localized, so we must not apply
locale dependent parsing with `atof()`.

Using `php_version_compare()` might even be better.

Closes GH-6668.
2021-02-08 18:57:08 +01:00
Christoph M. Becker f731477cd7 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80706: mail(): Headers after Bcc headers may be ignored
2021-02-08 18:43:51 +01:00
Christoph M. Becker ca7547c9e2 Fix #80706: mail(): Headers after Bcc headers may be ignored
We need to handle the case where a CRLF after a Bcc header is not the
beginning of a folding marker, because in that case the Bcc header was
not the last "thing".

Closes GH-6666.
2021-02-08 18:42:31 +01:00
Nikita Popov e2c30c6a2e Restore Laravel test workaround
I accidentally dropped this during a merge, making the Laravel
job fail.
2021-02-07 18:02:19 +01:00
Tyson Andre 5e06dad411 Properly render 2+ namespaces functions in build/gen_stub.php
Affects ZEND_NS_FE

Add test cases of the global function

Backported to php 8.0 from GH-6664
2021-02-06 14:17:14 -05:00
Christoph M. Becker f23bfc4b43 Fix test expectation for PHP 8.0
Since float to string conversion is no longer locale dependent, we have
to expect a dot as decimal separator.
2021-02-05 14:55:26 +01:00
Christoph M. Becker 95e405023e Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Use ST_Y() instead of the deprecated/removed Y() in test
2021-02-05 14:54:25 +01:00
Christoph M. Becker 4ff2665509 Use ST_Y() instead of the deprecated/removed Y() in test 2021-02-05 14:53:19 +01:00
Christoph M. Becker 4be5b4aa25 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #74779: x() and y() truncating floats to integers
2021-02-05 13:12:03 +01:00
Christoph M. Becker 3f8d21b922 Fix #74779: x() and y() truncating floats to integers
We must not use the locale dependent `atof()`, but instead use the
(hopefully) locale independent `zend_strtod()`, when converting string
representations of floating point numbers which are sent by the server.

Closes GH-6665.
2021-02-05 13:09:59 +01:00
Nikita Popov 0c6ff5eafa Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Try SIGTERM before SIGKILL in opcache restart
2021-02-04 17:07:30 +01:00
Nikita Popov 8b7aaad7d6 Try SIGTERM before SIGKILL in opcache restart
SIGTERM is subject to HANDLE_BLOCK_INTERRUPTIONS(), which will
allow code to exit critical sections before it gets terminated.

Closes GH-6493.
2021-02-04 17:07:18 +01:00
Nikita Popov 5cb25a2d32 Fix CLI server worker support
If we create separate listening sockets in each worker using
SO_REUSEADDR, then an incoming connection may be load-balanced
to a process that is already busy, either due to a long-running
request, or because it is a recursive request (in which case we
would deadlock).

Instead, only create one listening socket, and only create worker
forks afterwards. This way the incoming request will be served
by one of the workers that is currently listening for an incoming
connection.
2021-02-04 15:22:34 +01:00
Christoph M. Becker 767ddb1cd5 [ci skip] Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix newly introduced compiler warning
2021-02-03 12:45:31 +01:00
Christoph M. Becker 958e3b93c3 [ci skip] Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix newly introduced compiler warning
2021-02-03 12:43:40 +01:00
Nikita Popov 06c9633b43 Fix newly introduced compiler warning
(cherry picked from commit ab8177de2c)
2021-02-03 12:42:28 +01:00
Christoph M. Becker f4332a36b4 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #53467: Phar cannot compress large archives
2021-02-03 11:24:36 +01:00
Christoph M. Becker 1bb2a4f91c Fix #53467: Phar cannot compress large archives
When Phars are flushed, a new temporary file is created for each entry
which should be compressed, and the `compressed_filesize` is retrieved.
Afterwards, the Phar manifest is written, and only after that the files
are copied to the actual Phar.  So for each such entry there is an open
temp file, what easily exceeds the limit.

Therefore, we use a single temporary file for all entries, and store
the start offset in the otherwise unused `header_offset` member.  We
ensure that the `cfp` members are properly set to NULL even if flushing
fails, to avoid use after free scenarios.

This solution is based on a suggestion by @lserni[1].

Closes GH-6643.

[1] <https://github.com/box-project/box2/issues/80#issuecomment-77147371>
2021-02-03 11:22:37 +01:00
Benjamin Eberlei 665e1f324a Fix bug #80600 DOMChildNode::remove does not work on DOMCharacterData.
Closes GH-6660
2021-02-02 20:26:52 +01:00
Christoph M. Becker 37ab72768f [ci skip] Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  7.3.28 is next
2021-02-02 17:11:01 +01:00
Christoph M. Becker 3d09626f0d [ci skip] Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  7.3.28 is next
2021-02-02 17:07:16 +01:00
Christoph M. Becker 039ca4e219 7.3.28 is next 2021-02-02 17:01:55 +01:00
Nikita Popov f1cf553437 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Update year to 2021
2021-02-02 16:46:52 +01:00
Peter Kokot 8c04944b66 Update year to 2021
Closes GH-6636.
2021-02-02 16:46:16 +01:00
Nikita Popov b20362c24b Remove unnecessary cast in snmp_set_oid_output_format
This cast isn't needed, and could result in the ValueError being
skipped due to truncation.
2021-02-02 16:43:43 +01:00
Nikita Popov 0ec7bfaa43 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Add missing derefs in CurlFile
2021-02-02 10:32:11 +01:00
Nikita Popov 54fa0a69f8 Add missing derefs in CurlFile
As pointed out on GH-6456.
2021-02-02 10:31:16 +01:00
Nikita Popov f1a988af4b Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix persistent leak on load_wsdl_ex failure
2021-02-02 10:07:04 +01:00
Nikita Popov 51d76c346e Fix persistent leak on load_wsdl_ex failure
Move the load_wsdl_ex call into the zend_try that destroys the
docs hash table. The wsdl will be inserted into docs early on,
and will thus be released on subsequent bailout.
2021-02-02 10:05:35 +01:00
Christoph M. Becker efe69168b4 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Revert "Updated to version 2021.1 (2021a)"
2021-02-01 13:43:57 +01:00
Christoph M. Becker 675a9b2831 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Revert "Updated to version 2021.1 (2021a)"
2021-02-01 13:42:43 +01:00
Christoph M. Becker 57257a4335 Revert "Updated to version 2021.1 (2021a)"
This reverts commit 491488d217, since
PHP-7.3 is in security mode, and this does not look security related.
2021-02-01 13:41:32 +01:00
Christoph M. Becker 766d5846b1 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80654: file_get_contents() maxlen fails above (2**31)-1 bytes
2021-02-01 13:00:22 +01:00
Christoph M. Becker 7e9479083d Fix #80654: file_get_contents() maxlen fails above (2**31)-1 bytes
We remove the arbitrary restriction to `INT_MAX`; it is superfluous on
32bit systems where `ZEND_LONG_MAX == INT_MAX` anyway, and not useful
on 64bit systems, where larger files should be readable, if the
`memory_limit` is large enough.

Closes GH-6648.
2021-02-01 12:57:40 +01:00
Nikita Popov cab1ea46e7 XFAIL observer_error_05.phpt test 2021-02-01 10:24:00 +01:00
Nikita Popov 9efd7ddd0a Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix Laravel build on community job
2021-02-01 09:49:13 +01:00
Nikita Popov 217b9e7b41 Fix Laravel build on community job
Now requires PHP 7.4, so use php7.4 to run composer everywhere.
2021-02-01 09:48:14 +01:00
Nikita Popov c72957b409 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix build
2021-02-01 09:46:27 +01:00
Nikita Popov ab8177de2c Fix build 2021-02-01 09:46:17 +01:00
David CARLIER 12d08db913 crc32 mac build fix
Closes GH-6651.
2021-02-01 09:43:12 +01:00
Stanislav Malyshev d94d0dda29 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix bug #80672 - Null Dereference in SoapClient
2021-01-31 21:42:48 -08:00
Stanislav Malyshev 86de4d7af6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #80672 - Null Dereference in SoapClient
2021-01-31 21:42:41 -08:00
Stanislav Malyshev 3c939e3f69 Fix bug #80672 - Null Dereference in SoapClient 2021-01-31 21:15:23 -08:00
1210 changed files with 24838 additions and 110832 deletions

No files matched your search

+1 -2
View File
@@ -327,8 +327,7 @@ Currently we have the following branches in use:
| Branch | |
| --------- | --------- |
| master | Active development branch for PHP 8.1, which is open for backwards incompatible changes and major internal API changes. |
| PHP-8.0 | Is used to release the PHP 8.0.x series. This is a current stable version and is open for bugfixes only. |
| master | Active development branch for PHP 8.0, which is open for backwards incompatible changes and major internal API changes. |
| PHP-7.4 | Is used to release the PHP 7.4.x series. This is a current stable version and is open for bugfixes only. |
| PHP-7.3 | Is used to release the PHP 7.3.x series. This is a current stable version and is open for bugfixes only. |
| PHP-7.2 | Is used to release the PHP 7.2.x series. This is an old stable version and is open for security fixes only. |
+1 -1
View File
@@ -1,6 +1,6 @@
--------------------------------------------------------------------
The PHP License, version 3.01
Copyright (c) 1999 - 2019 The PHP Group. All rights reserved.
Copyright (c) 1999 - 2021 The PHP Group. All rights reserved.
--------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
+585 -22
View File
@@ -1,38 +1,601 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.1.0alpha1
04 Mar 2021, PHP 8.0.3
- Core:
. Fixed inclusion order for phpize builds on Windows. (cmb)
. Added missing hashtable insertion APIs for arr/obj/ref. (Sara)
. Fixed #80706 (mail(): Headers after Bcc headers may be ignored). (cmb)
- FTP:
. Convert resource<ftp> to object \FTPConnection. (Sara)
- DOM:
. Fixed bug #80600 (DOMChildNode::remove() doesn't work on CharacterData
nodes). (beberlei)
- GD:
. Convert resource<gd font> to object \GdFont. (Sara)
- Gettext:
. Fixed bug #53251 (bindtextdomain with null dir doesn't return old value).
(cmb)
- hash:
. Implemented FR #68109 (Add MurmurHash V3). (Anatol, Michael)
. Implemented xxHash support. (Anatol)
- MySQLnd:
. Fixed bug #78680 (mysqlnd's mysql_clear_password does not transmit
null-terminated password). (Daniel Black)
. Fixed bug #80713 (SegFault when disabling ATTR_EMULATE_PREPARES and
MySQL 8.0). (Nikita)
- MySQLi:
. Fixed bug #70372 (Emulate mysqli_fetch_all() for libmysqlclient). (Nikita)
. Fixed bug #80330 (Replace language in APIs and source code/docs).
(Darek Ślusarczyk)
. Fixed bug #74779 (x() and y() truncating floats to integers). (cmb)
- Opcache:
. Fixed bug #80634 (write_property handler of internal classes is skipped on
preloaded JITted code). (Dmitry)
. Fixed bug #80682 (opcache doesn't honour pcre.jit option). (Remi)
. Fixed bug #80742 (Opcache JIT makes some boolean logic unexpectedly be
true). (Dmitry)
. Fixed bug #80745 (JIT produces Assert failure and UNKNOWN:0 var_dumps in
code involving bitshifts). (Dmitry)
- OpenSSL:
. Bump minimal OpenSSL version to 1.0.2. (Jakub Zelenka)
. Fixed bug #80747 (Providing RSA key size < 512 generates key that crash
PHP). (Nikita)
- Phar:
. Fixed bug #75850 (Unclear error message wrt. __halt_compiler() w/o
semicolon) (cmb)
. Fixed bug #70091 (Phar does not mark UTF-8 filenames in ZIP archives). (cmb)
. Fixed bug #53467 (Phar cannot compress large archives). (cmb, lserni)
- Socket:
. Fixed bug #80723 (Different sockets compare as equal (regression in 8.0)).
(Nikita)
- SPL:
. Fixed bug#80719 (Iterating after failed ArrayObject::setIteratorClass()
causes Segmentation fault). (Nikita)
- Standard:
. Fixed bug #80654 (file_get_contents() maxlen fails above (2**31)-1 bytes).
(cmb)
. Fixed bug #80718 (ext/standard/dl.c fallback code path with syntax error).
(Nikita)
21 Jan 2021, PHP 8.0.2
- Core:
. Fixed bug #80523 (bogus parse error on >4GB source code). (Nikita)
. Fixed bug #80384 (filter buffers entire read until file closed). (Adam
Seitz, cmb)
. Fixed bug #80596 (Invalid union type TypeError in anonymous classes).
(Daniil Gentili)
. Fixed bug #80617 (GCC throws warning about type narrowing in
ZEND_TYPE_INIT_CODE). (Nikita)
- BCMath:
. Fixed bug #80545 (bcadd('a', 'a') doesn't throw an exception).
(Jens de Nies)
- Curl:
. Fixed bug #80595 (Resetting POSTFIELDS to empty array breaks request). (cmb)
- Date:
. Fixed bug #80376 (last day of the month causes runway cpu usage). (Derick)
- DOM:
. Fixed bug #80537 (Wrong parameter type in DOMElement::removeAttributeNode
stub). (Nikita)
- Filter:
. Fixed bug #80584 (0x and 0X are considered valid hex numbers by
filter_var()). (girgias)
- GMP:
. Fixed bug #80560 (Strings containing only a base prefix return 0 object).
(girgias)
- Intl:
. Fixed bug #80644 (Missing resource causes subsequent get() calls to fail).
(Nikita)
- MySQLi:
. Fixed bug #67983 (mysqlnd with MYSQLI_OPT_INT_AND_FLOAT_NATIVE fails to
interpret bit columns). (Nikita)
. Fixed bug #64638 (Fetching resultsets from stored procedure with cursor
fails). (Nikita)
. Fixed bug #72862 (segfault using prepared statements on stored procedures
that use a cursor). (Nikita)
. Fixed bug #77935 (Crash in mysqlnd_fetch_stmt_row_cursor when calling an SP
with a cursor). (Nikita)
- ODBC:
. Fixed bug #80592 (all floats are the same in ODBC parameters). (cmb)
- Opcache:
. Fixed bug #80422 (php_opcache.dll crashes when using Apache 2.4 with JIT).
(Dmitry)
- PDO_Firebird:
. Fixed bug #80521 (Parameters with underscores no longer recognized). (cmb,
Simonov Denis)
- Phar:
. Fixed bug #76929 (zip-based phar does not respect phar.require_hash).
(david at bamsoftware, cmb)
. Fixed bug #77565 (Incorrect locator detection in ZIP-based phars). (cmb)
. Fixed bug #69279 (Compressed ZIP Phar extractTo() creates garbage files).
(cmb)
- Phpdbg:
. Reverted fix for bug #76813 (Access violation near NULL on source operand).
(cmb)
07 Jan 2021, PHP 8.0.1
- Core:
. Fixed bug #80345 (PHPIZE configuration has outdated PHP_RELEASE_VERSION).
(cmb)
. Fixed bug #72964 (White space not unfolded for CC/Bcc headers). (cmb)
. Fixed bug #80391 (Iterable not covariant to mixed). (Nikita)
. Fixed bug #80393 (Build of PHP extension fails due to configuration gap
with libtool). (kir dot morozov at gmail dot com)
. Fixed bug #77069 (stream filter loses final block of data). (cmb)
- Fileinfo:
. Fixed bug #77961 (finfo_open crafted magic parsing SIGABRT). (cmb)
- FPM:
. Fixed bug #69625 (FPM returns 200 status on request without
SCRIPT_FILENAME env). (Jakub Zelenka)
- IMAP
. Fixed bug #80438 (imap_msgno() incorrectly warns and return false on valid UIDs in PHP 8.0.0). (girgias)
. Fix a regression with valid UIDs in imap_savebody() (girgias)
. Make warnings for invalid message numbers/UIDs between functions consistent (girgias)
- Intl:
. Fixed bug #80425 (MessageFormatAdapter::getArgTypeList redefined). (Nikita)
- OCI8
. Create Windows DLLs for Oracle Client 19c. (cmb)
- Opcache:
. Fixed bug #80404 (Incorrect range inference result when division results
in float). (Nikita)
. Fixed bug #80377 (Opcache misses executor_globals). (Nikita)
. Fixed bug #80433 (Unable to disable the use of the AVX command when using
JIT). (Nikita)
. Fixed bug #80447 (Strange out of memory error when running with JIT).
(Dmitry)
. Fixed bug #80480 (Segmentation fault with JIT enabled). (Dmitry)
. Fixed bug #80506 (Immediate SIGSEGV upon ini_set("opcache.jit_debug", 1)).
(Dmitry)
- OpenSSL:
. Fixed bug #80368 (OpenSSL extension fails to build against LibreSSL due to
lack of OCB support). (Nikita)
- PDO MySQL:
. Fixed bug #80458 (PDOStatement::fetchAll() throws for upsert queries).
(Kamil Tekiela)
. Fixed bug #63185 (nextRowset() ignores MySQL errors with native prepared
statements). (Nikita)
. Fixed bug #78152 (PDO::exec() - Bad error handling with multiple commands).
(Nikita)
. Fixed bug #66878 (Multiple rowsets not returned unless PDO statement object
is unset()). (Nikita)
. Fixed bug #70066 (Unexpected "Cannot execute queries while other unbuffered
queries"). (Nikita)
. Fixed bug #71145 (Multiple statements in init command triggers unbuffered
query error). (Nikita)
. Fixed bug #76815 (PDOStatement cannot be GCed/closeCursor-ed when a
PROCEDURE resultset SIGNAL). (Nikita)
. Fixed bug #79872 (Can't execute query with pending result sets). (Nikita)
. Fixed bug #79131 (PDO does not throw an exception when parameter values are
missing). (Nikita)
. Fixed bug #72368 (PdoStatement->execute() fails but does not throw an
exception). (Nikita)
. Fixed bug #62889 (LOAD DATA INFILE broken). (Nikita)
. Fixed bug #67004 (Executing PDOStatement::fetch() more than once prevents
releasing resultset). (Nikita)
. Fixed bug #79132 (PDO re-uses parameter values from earlier calls to
execute()). (Nikita)
- Phar:
. Fixed bug #73809 (Phar Zip parse crash - mmap fail). (cmb)
. Fixed bug #75102 (`PharData` says invalid checksum for valid tar). (cmb)
. Fixed bug #77322 (PharData::addEmptyDir('/') Possible integer overflow).
(cmb)
- Phpdbg:
. Fixed bug #76813 (Access violation near NULL on source operand). (cmb)
- SPL:
. Fixed #62004 (SplFileObject: fgets after seek returns wrong line). (cmb)
- Standard:
. Fixed bug #77423 (FILTER_VALIDATE_URL accepts URLs with invalid userinfo).
(CVE-2020-7071) (cmb)
. Fixed bug #80366 (Return Value of zend_fstat() not Checked). (sagpant, cmb)
- Tidy:
. Fixed bug #77594 (ob_tidyhandler is never reset). (cmb)
- Tokenizer:
. Fixed bug #80462 (Nullsafe operator tokenize with TOKEN_PARSE flag fails).
(Nikita)
- XML:
. XmlParser opaque object renamed to XMLParser for consistency with other XML objects. (girgias)
- Zlib:
. Fixed #48725 (Support for flushing in zlib stream). (cmb)
26 Nov 2020, PHP 8.0.0
- BZ2:
. Fixed bug #71263 (fread() does not report bzip2.decompress errors). (cmb)
- CLI:
. Allow debug server binding to an ephemeral port via `-S localhost:0`. (Sara)
- COM:
. Fixed bug #55847 (DOTNET .NET 4.0 GAC new location). (cmb)
. Fixed bug #62474 (com_event_sink crashes on certain arguments). (cmb)
- Calendar:
. Fixed bug #80007 (Potential type confusion in unixtojd() parameter parsing).
(Andy Postnikov)
- Core:
. Fixed bug #36365 (scandir duplicates file name at every 65535th file).
(cmb)
. Fixed bug #49555 (Fatal error "Function must be a string" message should be
renamed). (Nikita)
. Fixed bug #62294 (register_shutdown_function() does not correctly handle
exit code). (Nikita)
. Fixed bug #62609 (Allow implementing Traversable on abstract classes).
(Nikita)
. Fixed bug #65274 (Enhance undefined class constant error with class name).
(Nikita)
. Fixed bug #65275 (Calling exit() in a shutdown function does not change the
exit value in CLI). (Nikita)
. Fixed bug #69084 (Unclear error message when not implementing a renamed
abstract trait function). (Nikita)
. Fixed bug #70839 (Converting optional argument to variadic forbidden by LSP
checks). (Nikita)
. Fixed bug #74558 (Can't rebind closure returned by Closure::fromCallable()).
(cmb)
. Fixed bug #77561 (Shebang line not stripped for non-primary script).
(Nikita)
. Fixed bug #77619 (Wrong reflection on MultipleIterator::__construct).
(Fabien Villepinte)
. Fixed bug #77966 (Cannot alias a method named "namespace"). (Nikita)
. Fixed bug #78236 (convert error on receiving variables when duplicate [).
(cmb)
. Fixed bug #78770 (Incorrect callability check inside internal methods).
(Nikita)
. Fixed bug #79108 (Referencing argument in a function makes it a reference
in the stack trace). (Nikita)
. Fixed bug #79368 ("Unexpected end of file" is not an acceptable error
message). (Alex Dowad)
. Fixed bug #79462 (method_exists and property_exists incoherent behavior).
(cmb)
. Fixed bug #79467 (data:// wrappers are writable). (cmb)
. Fixed bug #79521 (Check __set_state structure). (carusogabriel)
. Fixed bug #79790 ("Illegal offset type" exception during AST evaluation
not handled properly). (Nikita)
. Fixed bug #79791 (Assertion failure when unsetting variable during binary
op). (Nikita)
. Fixed bug #79828 (Segfault when trying to access non-existing variable).
(Nikita)
. Fixed bug #79841 (Syntax error in configure / unescaped "[]" in php.m4).
(Nikita)
. Fixed bug #79852 (count(DOMNodeList) doesn't match
count(IteratorIterator(DOMNodeList))). (Nikita)
. Fixed bug #79867 (Promoted untyped properties should get null default
value). (Nikita)
. Fixed bug #79897 (Promoted constructor params with attribs cause crash).
(Deus Kane)
. Fixed bug #79927 (Generator doesn't throw exception after multiple yield
from iterable). (Nikita)
. Fixed bug #79946 (Build fails due to undeclared UINT32_C). (Nikita)
. Fixed bug #79948 (Exit in auto-prepended file does not abort PHP execution).
(Nikita)
. Fixed bug #80045 (memleak after two set_exception_handler calls with
__call). (Nikita)
. Fixed bug #80096 (Segmentation fault with named arguments in nested call).
(Nikita)
. Fixed bug #80109 (Cannot skip arguments when extended debug is enabled).
(Nikita)
. Fixed bug #80225 (broken namespace usage in eval code). (Nikita)
. Fixed bug #80258 (Windows Deduplication Enabled, randon permission errors).
(cmb)
. Fixed bug #80280 (ADD_EXTENSION_DEP() fails for ext/standard and ext/date).
(cmb)
. Fixed bug #80334 (assert() vs named parameters - confusing error). (Nikita)
. Fixed bug #80055 (Abstract trait methods returning "self" cannot be
fulfilled by traits). (Nikita)
. Fixed faulty generator cleanup with yield from. (Bob)
. Implement #[Attr] Attribute syntax as per final vote in RFC
https://wiki.php.net/rfc/shorter_attribute_syntax_change
. Implemented FR #47074 (phpinfo() reports "On" as 1 for the some
extensions). (cmb)
. Implemented FR #72089 (require() throws fatal error instead of exception).
(Nikita)
. Removed the pdo_odbc.db2_instance_name php.ini directive. (Kalle)
. Use SSE2 instructions do locale independent strtolower. (Laruence)
- Curl:
. Bumped required libcurl version to 7.29.0. (cmb)
. Fixed bug #80121 (Null pointer deref if CurlHandle directly instantiated).
(Nikita)
- DOM:
. Add property DOMXPath::$registerNodeNamespaces and constructor argument
that allow global flag to configure query() or evaluate() calls.
. Fixed bug #79968 (DOMChildNode API crash on unattached nodes). (Benjamin)
. Fixed bug #80268 (loadHTML() truncates at NUL bytes). (cmb)
- Date:
. Fixed bug #60302 (DateTime::createFromFormat should new static(), not new
self()). (Derick)
. Fixed bug #65547 (Default value for sunrise/sunset zenith still wrong).
(cmb)
. Fixed bug #69044 (discrepancy between time and microtime). (krakjoe)
. Fixed bug #80057 (DateTimeImmutable::createFromFormat() does not populate
time). (Derick)
. Implemented FR #79903 (datetime: new format "p", same as "P" but returning
"Z" for UTC). (gharlan)
- Enchant:
. Add LIBENCHANT_VERSION macro.
. Add enchant_dict_add and enchant_dict_is_added functions.
. Deprecate enchant_broker_set_dict_path, enchant_broker_get_dict_path,
enchant_dict_add_to_personal and enchant_dict_is_in_session.
. Use libenchant-2 when available.
- FFI:
. Added FFI\CType::getName() method. (chopins)
. Fixed bug #79177 (FFI doesn't handle well PHP exceptions within callback).
(cmb, Dmitry, Nikita)
. Fixed bug #79749 (Converting FFI instances to bool fails). (cmb)
- FPM:
. Add pm.status_listen option. (Jakub Zelenka)
- Fileinfo:
. Upgrade to libmagic 5.39. (Anatol)
- GD:
. Added imagegetinterpolation(). (cmb)
. Fixed bug #55005 (imagepolygon num_points requirement). (cmb)
. Made the $num_points parameter of php_imagepolygon optional. (cmb)
. Removed deprecated image2wbmp(). (cmb)
. Removed deprecated png2wbmp() and jpeg2wbmp(). (cmb)
. Replaced gd resources with objects. (Mark Randall)
- IMAP:
. Fixed bug #64076 (imap_sort() does not return FALSE on failure). (cmb)
. Fixed bug #76618 (segfault on imap_reopen). (girgias)
. Fixed bug #80213 (imap_mail_compose() segfaults on certain $bodies). (cmb)
. Fixed bug #80215 (imap_mail_compose() may modify by-val parameters). (cmb)
. Fixed bug #80216 (imap_mail_compose() does not validate types/encodings).
(cmb)
. Fixed bug #80220 (imap_mail_compose() may leak memory). (cmb)
. Fixed bug #80223 (imap_mail_compose() leaks envelope on malformed bodies).
(cmb)
. Fixed bug #80226 (imap_sort() leaks sortpgm memory). (cmb)
. Fixed bug #80239 (imap_rfc822_write_address() leaks memory). (cmb)
. Fixed bug #80242 (imap_mail_compose() segfaults for multipart with rfc822).
(cmb)
. Fixed minor regression caused by fixing bug #80220. (cmb)
- Iconv:
. Dropped support for iconv without proper errno setting. (cmb)
- Intl:
. Removed deprecated INTL_IDNA_VARIANT_2003. (cmb)
- JIT:
. Fixed bug #77857 (Wrong result if executed with JIT). (Laruence)
. Fixed bug #79255 (PHP cannot be compiled with enable JIT).
(Laruence, Dmitry)
. Fixed bug #79582 (Crash seen when opcache.jit=1235 and
opcache.jit_debug=2). (Laruence)
. Fixed bug #79743 (Fatal error when assigning to array property
with JIT enabled). (Laruence)
. Fixed bug #79864 (JIT segfault in Symfony OptionsResolver). (Dmitry)
. Fixed bug #79888 (Incorrect execution with JIT enabled). (Dmitry)
- JSON:
. The JSON extension is now an integral part of PHP and cannot be disabled
as per RFC: https://wiki.php.net/rfc/always_enable_json (tandre)
- LDAP:
. Fixed memory leaks. (ptomulik)
. Removed deprecated ldap_sort. (mcmic)
- MBString:
. Fixed bug #76999 (mb_regex_set_options() return current options). (cmb)
. Removed the unused $is_hex parameter from mb_decode_numericentity(). (cmb)
- MySQLi:
. Fixed bug #76809 (SSL settings aren't respected when persistent connections
are used). (fabiomsouto)
- Mysqlnd:
. Fixed #60594 (mysqlnd exposes 160 lines of stats in phpinfo). (PeeHaa)
- OCI8:
. Deprecated old OCI8 function aliases. (Jens de Nies)
. Modernized oci_register_taf_callback() callable argument parsing
implementation. (girgias)
. Removed obsolete no-op function oci_internal_debug(). (Jens de Nies)
- ODBC:
. Fixed bug #22986 (odbc_connect() may reuse persistent connection). (cmb)
. Fixed bug #44618 (Fetching may rely on uninitialized data). (cmb)
- Opcache:
. Fixed bug #76535 (Opcache does not replay compile-time warnings). (Nikita)
. Fixed bug #78654 (Incorrectly computed opcache checksum on files with
non-ascii characters). (mhagstrand)
. Fixed bug #79665 (ini_get() and opcache_get_configuration() inconsistency).
(cmb)
. Fixed bug #80030 (Optimizer segfault with isset on static property with
undef dynamic class name). (Nikita)
. Fixed bug #80175 (PHP8 RC1 - JIT Buffer not working). (cmb)
. Fixed bug #80184 (Complex expression in while / if statements resolves to
false incorrectly). (Nikita)
. Fixed bug #80255 (Opcache bug (bad condition result) in 8.0.0rc1). (Nikita)
. Fixed run-time binding of preloaded dynamically declared function. (Dmitry)
- OpenSSL:
. Added Cryptographic Message Syntax (CMS) support. (Eliot Lear)
- PCRE:
. Don't ignore invalid escape sequences. (sjon)
. Updated to PCRE2 10.35. (cmb)
- PDO:
. Fixed bug #40913 (PDO_MYSQL: PDO::PARAM_LOB does not bind to a stream for
fetching a BLOB). (Nikita)
. Changed default PDO error mode to exceptions. (AllenJB)
. Fixed bug #77849 (Disable cloning of PDO handle/connection objects).
(camporter)
. PDO SQLite:
. Fixed bug #38334 (Proper data-type support for PDO_SQLITE). (Nikita)
- PDO_Firebird:
. Fixed bug #64937 (Firebird PDO preprocessing sql). (Simonov Denis)
- PSpell:
. Convert resource<pspell> to object \PSpell. (Sara)
. Convert resource<pspell config> to object \PSpellConfig. (Sara)
- PDO_OCI:
. Added support for setting and getting the oracle OCI 18c call timeout.
(camporter)
- PDO_PGSQL:
. Bumped required libpq version to 9.1. (cmb)
- PGSQL:
. Bumped required libpq version to 9.1. (cmb)
- Phpdbg:
. Fixed bug #76596 (phpdbg support for display_errors=stderr). (kabel)
. Fixed bug #76801 (too many open files). (alekitto)
. Fixed bug #77800 (phpdbg segfaults on listing some conditional breakpoints).
(krakjoe)
. Fixed bug #77805 (phpdbg build fails when readline is shared). (krakjoe)
- Reflection:
. Fixed bug #64592 (ReflectionClass::getMethods() returns methods out of
scope). (Nikita)
. Fixed bug #69180 (Reflection does not honor trait conflict resolution /
method aliasing). (Nikita)
. Fixed bug #74939 (Nested traits' aliased methods are lowercased). (Nikita)
. Fixed bug #77325 (ReflectionClassConstant::$class returns wrong class when
extending). (Nikita)
. Fixed bug #78697 (ReflectionClass::implementsInterface - inaccurate error
message with traits). (villfa)
. Fixed bug #80190 (ReflectionMethod::getReturnType() does not handle static
as part of union type). (Nikita)
. Fixed bug #80299 (ReflectionFunction->invokeArgs confused in arguments).
(Nikita)
. Fixed bug #80370 (getAttributes segfault on dynamic properties). (Benjamin
Eberlei)
. Implement #79628 (Add $filter parameter for ReflectionClass::getConstants
and ReflectionClass::getReflectionConstants) (carusogabriel)
. Implement ReflectionProperty::hasDefaultValue and
Reflection::getDefaultValue (beberlei)
- SNMP:
. Fixed bug #70461 (disable md5 code when it is not supported in net-snmp).
(Alexander Bergmann, cmb)
- SPL:
. Fixed bug #65006 (spl_autoload_register fails with multiple callables using
self, same method). (Nikita)
. Fixed bug #65387 (Circular references in SPL iterators are not garbage
collected). (Nikita)
. Fixed bug #71236 (Second call of spl_autoload_register() does nothing if it
has no arguments). (Nikita)
. Fixed bug #79987 (Memory leak in SplFileInfo because of missing
zend_restore_error_handling()). (Dmitry)
. SplFixedArray is now IteratorAggregate rather than Iterator. (alexdowad)
- SQLite3:
. Added SQLite3::setAuthorizer() and respective class constants. (bohwaz)
- Session:
. Fixed bug #73529 (session_decode() silently fails on wrong input). (cmb)
. Fixed bug #78624 (session_gc return value for user defined session
handlers). (bshaffer)
- Shmop:
. Converted shmop resources to objects. (cmb)
- SimpleXML:
. Fixed bug #63575 (Root elements are not properly cloned). (cmb)
. Fixed bug #75245 (Don't set content of elements with only whitespaces).
(eriklundin)
- Sodium:
. Fixed bug #77646 (sign_detached() strings not terminated). (Frank)
- Standard:
. Don't force rebuild of symbol table, when populating $http_response_header
variable by the HTTP stream wrapper. (Dmitry)
. Fixed bug #47983 (mixed LF and CRLF line endings in mail()). (cmb)
. Fixed bug #64060 (lstat_stat_variation7.phpt fails on certain file systems).
(M. Voelker, cmb)
. Fixed bug #75902 (str_replace should warn when misused with nested arrays).
(Nikita)
. Fixed bug #76859 (stream_get_line skips data if used with data-generating
filter). (kkopachev)
. Fixed bug #77204 (getimagesize(): Read error! should mention file path).
(peter279k)
. Fixed bug #78385 (parse_url() does not include 'query' when question mark
is the last char). (Islam Israfilov)
. Fixed bug #79868 (Sorting with array_unique gives unwanted result). (Nikita)
. Fixed bug #80256 (file_get_contents strip first line with chunked encoding
redirect). (Nikita)
. Fixed bug #80266 (parse_url silently drops port number 0). (cmb, Nikita)
. Fixed bug #80290 (Double free when ASSERT_CALLBACK is used with a dynamic
message). (Nikita)
. Implemented FR #78638 (__PHP_Incomplete_Class should be final). (Laruence)
. Made quoting of cmd execution functions consistent. (cmb)
- Tidy:
. Removed the unused $use_include_path parameter from tidy_repair_string().
(cmb)
- Tokenizer:
. Fixed bug #80328 (PhpToken::getAll() confusing name). (Nikita)
- XML:
. Fixed bug #76874 (xml_parser_free() should never leak memory). (Nikita)
- XMLWriter:
. Changed functions to accept/return XMLWriter objects instead of resources.
(cmb)
. Implemented FR #79344 (xmlwriter_write_attribute_ns: $prefix should be
nullable). (cmb)
. Removed return types from XMLWriter stubs. (cmb)
- Zip:
. Add "flags" options to ZipArchive::addGlob and addPattern methods
keeping previous behavior having FL_OVERWRITE by default. (Remi)
. Add ZipArchive::EM_UNKNOWN and ZipArchive::EM_TRAD_PKWARE constants. (Remi)
. Add ZipArchive::isCompressionMethodSupported() and
ZipArchive::isEncryptionMethodSupported() method (libzip 1.7.0). (Remi)
. Add ZipArchive::replaceFile() method. (Remi)
. Add ZipArchive::setCancelCallback method (since libzip 1.6.0). (Remi)
. Add ZipArchive::setMtimeName and ZipArchive::setMtimeIndex methods. (Remi)
. Add ZipArchive::setProgressCallback method (since libzip 1.3.0). (Remi)
. Add lastId property to ZipArchive. (Remi)
. Add optional "flags" parameter to ZipArchive::addEmptyDir, addFile and
addFromString methods. (Remi)
. Fixed bug #50678 (files extracted by ZipArchive class lost their
original modified time). (Remi)
. Fixed bug #72374 (remove_path strips first char of filename). (tyage, Remi)
. Implemented FR #77960 (add compression / encryption options for
ZipArchive::addGlob and ZipArchive::addPattern). (Remi)
. ZipArchive::status and ZipArchive::statusSys properties and
ZipArchive::getStatusString() method stay valid after the archive
is closed. (Remi)
- Zlib:
. Fixed bug #71417 (fread() does not report zlib.inflate errors). (cmb)
. Fixed bug #78792 (zlib.output_compression disabled by Content-Type: image/).
(cmb)
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
+2 -7
View File
@@ -40,17 +40,12 @@ For other systems, see the [installation chapter](https://php.net/install).
*For Windows, see [Build your own PHP on Windows](https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2).*
For a minimal PHP build from Git, you will need autoconf, bison, and re2c. For
a default build, you will additionally need libxml2 and libsqlite3.
On Ubuntu, you can install these using:
a default build, you will additionally need libxml2 and libsqlite3. On Ubuntu,
you can install these using:
sudo apt install -y pkg-config build-essential autoconf bison re2c \
libxml2-dev libsqlite3-dev
On Fedora, you can install these using:
sudo dnf install re2c bison autoconf make libtool ccache libxml2-devel sqlite-devel
Generate configure:
./buildconf
+1073 -133
View File
File diff suppressed because it is too large. Load diff
+442 -44
View File
@@ -1,63 +1,461 @@
PHP 8.1 INTERNALS UPGRADE NOTES
PHP 8.0 INTERNALS UPGRADE NOTES
1. Internal API changes
a. Object Handlers API
b. ZEND_OVERLOADED_FUNCTION and corresponding call_method() object handler
c. TSRM changes
d. get() and set() object handlers
e. zend_parse_parameters 'L' specifier
f. Arginfo argument types
g. zend_free_op type and should_free argument of zend_get_zval_ptr()
h. zend_value_error()
i. get_closure() object handler
j. compare_objects() and compare() object handlers
k. The 'I' length modifier
l. Some VM instructions switched to IS_TMP_VAR result instead of IS_VAR
m. All internal functions must have arginfo
n. zend_hash_sort compare function and zend_hash_sort signature change
o. cast_object() object handler is now required
p. ARG_COUNT() macro removed
q. GC_COLLECTABLE flag
r. Cannot implement Traversable only
s. zend_fcall_info no_separation flag removed
t. Signature changes
u. Error Notification callbacks to replace zend_error_cb overwrite use-cases
v. Removed Zend APIs
w. Renamed Zend APIs
x. ZEND_EXT_NOP no longer emitted
2. Build system changes
a. Abstract
b. Unix build system changes
c. Windows build system changes
3. Module changes
a. ext/hash
========================
1. Internal API changes
========================
a. The Object Handlers API was changed to receive zend_object* instead of
zval* and zend_string* instead of zval* for property names. See also
section t for other similar changes.
b. ZEND_OVERLOADED_FUNCTION and corresponding call_method() object handler
were removed. ZEND_INTERNAL_FUNCTION with ZEND_ACC_CALL_VIA_HANDLER and
defined "handler" callback should be used instead. This "handler" callback
should also take care about function cleanup. See ext/zend_test/test.c
for example.
c. The following things have been removed from TSRM:
- TSRMLS_DC
- TSRMLS_D
- TSRMLS_CC
- TSRMLS_C
- TSRMLS_FETCH
- TSRMLS_FETCH_FROM_CTX
- TSRMLS_SET_CTX
- tsrm_new_interpreter_context
- tsrm_set_interpreter_context
- tsrm_free_interpreter_context
- support for GNUPTH, SGI ST, and BETHREADS
d. The get() and set() object handlers have been removed. The get() handler
can generally be replaced with cast_object(). Some uses of set() may be
replaced by do_operation(). If set() was used to overload direct
assignments using "=", then this is no longer supported and the
functionality should be provided in some other way (for example, as
modification of an object property).
e. The zend_parse_parameters 'L' specifier and the Z_PARAM_STRICT_LONG()
family of macros have been removed. Use 'l' and Z_PARAM_LONG() instead,
which, despite the confusing name, actually have stricter input validation.
f. Arginfo argument types for internal functions are no longer checked.
Instead type checks should be performed using the zend_parse_parameters()
or ZEND_PARSE_PARAMETERS_*() APIs.
g. The zend_free_op type and the "should_free" and "type" arguments of
zend_get_zval_ptr() were removed. It's possible to get the old
"should_free" value using the following code:
zval *ret = zend_get_zval_ptr(
opline, opline->op1_type, &opline->op1, execute_data);
zval *should_free = (op_type & (IS_TMP_VAR|IS_VAR)) ? ret : NULL;
h. Added the zend_value_error() function, which is intended to be used
to raise ValueError when inappropriate argument values are passed
to functions.
i. get_closure() object handlers now accept an additional zend_bool parameter
`check_only`. If it is true, the handler is called to check whether the
object is callable; in this case the handler should not throw an exception.
j. compare_objects() handler was removed. Extensions should use compare() object
handler instead and check if both arguments are objects and have the same
compare handler, using ZEND_COMPARE_OBJECTS_FALLBACK() macro.
k. The 'I' length modifier, used to denote 32 and 64bit integer from the custom
snprintf and spprintf implementations has been removed.
Use the ZEND_LONG_FMT, ZEND_ULONG_FMT and ZEND_XLONG_FMT macros defined in
php-src/Zend/zend_long.h
The 'v' format from the custom snprintf and spprintf implementations has
been removed. Use the standard 's' format instead.
l. Some VM instructions switched to IS_TMP_VAR result instead of IS_VAR.
Actually, all assignments (ZEND_ASSIGN, ZEND_ASSIGN_DIM, ZEND_ASSIGN_OBJ,
ZEND_ASSIGN_STATIC_PROP), all compound assignments (ZEND_ASSIGN_OP,
ZEND_ASSIGN_DIM_OP, ZEND_ASSIGN_OBJ_OP, ZEND_ASSIGN_STATIC_PROP_OP) and all
pre increments/decrements (ZEND_PRE_INC, ZEND_PRE_DEC, ZEND_PRE_INC_OBJ
ZEND_PRE_DEC_OBJ, ZEND_PRE_INC_STATIC_PROP ZEND_PRE_DEC_STATIC_PROP).
m. All internal functions and methods are now required to specify arginfo
information, otherwise warnings will be thrown on startup.
n. The zend_hash_sort and zend_hash_minmax APIs now accept a comparison
function with the following signature:
typedef int (*bucket_compare_func_t)(Bucket *a, Bucket *b);
Previously compare_func_t was used, which accepted void pointers.
Furthermore, the return type of zend_hash_sort and zend_ts_hash_sort has
been changed from int to void; these functions always succeed.
o. The cast_object() handler is now required, i.e. must be non-null. You can
indicate that casting is not supported by always returning FAILURE.
p. The ARG_COUNT() macro has been removed use ZEND_NUM_ARGS() instead.
q. GC_COLLECTABLE flag was inverted into GC_NOT_COLLECTABLE.
Assignments to GC_TYPE_INFO() might need to be changed to properly
set the value of the GC_NOT_COLLECTABLE flag.
r. Just for for userland classes, it is no longer allowed to implement only
the Traversable interface. Instead, it is necessary to implement either
Iterator or IteratorAggregate. You can do the latter by implementing
zend_ce_aggregate and providing the following method implementation:
ZEND_METHOD(MyClass, getIterator) {
ZEND_PARSE_PARAMETERS_NONE();
zend_create_internal_iterator_zval(return_value, ZEND_THIS);
}
s. The zend_fcall_info no_separation flag has been removed, and separation is
never allowed. If you wish to pass (or allow passing) arguments by
reference, explicitly create those arguments as references using
ZEND_MAKE_REF. This removal also affects call_user_function_ex(), which
should be replaced by call_user_function().
t. The following ZEND_API function have changed signature:
1. Void in Zend Engine 4.0:
- add_assoc_*()
- add_index_*()
- add_property_*()
- object_init()
- zend_declare_class_constant*()
- zend_declare_property*()
- zend_startup_modules()
- zend_wrong_parameters_none_error()
- zend_fcall_info_argp()
- zend_fcall_info_argv()
- zend_fcall_info_argn()
- zend_startup()
- zend_set_memory_limit()
- pass_two()
- zend_startup_constants()
- zend_shutdown_constants()
- zend_startup_extensions_mechanism()
- zend_startup_extensions()
- zend_register_extension()
- highlight_string()
- zend_ini_startup()
- zend_ini_shutdown()
- zend_ini_global_shutdown()
- zend_ini_deactivate()
- zend_copy_ini_directives()
- zend_prepare_string_for_scanning()
- zend_init_rsrc_list()
- zend_list_close()
- zend_signal()
- zend_sigaction()
- zend_stack_init()
- zend_stack_del_top()
- zend_stack_destroy()
2. Argument int to uint32_t in Zend Engine 4.0:
- _zend_get_parameters_array_ex()
- zend_copy_parameters_array()
- zend_fcall_info_args_save()
- zend_fcall_info_args_restore()
- zend_fcall_info_argp()
- zend_fcall_info_argv()
- zend_fcall_info_argn()
- zend_wrong_parameter*()
- zend_wrong_callback_error()
- zend_parse_arg_class()
3. Argument int to bool in Zend Engine 4.0:
- add_next_index_bool()
- zend_register_class_alias_ex()
- add_assoc_bool_ex()
- add_index_bool()
- zend_fcall_info_args_clear()
- zend_set_local_var()
- zend_set_local_var_str()
- zend_parse_arg_*()
- shutdown_memory_manager()
- zend_memory_usage()
- zend_memory_peak_usage()
- zend_mm_shutdown()
- zend_eval_string*()
- zend_set_timeout()
- _zend_hash_append_ex()
- _zend_hash_append_ptr_ex()
- zend_alter_ini_entry_ex()
- (*zend_encoding_list_parser) typedef
- zend_multibyte_parse_encoding_list()
- zend_safe_address()
- zend_string_tolower_ex()
- zend_string_alloc()
- zend_string_safe_alloc()
- zend_string_init()
- zend_string_dup()
- zend_string_realloc()
- zend_string_extend()
- zend_string_truncate()
- zend_string_safe_realloc()
- zend_string_release_ex()
- zend_ts_hash_merge()
- zend_ts_hash_sort()
4. Argument int to size_t in Zend Engine 4.0:
- zend_set_hash_symbol()
5. Argument zval* to zend_object* in Zend Engine 4.0:
- zend_read_property()
- zend_update_property()
- zend_unset_property()
- zend_call_method()
- zend_objects_clone_obj()
- zend_get_closure_method_def()
- zend_throw_exception_hook()
- zend_throw_exception_internal()
- zend_get_exception_base()
6. Argument zval* to zend_long in Zend Engine 4.0:
- _php_math_longtobase()
7. Return type from int to zend_result in Zend Engine 4.0:
- (*stream_open_function) in _zend_utility_functions
- (*zend_post_startup_cb)
- (*zend_preload_autoload)
- zend_execute_scripts()
- zend_post_startup()
- _zend_get_parameters_array_ex()
- zend_copy_parameters_array()
- zend_parse_parameters()
- zend_parse_parameters_ex()
- zend_parse_method_parameters()
- zend_parse_method_parameters_ex()
- zend_parse_method_parameters()
- zend_register_functions()
- zend_startup_module()
- zend_startup_module_ex()
- zend_register_class_alias_ex()
- zend_disable_function()
- zend_disable_class()
- zend_update_class_constants()
- zend_update_static_property*()
- object_init_ex()
- object_and_properties_init()
- add_index_zval()
- add_next_index_long_*()
- array_set_zval_key()
- _call_user_function_impl()
- zend_fcall_info_*()
- zend_call_function()
- zend_set_hash_symbol()
- zend_delete_global_variable()
- zend_set_local_var()
- zend_set_local_var_str()
- zend_forbid_dynamic_call()
- zend_get_default_from_internal_arg_info()
- zend_try_assign_typed_ref*()
- zend_ast_evaluate()
- zend_startup_builtin_functions()
- do_bind_function()
- do_bind_class()
- zend_unmangle_property_name_ex()
- zend_register_auto_global()
- zend_register_constant()
- zend_exception_error()
- zend_eval_string*()
- zend_undefined_offset_write()
- zend_undefined_index_write()
- zval_update_constant(_ex)()
- zend_load_extension()
- zend_load_extension_handle()
- zend_hash_del(_ind)()
- zend_hash_str_del(_ind)()
- zend_hash_index_del()
- zend_hash_move_forward_ex()
- zend_hash_move_backward_ex()
- zend_hash_get_current_key_ex()
- zend_hash_get_current_key_type_ex()
- zend_symtable_del(_ind)()
- zend_symtable_str_del(_ind)()
- highlight_file()
- zend_do_link_class()
- zend_alter_ini_entry*()
- zend_restore_ini_entry()
- zend_ini_register_displayer()
- zend_ini_open_file_for_scanning()
- zend_ini_prepare_string_for_scanning()
- zend_user_it_valid()
- zend_create_internal_iterator_zval()
- zend_multibyte_set_filter()
- zend_lex_tstring()
- _zend_module_entry module_startup_func, module_shutdown_func,
request_startup_func, request_shutdown_func, and post_deactivate_func function pointers
- (*zend_encoding_list_parser) typedef
- (*zend_encoding_internal_encoding_setter) typedef
- zend_multibyte_set_functions()
- zend_multibyte_set_script_encoding_by_string()
- add_function()
- sub_function()
- mul_function()
- pow_function()
- div_function()
- mod_function()
- boolean_xor_function()
- boolean_not_function()
- bitwise_not_function()
- bitwise_or_function()
- bitwise_and_function()
- bitwise_xor_function()
- shift_left_function()
- shift_right_function()
- concat_function()
- is_equal_function(
- is_identical_function()
- is_not_identical_function()
- is_not_equal_function()
- is_smaller_function()
- is_smaller_or_equal_function(zv
- increment_function()
- decrement_function()
- zend_stream_open()
- zend_stream_fixup()
- zend_ts_hash_del()
- zend_ts_hash_index_del()
8. Return type from int to bool in Zend Engine 4.0:
- zend_make_printable_zval()
- zend_parse_arg_*()
- is_zend_mm()
- is_zend_ptr()
- zend_mm_is_custom_heap()
- (*zend_mm_chunk_truncate_t)
- (*zend_mm_chunk_extend_t)
- zend_bitset_empty()
- zend_is_smart_branch()
- zend_check_arg_send_type()
- zend_verify_const_access()
- zend_gdb_register_code()
- zend_gdb_present()
- _zend_handle_numeric_str(_ex)()
- zend_hash_exists_ind()
- zend_hash_str_exists_ind()
- zend_symtable_exists(_ind)()
- zend_symtable_str_exists()
- (*zend_encoding_lexer_compatibility_checker)
- zend_object_is_true()
- i_zend_is_true()
- zendi_smart_streq()
- zend_stack_is_empty()
- zend_ts_hash_exists()
- zend_ts_hash_index_exists()
9. Argument void to const char* in Zend Engine 4.0:
- zend_get_op_array_extension_handle()
10. Argument zend_extension to const char* in Zend Engine 4.0:
- zend_get_resource_handle()
11. Argument const char * to HMODULE in Zend Engine 4.0:
- php_win32_image_compatible()
12. const char * argument dropped in Zend Engine 4.0:
- php_win32_crt_compatible()
u. Instead of overwriting zend_error_cb extensions with debugging, monitoring
use-cases catching Errors/Exceptions are strongly encouraged to use
the new error observer API instead.
Error observering callbacks are guaranteed to be called regardless of
the users error_reporting setting or userland error handler return values.
Register observer callbacks during MINIT of an extension:
void my_error_observer_cb(int type,
const char *error_filename,
uint32_t error_lineno,
zend_string *message) {
}
zend_observer_error_register(my_error_observer_cb);
v. The following APIs have been removed from the Zend Engine:
- zend_ts_hash_init_ex(), drop the last argument and use zend_ts_hash_init() instead
- zend_hash_init_ex(), drop the last argument and use zend_hash_init() instead
- zval_internal_dtor(), use zval_internal_ptr_dtor() instead
- zval_dtor_func(), use rc_dtor_func() instead
- zval_ptr_dtor_wrapper(), use zval_ptr_dtor() instead
- zval_internal_ptr_dtor_wrapper(), use zval_internal_ptr_dtor() instead
w. The following APIs have been renamed:
- _zend_ts_hash_init() to zend_ts_hash_init()
x. In COMPILE_EXTENDED_STMT mode, a ZEND_EXT_NOP opcode will no longer be
generated at the start of a function. Use the new observer APIs or hook
into zend_execute_ex instead.
========================
2. Build system changes
========================
a. Abstract
1. Symbol HAVE_HASH_EXT is removed and is no longer defined. It should be
considered to have hash extension always available since PHP 7.4.
2. Symbol HAVE_PCRE is removed and is no longer defined. It should be
considered to have pcre extension always available since PHP 7.4.
3. Symbol HAVE_LOCALE_H has been removed and is no longer defined.
4. --disable-inline-optimization (which actually disabled all compiler
optimizations) has been removed. If you wish to build PHP on a host
with extremely constrained memory, and compilation fails with an "out
of memory" message, add "-O0" to CFLAGS.
5. build system and provider are displayed in phpinfo from environment:
- PHP_BUILD_SYSTEM (default is same as PHP_UNAME)
- PHP_BUILD_PROVIDER (no default)
b. Unix build system changes
1. --enable-maintainer-zts is renamed --enable-zts for parity with Windows
and as recognition that ZTS is not a "maintainer" or experimental
feature.
2. The PHP_CHECK_GCC_ARG() m4 macro has been removed in favor of
AX_CHECK_COMPILE_FLAG().
3. The 6th argument of PHP_ADD_SOURCES_X has been removed.
4. The 'special-flags' (3rd) argument of PHP_ADD_SOURCES_X are
now appended instead of prepended to previous compiler flags.
This means compiler flags passed to PHP_NEW_EXTENSION and PHP_ADD_SOURCES
are now appended, this allows to disable compiler flags set by Zend/Zend.m4
(e.g. disable certain compiler flags enabled by -Wextra)
c. Windows build system changes
- The configuration option --enable-crt-debug has been removed. The VC
debug heap can now be enabled for debug builds by setting the environment
variable PHP_WIN32_DEBUG_HEAP to a non-negative number before PHP process
startup.
========================
3. Module changes
========================
a. ext/hash
- The init signatures are extended with an additional `HashTable*`
argument. The passed HT is to contain the algorithm specific
configuration. If the an algorithm doesn't make use of any
additional configuration, the argument is to be marked with
ZEND_ATTRIBUTE_UNUSED.
b. ext/pdo
- The "preparer" callback now accepts a zend_string* instead of
char* + size_t pair the query string. Similarly, the query_string and
active_query_string members of pdo_stmt_t are now zend_string*.
- The way in which drivers provide results has changed: Previously,
the "describer" callback populated the "pdo_type" member in the
pdo_column_data structure, and the "get_col" callback then had to return
pointers to data of appropriate type.
In PHP 8.1, the "describer" callback no longer determines the pdo_type
(and this member has been removed from pdo_column_data). Instead, the
"get_col" callback accepts a zval pointer that may be populated with a
value of arbitrary type. This gives drivers more flexibility in
determining result types (e.g. based on whether a specific integer fits
the PHP integer type) and avoid awkward juggling of temporary buffers.
As the "describer" no longer determines pdo_type, the "get_column_meta"
function is now responsible for providing this information for use by
getColumnMeta(). The type provided here does not need to match the type
returned by get_col (in fact no corresponding type might exist, e.g. for
floats). It should be the closest logical equivalent for the column type.
- The transaction, set_attribute, and preparer handler's return type
has been formalized to bool instead of int.
- The check_liveness handler's return type has been formalized to zend_return
instead of int.
- The closer, and fetch_error handlers have been voidified.
- The quoter handler now returns the quoted string as zend_string* instead
of returning a boolean, and the quoted string as a pair of out params.
Similarly the unquoted string is now a zend_string* instead of a pair of
char* and size_t length.
- The doer handler now accepts a zend_string* instead of char* + size_t
pair for the SQL statement.
- The last_id handler now returns a zend_string* instead of returning a
char* and the length as an out param, and accepts a zend_string* instead
of char* for the optional sequence/table name.
-4
View File
@@ -209,10 +209,6 @@ fi
test -n "$GCC" && CFLAGS="-Wall -Wextra -Wno-strict-aliasing -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare $CFLAGS"
dnl Check if compiler supports -Wno-clobbered (only GCC)
AX_CHECK_COMPILE_FLAG([-Wno-clobbered], CFLAGS="-Wno-clobbered $CFLAGS", , [-Werror])
AX_CHECK_COMPILE_FLAG([-Wduplicated-cond], CFLAGS="-Wduplicated-cond $CFLAGS", , [-Werror])
AX_CHECK_COMPILE_FLAG([-Wlogical-op], CFLAGS="-Wlogical-op $CFLAGS", , [-Werror])
AX_CHECK_COMPILE_FLAG([-Wformat-truncation], CFLAGS="-Wformat-truncation $CFLAGS", , [-Werror])
AX_CHECK_COMPILE_FLAG([-fno-common], CFLAGS="-fno-common $CFLAGS", , [-Werror])
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
+1
View File
@@ -2,6 +2,7 @@
Add $GLOBALS to itself
--FILE--
<?php
$GLOBALS += $GLOBALS;
$x = $GLOBALS + $GLOBALS;
?>
===DONE===
@@ -2,8 +2,8 @@
Attribute validation callback of internal attributes.
--SKIPIF--
<?php
if (!extension_loaded('zend_test')) {
echo "skip requires zend_test extension\n";
if (!extension_loaded('zend-test')) {
echo "skip requires zend-test extension\n";
}
--FILE--
<?php
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #71539.5 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
--FILE--
<?php
$name = 'a';
for ($i = 0; $i < 100000; $i++) {
if ($name != 'i') {
$$name =& $GLOBALS;
}
$name++;
}
?>
OK
--EXPECT--
OK
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #71695 (Global variables are reserved before execution)
--FILE--
<?php
function provideGlobals() {
var_dump(array_key_exists("foo", $GLOBALS));
var_dump(isset($GLOBALS["foo"]));
$GLOBALS += array("foo" => "foo");
}
provideGlobals();
echo $foo;
?>
--EXPECT--
bool(false)
bool(false)
foo
+1 -1
View File
@@ -1,7 +1,7 @@
--TEST--
Bug #78239: Deprecation notice during string conversion converted to exception hangs
--SKIPIF--
<?php if (!extension_loaded("zend_test")) die("skip requires zend_test extension"); ?>
<?php if (!extension_loaded("zend-test")) die("skip requires zend-test extension"); ?>
--FILE--
<?php
function handleError($level, $message, $file = '', $line = 0, $context = [])
+1 -1
View File
@@ -1,7 +1,7 @@
--TEST--
Bug #78335: Static properties containing cycles report as leak (internal class variant)
--SKIPIF--
<?php if (!extension_loaded("zend_test")) die("skip requires zend_test"); ?>
<?php if (!extension_loaded("zend-test")) die("skip requires zend-test"); ?>
--FILE--
<?php
@@ -2,7 +2,7 @@
Check that arguments are freed when calling a deprecated function
--SKIPIF--
<?php
if (!extension_loaded('zend_test')) die('skip zend_test extension not loaded');
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
--FILE--
<?php
@@ -0,0 +1,8 @@
--TEST--
call_user_func_array() + array_slice() + named arguments
--FILE--
<?php
call_user_func_array('func', array_slice(array: $a, 1, 2));
?>
--EXPECTF--
Fatal error: Cannot use positional argument after named argument in %s on line %d
+1 -1
View File
@@ -2,7 +2,7 @@
Internal constant deprecation
--SKIPIF--
<?php
if (!extension_loaded('zend_test')) die('skip requires zend_test');
if (!extension_loaded('zend-test')) die('skip requires zend-test');
?>
--FILE--
<?php
+21
View File
@@ -0,0 +1,21 @@
--TEST--
GC 010: Cycle with reference to $GLOBALS
--INI--
zend.enable_gc=1
--FILE--
<?php
$a = array();
$a[] =& $a;
var_dump($a);
$a[] =& $GLOBALS;
unset($a);
var_dump(gc_collect_cycles());
echo "ok\n"
?>
--EXPECT--
array(1) {
[0]=>
*RECURSION*
}
int(1)
ok
+1 -1
View File
@@ -29,6 +29,6 @@ string(%d) "%s"
Warning: Undefined array key "PHP_SELF" in %s on line %d
NULL
Warning: Undefined global variable $_SERVER in %s on line %d
Warning: Undefined variable $_SERVER in %s on line %d
NULL
Done
+1 -1
View File
@@ -32,6 +32,6 @@ string(%d) "%s"
Warning: Undefined array key "PHP_SELF" in %s on line %d
NULL
Warning: Undefined global variable $_SERVER in %s on line %d
Warning: Undefined variable $_SERVER in %s on line %d
NULL
Done
+1 -1
View File
@@ -38,6 +38,6 @@ string(%d) "%s"
Warning: Undefined array key "PHP_SELF" in %s on line %d
NULL
Warning: Undefined global variable $_SERVER in %s on line %d
Warning: Undefined variable $_SERVER in %s on line %d
NULL
Done
+1 -1
View File
@@ -23,6 +23,6 @@ string(%d) "%s"
Warning: Undefined array key "PHP_SELF" in %s on line %d
NULL
Warning: Undefined global variable $_SERVER in %s on line %d
Warning: Undefined variable $_SERVER in %s on line %d
NULL
Done
+1 -1
View File
@@ -1,7 +1,7 @@
--TEST--
Inherit internal static property into userland class
--SKIPIF--
<?php if (!extension_loaded('zend_test')) die('skip requires zend_test'); ?>
<?php if (!extension_loaded('zend-test')) die('skip requires zend-test'); ?>
--FILE--
<?php
+1 -1
View File
@@ -2,7 +2,7 @@
Test Z_PARAM_ITERABLE() and Z_PARAM_ITERABLE_OR_NULL
--SKIPIF--
<?php
if (!extension_loaded('zend_test')) die('skip zend_test extension not loaded');
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
?>
--FILE--
<?php
-10
View File
@@ -1,10 +0,0 @@
--TEST--
Leading comma in keyed list assignment
--FILE--
<?php
[, "a" => $b] = [1, "a" => 2];
?>
--EXPECTF--
Fatal error: Cannot use empty array entries in keyed array assignment in %s on line %d
-26
View File
@@ -1,26 +0,0 @@
--TEST--
Late Static Binding static:: calls protected / public method of child class even then
the method is private in parent class
--FILE--
<?php
class A {
public static function out() {
echo static::value(), PHP_EOL;
}
private static function value() { return 'A'; }
}
class B extends A {
protected static function value() { return 'B'; }
}
class C extends A {
public static function value() { return 'C'; }
}
A::out();
B::out();
C::out();
echo PHP_EOL;
--EXPECT--
A
B
C
-25
View File
@@ -1,25 +0,0 @@
--TEST--
Late Static Binding static:: accesses protected / public static variables of child
class when the variable is private in parent class
--FILE--
<?php
class A {
private static $value = 'A';
public static function out() {
echo static::$value, PHP_EOL;
}
}
class B extends A {
protected static $value = 'B';
}
class C extends A {
public static $value = 'C';
}
A::out();
B::out();
C::out();
--EXPECT--
A
B
C
@@ -13,7 +13,7 @@ internal_encoding=SJIS
<?php
declare(encoding='Shift_JIS');
$s = "•\"; // 0x95+0x5c in script, not somewhere else "
printf("%x:%x", ord($s[0]), ord($s[1]));
printf("%x:%x\n", ord($s[0]), ord($s[1]));
?>
--EXPECT--
95:5c
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
--TEST--
Passing undefined variable to named arg
Passing undefined variabled to named arg
--FILE--
<?php
-8
View File
@@ -1,8 +0,0 @@
--TEST--
Octal literal followed by whitespace and another number
--FILE--
<?php
var_dump(0o0 2);
?>
--EXPECTF--
Parse error: syntax error, unexpected integer "2", expecting ")" in %s on line %d
+1 -1
View File
@@ -2,7 +2,7 @@
Overloaded function 001
--SKIPIF--
<?php
if (!extension_loaded('zend_test')) die('skip zend_test extension not loaded');
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
?>
--FILE--
<?php
+1 -1
View File
@@ -2,7 +2,7 @@
Overloaded function 002
--SKIPIF--
<?php
if (!extension_loaded('zend_test')) die('skip zend_test extension not loaded');
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
?>
--FILE--
<?php
@@ -0,0 +1,19 @@
--TEST--
Promoting require_once warning to exception
--FILE--
<?php
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
throw new Exception($errstr);
}
set_error_handler("exception_error_handler");
try {
$results = require_once 'does-not-exist.php';
} catch (Exception $e) {
echo $e->getMessage(), "\n";
};
?>
--EXPECT--
require_once(does-not-exist.php): Failed to open stream: No such file or directory
-36
View File
@@ -1,36 +0,0 @@
--TEST--
Behavior of resources as array keys
--FILE--
<?php
$r = fopen(__FILE__, 'r');
$a = [];
echo "Assign:";
$a[$r] = 1;
echo "Add assign:";
$a[$r] += 1;
echo "Inc:";
$a[$r]++;
echo "Get:";
var_dump($a[$r]);
echo "Isset:";
var_dump(isset($a[$r]));
echo "Unset:";
unset($a[$r]);
?>
--EXPECTF--
Assign:
Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
Add assign:
Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
Inc:
Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
Get:
Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
int(3)
Isset:
Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
bool(true)
Unset:
Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
@@ -1,11 +0,0 @@
--TEST--
$GLOBALS no longer contains 'GLOBALS'
--FILE--
<?php
$g = $GLOBALS;
var_dump(isset($g['GLOBALS']));
?>
--EXPECT--
bool(false)
@@ -1,10 +0,0 @@
--TEST--
Cannot append to $GLOBALS
--FILE--
<?php
$GLOBALS[] = 1;
?>
--EXPECTF--
Fatal error: Cannot append to $GLOBALS in %s on line %d
@@ -1,8 +0,0 @@
--TEST--
Cannot append to $GLOBALS in isset()
--FILE--
<?php
isset($GLOBALS[]);
?>
--EXPECTF--
Fatal error: Cannot use [] for reading in %s on line %d
@@ -1,8 +0,0 @@
--TEST--
Cannot append to $GLOBALS in unset()
--FILE--
<?php
unset($GLOBALS[]);
?>
--EXPECTF--
Fatal error: Cannot use [] for unsetting in %s on line %d
@@ -1,10 +0,0 @@
--TEST--
Cannot assign to $GLOBALS
--FILE--
<?php
$GLOBALS = [];
?>
--EXPECTF--
Fatal error: $GLOBALS can only be modified using the $GLOBALS[$name] = $value syntax in %s on line %d
@@ -1,10 +0,0 @@
--TEST--
Cannot list-assign to $GLOBALS
--FILE--
<?php
list($GLOBALS) = [1];
?>
--EXPECTF--
Fatal error: $GLOBALS can only be modified using the $GLOBALS[$name] = $value syntax in %s on line %d
@@ -1,10 +0,0 @@
--TEST--
Cannot list-assign to $GLOBALS (by-ref)
--FILE--
<?php
list(&$GLOBALS) = [1];
?>
--EXPECTF--
Fatal error: Cannot assign reference to non referencable value in %s on line %d
@@ -1,10 +0,0 @@
--TEST--
Cannot compound assign to $GLOBALS
--FILE--
<?php
$GLOBALS += [];
?>
--EXPECTF--
Fatal error: $GLOBALS can only be modified using the $GLOBALS[$name] = $value syntax in %s on line %d
@@ -1,11 +0,0 @@
--TEST--
Cannot by-ref assign to $GLOBALS (LHS)
--FILE--
<?php
$var = [];
$GLOBALS =& $var;
?>
--EXPECTF--
Fatal error: $GLOBALS can only be modified using the $GLOBALS[$name] = $value syntax in %s on line %d
@@ -1,11 +0,0 @@
--TEST--
Cannot by-ref assign to $GLOBALS (RHS)
--FILE--
<?php
$var = [];
$var =& $GLOBALS;
?>
--EXPECTF--
Fatal error: Cannot acquire reference to $GLOBALS in %s on line %d
@@ -1,10 +0,0 @@
--TEST--
Cannot use $GLOBALS as foreach result variable
--FILE--
<?php
foreach ([1] as $GLOBALS) {}
?>
--EXPECTF--
Fatal error: $GLOBALS can only be modified using the $GLOBALS[$name] = $value syntax in %s on line %d
@@ -1,10 +0,0 @@
--TEST--
Cannot use $GLOBALS as foreach result variable (by-ref)
--FILE--
<?php
foreach ([1] as &$GLOBALS) {}
?>
--EXPECTF--
Fatal error: $GLOBALS can only be modified using the $GLOBALS[$name] = $value syntax in %s on line %d
@@ -1,23 +0,0 @@
--TEST--
$GLOBALS cannot be passed by reference (runtime error)
--FILE--
<?php
function by_ref(&$ref) {}
try {
by_ref($GLOBALS);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
by_ref2($GLOBALS);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
function by_ref2(&$ref) {}
?>
--EXPECT--
by_ref(): Argument #1 ($ref) cannot be passed by reference
by_ref2(): Argument #1 ($ref) cannot be passed by reference
@@ -1,10 +0,0 @@
--TEST--
Cannot unset $GLOBALS
--FILE--
<?php
unset($GLOBALS);
?>
--EXPECTF--
Fatal error: $GLOBALS can only be modified using the $GLOBALS[$name] = $value syntax in %s on line %d
@@ -1,11 +0,0 @@
--TEST--
$GLOBALS should have canonicalized keys
--FILE--
<?php
${1} = 42;
var_dump($GLOBALS[1]);
?>
--EXPECT--
int(42)
-52
View File
@@ -1,52 +0,0 @@
--TEST--
Supported operations on $GLOBALS
--FILE--
<?php
function test() {
var_dump($GLOBALS['x']);
$GLOBALS['x'] = 1;
var_dump($GLOBALS['x']);
$GLOBALS['x']++;
var_dump($GLOBALS['x']);
$GLOBALS['x'] += 2;
var_dump($GLOBALS['x']);
unset($GLOBALS['y']);
var_dump(isset($GLOBALS['x']));
var_dump(isset($GLOBALS['y']));
$GLOBALS['z'][] = 1;
}
$y = 1;
test();
var_dump($x, $y, $z);
$ref = 1;
$GLOBALS['z'] =& $ref;
$ref++;
var_dump($z);
$x = 1;
$ref2 =& $GLOBALS['x'];
$ref2++;
var_dump($x);
?>
--EXPECTF--
Warning: Undefined global variable $x in %s on line %d
NULL
int(1)
int(2)
int(4)
bool(true)
bool(false)
Warning: Undefined variable $y in %s on line %d
int(4)
NULL
array(1) {
[0]=>
int(1)
}
int(2)
int(2)
@@ -2,7 +2,7 @@
Return type for internal functions
--SKIPIF--
<?php
if (!extension_loaded('zend_test')) die('skip zend_test extension not loaded');
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
// Internal function return types are only checked in debug builds
if (!PHP_DEBUG) die('skip requires debug build');
?>
@@ -2,7 +2,7 @@
Return type for internal functions 2
--SKIPIF--
<?php
if (!extension_loaded('zend_test')) die('skip zend_test extension not loaded');
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
--FILE--
<?php
zend_test_nullable_array_return();
@@ -2,7 +2,7 @@
Return type for internal functions 3: Void return type
--SKIPIF--
<?php
if (!extension_loaded('zend_test')) die('skip zend_test extension not loaded');
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
--FILE--
<?php
var_dump(zend_test_void_return());
+1 -1
View File
@@ -2,7 +2,7 @@
Test Z_PARAM_OBJ_OF_CLASS_OR_STR() and Z_PARAM_OBJ_OF_CLASS_OR_STR_OR_NULL
--SKIPIF--
<?php
if (!extension_loaded('zend_test')) die('skip zend_test extension not loaded');
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
?>
--FILE--
<?php
+1 -1
View File
@@ -2,7 +2,7 @@
Test Z_PARAM_OBJ_OR_STR() and Z_PARAM_OBJ_OR_STR_OR_NULL
--SKIPIF--
<?php
if (!extension_loaded('zend_test')) die('skip zend_test extension not loaded');
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
?>
--FILE--
<?php
@@ -0,0 +1,19 @@
--TEST--
Symtable cache slots may be acquired while cleaning symtable
--FILE--
<?php
class A {
// Must be larger than the symtable cache.
static $max = 40;
function __destruct() {
if (self::$max-- < 0) return;
$x = 'y';
$$x = new a;
}
}
new A;
?>
===DONE===
--EXPECT--
===DONE===
+1 -1
View File
@@ -2,7 +2,7 @@
Bug #69579 (Internal trait double-free)
--SKIPIF--
<?php
if (!extension_loaded('zend_test')) die('skip zend_test extension not loaded');
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
?>
--FILE--
<?php
@@ -1,7 +1,7 @@
--TEST--
Typed properties in internal classes
--SKIPIF--
<?php if (!extension_loaded('zend_test')) die('skip requires zend_test'); ?>
<?php if (!extension_loaded('zend-test')) die('skip requires zend-test'); ?>
--FILE--
<?php
@@ -2,7 +2,7 @@
Inheritance of union type from internal class
--SKIPIF--
<?php
if (!extension_loaded('zend_test')) die('skip requires zend_test extension');
if (!extension_loaded('zend-test')) die('skip requires zend-test extension');
?>
--FILE--
<?php
+1 -1
View File
@@ -42,5 +42,5 @@ array(0) {
Undefined array key "key"
array(0) {
}
Undefined global variable $test
Undefined array key "test"
Undefined variable $test
+14
View File
@@ -0,0 +1,14 @@
--TEST--
unset() CV 9 (unset() of global variable in array_pop($GLOBALS))
--FILE--
<?php
$x = "ok\n";
echo array_pop($GLOBALS);
echo $x;
echo "ok\n";
?>
--EXPECTF--
ok
Warning: Undefined variable $x in %s on line %d
ok
+1 -3
View File
@@ -2,7 +2,6 @@
unset() CV 10 (unset() of global variable in ArrayObject::offsetUnset($GLOBALS))
--FILE--
<?php
/* This is working on a copy of $GLOBALS, so nothing interesting happens here. */
$a = new ArrayObject($GLOBALS);
$x = "ok\n";
echo $x;
@@ -13,6 +12,5 @@ echo "ok\n";
--EXPECTF--
ok
Warning: Undefined array key "x" in %s on line %d
ok
Warning: Undefined variable $x in %s on line %d
ok
+15 -15
View File
@@ -34,7 +34,6 @@
#include "zend_cpuinfo.h"
#include "zend_attributes.h"
#include "zend_observer.h"
#include "Optimizer/zend_optimizer.h"
static size_t global_map_ptr_last = 0;
@@ -61,7 +60,7 @@ ZEND_TSRMLS_CACHE_DEFINE()
#endif
ZEND_API zend_utility_values zend_uv;
ZEND_API bool zend_dtrace_enabled;
ZEND_API zend_bool zend_dtrace_enabled;
/* version information */
static char *zend_version_info;
@@ -93,7 +92,7 @@ static void (*zend_message_dispatcher_p)(zend_long message, const void *data);
static zval *(*zend_get_configuration_directive_p)(zend_string *name);
#if ZEND_RC_DEBUG
ZEND_API bool zend_rc_debug = 0;
ZEND_API zend_bool zend_rc_debug = 0;
#endif
static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
@@ -109,7 +108,7 @@ static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
static ZEND_INI_MH(OnUpdateGCEnabled) /* {{{ */
{
bool val;
zend_bool val;
val = zend_ini_parse_bool(new_value);
gc_enable(val);
@@ -291,7 +290,7 @@ ZEND_API zend_string *zend_strpprintf_unchecked(size_t max_len, const char *form
static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent);
static void print_hash(smart_str *buf, HashTable *ht, int indent, bool is_object) /* {{{ */
static void print_hash(smart_str *buf, HashTable *ht, int indent, zend_bool is_object) /* {{{ */
{
zval *tmp;
zend_string *string_key;
@@ -525,7 +524,7 @@ static FILE *zend_fopen_wrapper(const char *filename, zend_string **opened_path)
/* }}} */
#ifdef ZTS
static bool short_tags_default = 1;
static zend_bool short_tags_default = 1;
static uint32_t compiler_options_default = ZEND_COMPILE_DEFAULT;
#else
# define short_tags_default 1
@@ -785,10 +784,15 @@ static void module_destructor_zval(zval *zv) /* {{{ */
}
/* }}} */
static bool php_auto_globals_create_globals(zend_string *name) /* {{{ */
static zend_bool php_auto_globals_create_globals(zend_string *name) /* {{{ */
{
/* While we keep registering $GLOBALS as an auto-global, we do not create an
* actual variable for it. Access to it handled specially by the compiler. */
zval globals;
/* IS_ARRAY, but with ref-counter 1 and not IS_TYPE_REFCOUNTED */
ZVAL_ARR(&globals, &EG(symbol_table));
Z_TYPE_FLAGS_P(&globals) = 0;
ZVAL_NEW_REF(&globals, &globals);
zend_hash_update(&EG(symbol_table), name, &globals);
return 0;
}
/* }}} */
@@ -954,8 +958,6 @@ void zend_startup(zend_utility_functions *utility_functions) /* {{{ */
php_win32_cp_setup();
#endif
zend_optimizer_startup();
#ifdef ZTS
tsrm_set_new_thread_end_handler(zend_new_thread_end_handler);
tsrm_set_shutdown_handler(zend_interned_strings_dtor);
@@ -1115,8 +1117,6 @@ void zend_shutdown(void) /* {{{ */
}
#endif
zend_destroy_rsrc_list_dtors();
zend_optimizer_shutdown();
}
/* }}} */
@@ -1292,7 +1292,7 @@ static ZEND_COLD void zend_error_impl(
zval params[4];
zval retval;
zval orig_user_error_handler;
bool in_compilation;
zend_bool in_compilation;
zend_class_entry *saved_class_entry;
zend_stack loop_var_stack;
zend_stack delayed_oplines_stack;
@@ -1596,7 +1596,7 @@ ZEND_API ZEND_COLD void zend_value_error(const char *format, ...) /* {{{ */
va_end(va);
} /* }}} */
ZEND_API ZEND_COLD void zend_output_debug_string(bool trigger_break, const char *format, ...) /* {{{ */
ZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) /* {{{ */
{
#if ZEND_DEBUG
va_list args;
+4 -4
View File
@@ -20,7 +20,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "4.1.0-dev"
#define ZEND_VERSION "4.0.3"
#define ZEND_ENGINE_3
@@ -203,7 +203,7 @@ typedef struct _zend_utility_functions {
} zend_utility_functions;
typedef struct _zend_utility_values {
bool html_errors;
zend_bool html_errors;
} zend_utility_values;
typedef size_t (*zend_write_func_t)(const char *str, size_t str_length);
@@ -255,7 +255,7 @@ ZEND_API void zend_print_flat_zval_r(zval *expr);
#define zend_print_variable(var) \
zend_print_zval((var), 0)
ZEND_API ZEND_COLD void zend_output_debug_string(bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
ZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
ZEND_API void zend_activate(void);
ZEND_API void zend_deactivate(void);
@@ -316,7 +316,7 @@ extern ZEND_API zend_class_entry *zend_standard_class_def;
extern ZEND_API zend_utility_values zend_uv;
/* If DTrace is available and enabled */
extern ZEND_API bool zend_dtrace_enabled;
extern ZEND_API zend_bool zend_dtrace_enabled;
END_EXTERN_C()
#define ZEND_UV(name) (zend_uv.name)
+32 -143
View File
@@ -426,7 +426,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **p
}
/* }}} */
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, bool *dest) /* {{{ */
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, zend_bool *dest) /* {{{ */
{
if (EXPECTED(Z_TYPE_P(arg) <= IS_STRING)) {
*dest = zend_is_true(arg);
@@ -437,7 +437,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, bool *dest) /* {
}
/* }}} */
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, bool *dest) /* {{{ */
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, zend_bool *dest) /* {{{ */
{
if (UNEXPECTED(ZEND_ARG_USES_STRICT_TYPES())) {
return 0;
@@ -644,10 +644,10 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec
case 'l':
{
zend_long *p = va_arg(*va, zend_long *);
bool *is_null = NULL;
zend_bool *is_null = NULL;
if (check_null) {
is_null = va_arg(*va, bool *);
is_null = va_arg(*va, zend_bool *);
}
if (!zend_parse_arg_long(arg, p, is_null, check_null)) {
@@ -659,10 +659,10 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec
case 'd':
{
double *p = va_arg(*va, double *);
bool *is_null = NULL;
zend_bool *is_null = NULL;
if (check_null) {
is_null = va_arg(*va, bool *);
is_null = va_arg(*va, zend_bool *);
}
if (!zend_parse_arg_double(arg, p, is_null, check_null)) {
@@ -731,11 +731,11 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec
case 'b':
{
bool *p = va_arg(*va, bool *);
bool *is_null = NULL;
zend_bool *p = va_arg(*va, zend_bool *);
zend_bool *is_null = NULL;
if (check_null) {
is_null = va_arg(*va, bool *);
is_null = va_arg(*va, zend_bool *);
}
if (!zend_parse_arg_bool(arg, p, is_null, check_null)) {
@@ -956,8 +956,8 @@ static zend_result zend_parse_va_args(uint32_t num_args, const char *type_spec,
uint32_t max_num_args = 0;
uint32_t post_varargs = 0;
zval *arg;
bool have_varargs = 0;
bool have_optional_args = 0;
zend_bool have_varargs = 0;
zend_bool have_optional_args = 0;
zval **varargs = NULL;
int *n_varargs = NULL;
@@ -1130,7 +1130,7 @@ ZEND_API zend_result zend_parse_method_parameters(uint32_t num_args, zval *this_
* Z_OBJ(EG(This)) to NULL when calling an internal function with common.scope == NULL.
* In that case EG(This) would still be the $this from the calling code and we'd take the
* wrong branch here. */
bool is_method = EG(current_execute_data)->func->common.scope != NULL;
zend_bool is_method = EG(current_execute_data)->func->common.scope != NULL;
if (!is_method || !this_ptr || Z_TYPE_P(this_ptr) != IS_OBJECT) {
va_start(va, type_spec);
@@ -1531,33 +1531,6 @@ ZEND_API void add_assoc_stringl_ex(zval *arg, const char *key, size_t key_len, c
}
/* }}} */
ZEND_API void add_assoc_array_ex(zval *arg, const char *key, size_t key_len, zend_array *arr) /* {{{ */
{
zval tmp;
ZVAL_ARR(&tmp, arr);
zend_symtable_str_update(Z_ARRVAL_P(arg), key, key_len, &tmp);
}
/* }}} */
ZEND_API void add_assoc_object_ex(zval *arg, const char *key, size_t key_len, zend_object *obj) /* {{{ */
{
zval tmp;
ZVAL_OBJ(&tmp, obj);
zend_symtable_str_update(Z_ARRVAL_P(arg), key, key_len, &tmp);
}
/* }}} */
ZEND_API void add_assoc_reference_ex(zval *arg, const char *key, size_t key_len, zend_reference *ref) /* {{{ */
{
zval tmp;
ZVAL_REF(&tmp, ref);
zend_symtable_str_update(Z_ARRVAL_P(arg), key, key_len, &tmp);
}
/* }}} */
ZEND_API void add_assoc_zval_ex(zval *arg, const char *key, size_t key_len, zval *value) /* {{{ */
{
zend_symtable_str_update(Z_ARRVAL_P(arg), key, key_len, value);
@@ -1636,33 +1609,6 @@ ZEND_API void add_index_stringl(zval *arg, zend_ulong index, const char *str, si
}
/* }}} */
ZEND_API void add_index_array(zval *arg, zend_ulong index, zend_array *arr) /* {{{ */
{
zval tmp;
ZVAL_ARR(&tmp, arr);
zend_hash_index_update(Z_ARRVAL_P(arg), index, &tmp);
}
/* }}} */
ZEND_API void add_index_object(zval *arg, zend_ulong index, zend_object *obj) /* {{{ */
{
zval tmp;
ZVAL_OBJ(&tmp, obj);
zend_hash_index_update(Z_ARRVAL_P(arg), index, &tmp);
}
/* }}} */
ZEND_API void add_index_reference(zval *arg, zend_ulong index, zend_reference *ref) /* {{{ */
{
zval tmp;
ZVAL_REF(&tmp, ref);
zend_hash_index_update(Z_ARRVAL_P(arg), index, &tmp);
}
/* }}} */
ZEND_API zend_result add_next_index_long(zval *arg, zend_long n) /* {{{ */
{
zval tmp;
@@ -1681,7 +1627,7 @@ ZEND_API zend_result add_next_index_null(zval *arg) /* {{{ */
}
/* }}} */
ZEND_API zend_result add_next_index_bool(zval *arg, bool b) /* {{{ */
ZEND_API zend_result add_next_index_bool(zval *arg, zend_bool b) /* {{{ */
{
zval tmp;
@@ -1735,33 +1681,6 @@ ZEND_API zend_result add_next_index_stringl(zval *arg, const char *str, size_t l
}
/* }}} */
ZEND_API zend_result add_next_index_array(zval *arg, zend_array *arr) /* {{{ */
{
zval tmp;
ZVAL_ARR(&tmp, arr);
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp) ? SUCCESS : FAILURE;
}
/* }}} */
ZEND_API zend_result add_next_index_object(zval *arg, zend_object *obj) /* {{{ */
{
zval tmp;
ZVAL_OBJ(&tmp, obj);
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp) ? SUCCESS : FAILURE;
}
/* }}} */
ZEND_API zend_result add_next_index_reference(zval *arg, zend_reference *ref) /* {{{ */
{
zval tmp;
ZVAL_REF(&tmp, ref);
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp) ? SUCCESS : FAILURE;
}
/* }}} */
ZEND_API zend_result array_set_zval_key(HashTable *ht, zval *key, zval *value) /* {{{ */
{
zval *result;
@@ -1879,36 +1798,6 @@ ZEND_API void add_property_stringl_ex(zval *arg, const char *key, size_t key_len
}
/* }}} */
ZEND_API void add_property_array_ex(zval *arg, const char *key, size_t key_len, zend_array *arr) /* {{{ */
{
zval tmp;
ZVAL_ARR(&tmp, arr);
add_property_zval_ex(arg, key, key_len, &tmp);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
}
/* }}} */
ZEND_API void add_property_object_ex(zval *arg, const char *key, size_t key_len, zend_object *obj) /* {{{ */
{
zval tmp;
ZVAL_OBJ(&tmp, obj);
add_property_zval_ex(arg, key, key_len, &tmp);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
}
/* }}} */
ZEND_API void add_property_reference_ex(zval *arg, const char *key, size_t key_len, zend_reference *ref) /* {{{ */
{
zval tmp;
ZVAL_REF(&tmp, ref);
add_property_zval_ex(arg, key, key_len, &tmp);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
}
/* }}} */
ZEND_API void add_property_zval_ex(zval *arg, const char *key, size_t key_len, zval *value) /* {{{ */
{
zend_string *str;
@@ -2949,7 +2838,7 @@ ZEND_API zend_result zend_register_class_alias_ex(const char *name, size_t name_
/* }}} */
// TODO num_symbol_tables as unsigned int?
ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, bool is_ref, int num_symbol_tables, ...) /* {{{ */
ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, zend_bool is_ref, int num_symbol_tables, ...) /* {{{ */
{
HashTable *symbol_table;
va_list symbol_table_list;
@@ -3448,11 +3337,11 @@ ZEND_API zend_string *zend_get_callable_name(zval *callable) /* {{{ */
}
/* }}} */
ZEND_API bool zend_is_callable_at_frame(
ZEND_API zend_bool zend_is_callable_at_frame(
zval *callable, zend_object *object, zend_execute_data *frame,
uint32_t check_flags, zend_fcall_info_cache *fcc, char **error) /* {{{ */
{
bool ret;
zend_bool ret;
zend_fcall_info_cache fcc_local;
bool strict_class = 0;
@@ -3569,7 +3458,7 @@ check_func:
}
/* }}} */
ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error) /* {{{ */
ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error) /* {{{ */
{
/* Determine callability at the first parent user frame. */
zend_execute_data *frame = EG(current_execute_data);
@@ -3577,20 +3466,20 @@ ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t
frame = frame->prev_execute_data;
}
bool ret = zend_is_callable_at_frame(callable, object, frame, check_flags, fcc, error);
zend_bool ret = zend_is_callable_at_frame(callable, object, frame, check_flags, fcc, error);
if (callable_name) {
*callable_name = zend_get_callable_name_ex(callable, object);
}
return ret;
}
ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name) /* {{{ */
ZEND_API zend_bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name) /* {{{ */
{
return zend_is_callable_ex(callable, NULL, check_flags, callable_name, NULL, NULL);
}
/* }}} */
ZEND_API bool zend_make_callable(zval *callable, zend_string **callable_name) /* {{{ */
ZEND_API zend_bool zend_make_callable(zval *callable, zend_string **callable_name) /* {{{ */
{
zend_fcall_info_cache fcc;
@@ -3790,7 +3679,7 @@ static inline zend_string *zval_make_interned_string(zval *zv) /* {{{ */
return Z_STR_P(zv);
}
static zend_always_inline bool is_persistent_class(zend_class_entry *ce) {
static zend_always_inline zend_bool is_persistent_class(zend_class_entry *ce) {
return (ce->type & ZEND_INTERNAL_CLASS)
&& ce->info.internal.module->type == MODULE_PERSISTENT;
}
@@ -3898,7 +3787,7 @@ ZEND_API zend_property_info *zend_declare_typed_property(zend_class_entry *ce, z
}
/* }}} */
ZEND_API zend_result zend_try_assign_typed_ref_ex(zend_reference *ref, zval *val, bool strict) /* {{{ */
ZEND_API zend_result zend_try_assign_typed_ref_ex(zend_reference *ref, zval *val, zend_bool strict) /* {{{ */
{
if (UNEXPECTED(!zend_verify_ref_assignable_zval(ref, val, strict))) {
zval_ptr_dtor(val);
@@ -3926,7 +3815,7 @@ ZEND_API zend_result zend_try_assign_typed_ref_null(zend_reference *ref) /* {{{
}
/* }}} */
ZEND_API zend_result zend_try_assign_typed_ref_bool(zend_reference *ref, bool val) /* {{{ */
ZEND_API zend_result zend_try_assign_typed_ref_bool(zend_reference *ref, zend_bool val) /* {{{ */
{
zval tmp;
@@ -4016,7 +3905,7 @@ ZEND_API zend_result zend_try_assign_typed_ref_zval(zend_reference *ref, zval *z
}
/* }}} */
ZEND_API zend_result zend_try_assign_typed_ref_zval_ex(zend_reference *ref, zval *zv, bool strict) /* {{{ */
ZEND_API zend_result zend_try_assign_typed_ref_zval_ex(zend_reference *ref, zval *zv, zend_bool strict) /* {{{ */
{
zval tmp;
@@ -4167,7 +4056,7 @@ ZEND_API void zend_declare_class_constant_long(zend_class_entry *ce, const char
}
/* }}} */
ZEND_API void zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, bool value) /* {{{ */
ZEND_API void zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value) /* {{{ */
{
zval constant;
@@ -4408,7 +4297,7 @@ ZEND_API zend_result zend_update_static_property_stringl(zend_class_entry *scope
}
/* }}} */
ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, bool silent, zval *rv) /* {{{ */
ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, zend_bool silent, zval *rv) /* {{{ */
{
zval *value;
zend_class_entry *old_scope = EG(fake_scope);
@@ -4422,7 +4311,7 @@ ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *objec
}
/* }}} */
ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, bool silent, zval *rv) /* {{{ */
ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_bool silent, zval *rv) /* {{{ */
{
zval *value;
zend_string *str;
@@ -4434,7 +4323,7 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object,
}
/* }}} */
ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, bool silent) /* {{{ */
ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, zend_bool silent) /* {{{ */
{
zval *property;
zend_class_entry *old_scope = EG(fake_scope);
@@ -4447,7 +4336,7 @@ ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string
}
/* }}} */
ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, bool silent) /* {{{ */
ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent) /* {{{ */
{
zend_string *key = zend_string_init(name, name_length, 0);
zval *property = zend_read_static_property_ex(scope, key, silent);
@@ -4493,7 +4382,7 @@ ZEND_API ZEND_COLD const char *zend_get_object_type(const zend_class_entry *ce)
}
/* }}} */
ZEND_API bool zend_is_iterable(zval *iterable) /* {{{ */
ZEND_API zend_bool zend_is_iterable(zval *iterable) /* {{{ */
{
switch (Z_TYPE_P(iterable)) {
case IS_ARRAY:
@@ -4506,7 +4395,7 @@ ZEND_API bool zend_is_iterable(zval *iterable) /* {{{ */
}
/* }}} */
ZEND_API bool zend_is_countable(zval *countable) /* {{{ */
ZEND_API zend_bool zend_is_countable(zval *countable) /* {{{ */
{
switch (Z_TYPE_P(countable)) {
case IS_ARRAY:
@@ -4530,7 +4419,7 @@ static zend_result get_default_via_ast(zval *default_value_zval, const char *def
zend_string *code = zend_string_concat3(
"<?php ", sizeof("<?php ") - 1, default_value, strlen(default_value), ";", 1);
ast = zend_compile_string_to_ast(code, &ast_arena, ZSTR_EMPTY_ALLOC());
ast = zend_compile_string_to_ast(code, &ast_arena, "");
zend_string_release(code);
if (!ast) {
+98 -75
View File
@@ -352,12 +352,12 @@ ZEND_API ZEND_COLD void zend_wrong_param_count(void);
ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc);
ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, zend_object *object);
ZEND_API zend_string *zend_get_callable_name(zval *callable);
ZEND_API bool zend_is_callable_at_frame(
ZEND_API zend_bool zend_is_callable_at_frame(
zval *callable, zend_object *object, zend_execute_data *frame,
uint32_t check_flags, zend_fcall_info_cache *fcc, char **error);
ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error);
ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name);
ZEND_API bool zend_make_callable(zval *callable, zend_string **callable_name);
ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error);
ZEND_API zend_bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name);
ZEND_API zend_bool zend_make_callable(zval *callable, zend_string **callable_name);
ZEND_API const char *zend_get_module_version(const char *module_name);
ZEND_API int zend_get_module_started(const char *module_name);
@@ -376,7 +376,7 @@ ZEND_API zend_class_constant *zend_declare_class_constant_ex(zend_class_entry *c
ZEND_API void zend_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value);
ZEND_API void zend_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length);
ZEND_API void zend_declare_class_constant_long(zend_class_entry *ce, const char *name, size_t name_length, zend_long value);
ZEND_API void zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, bool value);
ZEND_API void zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value);
ZEND_API void zend_declare_class_constant_double(zend_class_entry *ce, const char *name, size_t name_length, double value);
ZEND_API void zend_declare_class_constant_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_length);
ZEND_API void zend_declare_class_constant_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value);
@@ -403,11 +403,11 @@ ZEND_API zend_result zend_update_static_property_double(zend_class_entry *scope,
ZEND_API zend_result zend_update_static_property_string(zend_class_entry *scope, const char *name, size_t name_length, const char *value);
ZEND_API zend_result zend_update_static_property_stringl(zend_class_entry *scope, const char *name, size_t name_length, const char *value, size_t value_length);
ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, bool silent, zval *rv);
ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, bool silent, zval *rv);
ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, zend_bool silent, zval *rv);
ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_bool silent, zval *rv);
ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, bool silent);
ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, bool silent);
ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, zend_bool silent);
ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent);
ZEND_API const char *zend_get_type_by_const(int type);
@@ -445,9 +445,6 @@ ZEND_API void add_assoc_double_ex(zval *arg, const char *key, size_t key_len, do
ZEND_API void add_assoc_str_ex(zval *arg, const char *key, size_t key_len, zend_string *str);
ZEND_API void add_assoc_string_ex(zval *arg, const char *key, size_t key_len, const char *str);
ZEND_API void add_assoc_stringl_ex(zval *arg, const char *key, size_t key_len, const char *str, size_t length);
ZEND_API void add_assoc_array_ex(zval *arg, const char *key, size_t key_len, zend_array *arr);
ZEND_API void add_assoc_object_ex(zval *arg, const char *key, size_t key_len, zend_object *obj);
ZEND_API void add_assoc_reference_ex(zval *arg, const char *key, size_t key_len, zend_reference *ref);
ZEND_API void add_assoc_zval_ex(zval *arg, const char *key, size_t key_len, zval *value);
#define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key), __n)
@@ -458,9 +455,6 @@ ZEND_API void add_assoc_zval_ex(zval *arg, const char *key, size_t key_len, zval
#define add_assoc_str(__arg, __key, __str) add_assoc_str_ex(__arg, __key, strlen(__key), __str)
#define add_assoc_string(__arg, __key, __str) add_assoc_string_ex(__arg, __key, strlen(__key), __str)
#define add_assoc_stringl(__arg, __key, __str, __length) add_assoc_stringl_ex(__arg, __key, strlen(__key), __str, __length)
#define add_assoc_array(__arg, __key, __arr) add_assoc_array_ex(__arg, __key, strlen(__key), __arr)
#define add_assoc_object(__arg, __key, __obj) add_assoc_object_ex(__arg, __key, strlen(__key), __obj)
#define add_assoc_reference(__arg, __key, __ref) add_assoc_object_ex(__arg, __key, strlen(__key), __ref)
#define add_assoc_zval(__arg, __key, __value) add_assoc_zval_ex(__arg, __key, strlen(__key), __value)
ZEND_API void add_index_long(zval *arg, zend_ulong index, zend_long n);
@@ -471,9 +465,6 @@ ZEND_API void add_index_double(zval *arg, zend_ulong index, double d);
ZEND_API void add_index_str(zval *arg, zend_ulong index, zend_string *str);
ZEND_API void add_index_string(zval *arg, zend_ulong index, const char *str);
ZEND_API void add_index_stringl(zval *arg, zend_ulong index, const char *str, size_t length);
ZEND_API void add_index_array(zval *arg, zend_ulong index, zend_array *arr);
ZEND_API void add_index_object(zval *arg, zend_ulong index, zend_object *obj);
ZEND_API void add_index_reference(zval *arg, zend_ulong index, zend_reference *ref);
static zend_always_inline zend_result add_index_zval(zval *arg, zend_ulong index, zval *value)
{
@@ -482,15 +473,12 @@ static zend_always_inline zend_result add_index_zval(zval *arg, zend_ulong index
ZEND_API zend_result add_next_index_long(zval *arg, zend_long n);
ZEND_API zend_result add_next_index_null(zval *arg);
ZEND_API zend_result add_next_index_bool(zval *arg, bool b);
ZEND_API zend_result add_next_index_bool(zval *arg, zend_bool b);
ZEND_API zend_result add_next_index_resource(zval *arg, zend_resource *r);
ZEND_API zend_result add_next_index_double(zval *arg, double d);
ZEND_API zend_result add_next_index_str(zval *arg, zend_string *str);
ZEND_API zend_result add_next_index_string(zval *arg, const char *str);
ZEND_API zend_result add_next_index_stringl(zval *arg, const char *str, size_t length);
ZEND_API zend_result add_next_index_array(zval *arg, zend_array *arr);
ZEND_API zend_result add_next_index_object(zval *arg, zend_object *obj);
ZEND_API zend_result add_next_index_reference(zval *arg, zend_reference *ref);
static zend_always_inline zend_result add_next_index_zval(zval *arg, zval *value)
{
@@ -507,9 +495,6 @@ ZEND_API void add_property_double_ex(zval *arg, const char *key, size_t key_len,
ZEND_API void add_property_str_ex(zval *arg, const char *key, size_t key_len, zend_string *str);
ZEND_API void add_property_string_ex(zval *arg, const char *key, size_t key_len, const char *str);
ZEND_API void add_property_stringl_ex(zval *arg, const char *key, size_t key_len, const char *str, size_t length);
ZEND_API void add_property_array_ex(zval *arg, const char *key, size_t key_len, zend_array *arr);
ZEND_API void add_property_object_ex(zval *arg, const char *key, size_t key_len, zend_object *obj);
ZEND_API void add_property_reference_ex(zval *arg, const char *key, size_t key_len, zend_reference *ref);
ZEND_API void add_property_zval_ex(zval *arg, const char *key, size_t key_len, zval *value);
#define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key), __n)
@@ -520,9 +505,6 @@ ZEND_API void add_property_zval_ex(zval *arg, const char *key, size_t key_len, z
#define add_property_str(__arg, __key, __str) add_property_str_ex(__arg, __key, strlen(__key), __str)
#define add_property_string(__arg, __key, __str) add_property_string_ex(__arg, __key, strlen(__key), __str)
#define add_property_stringl(__arg, __key, __str, __length) add_property_stringl_ex(__arg, __key, strlen(__key), __str, __length)
#define add_property_array(__arg, __key, __arr) add_property_array_ex(__arg, __key, strlen(__key), __arr)
#define add_property_object(__arg, __key, __obj) add_property_object_ex(__arg, __key, strlen(__key), __obj)
#define add_property_reference(__arg, __key, __ref) add_property_reference_ex(__arg, __key, strlen(__key), __ref)
#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key), __value)
@@ -623,7 +605,7 @@ static zend_always_inline void zend_call_known_instance_method_with_1_params(
ZEND_API void zend_call_known_instance_method_with_2_params(
zend_function *fn, zend_object *object, zval *retval_ptr, zval *param1, zval *param2);
ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, bool is_ref, int num_symbol_tables, ...);
ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, zend_bool is_ref, int num_symbol_tables, ...);
ZEND_API zend_result zend_delete_global_variable(zend_string *name);
@@ -648,9 +630,9 @@ static zend_always_inline zend_result zend_forbid_dynamic_call(const char *func_
ZEND_API ZEND_COLD const char *zend_get_object_type(const zend_class_entry *ce);
ZEND_API bool zend_is_iterable(zval *iterable);
ZEND_API zend_bool zend_is_iterable(zval *iterable);
ZEND_API bool zend_is_countable(zval *countable);
ZEND_API zend_bool zend_is_countable(zval *countable);
ZEND_API zend_result zend_get_default_from_internal_arg_info(
zval *default_value_zval, zend_internal_arg_info *arg_info);
@@ -797,11 +779,11 @@ END_EXTERN_C()
/* May modify arg in-place. Will free arg in failure case (and take ownership in success case).
* Prefer using the ZEND_TRY_ASSIGN_* macros over these APIs. */
ZEND_API zend_result zend_try_assign_typed_ref_ex(zend_reference *ref, zval *zv, bool strict);
ZEND_API zend_result zend_try_assign_typed_ref_ex(zend_reference *ref, zval *zv, zend_bool strict);
ZEND_API zend_result zend_try_assign_typed_ref(zend_reference *ref, zval *zv);
ZEND_API zend_result zend_try_assign_typed_ref_null(zend_reference *ref);
ZEND_API zend_result zend_try_assign_typed_ref_bool(zend_reference *ref, bool val);
ZEND_API zend_result zend_try_assign_typed_ref_bool(zend_reference *ref, zend_bool val);
ZEND_API zend_result zend_try_assign_typed_ref_long(zend_reference *ref, zend_long lval);
ZEND_API zend_result zend_try_assign_typed_ref_double(zend_reference *ref, double dval);
ZEND_API zend_result zend_try_assign_typed_ref_empty_string(zend_reference *ref);
@@ -811,7 +793,7 @@ ZEND_API zend_result zend_try_assign_typed_ref_stringl(zend_reference *ref, cons
ZEND_API zend_result zend_try_assign_typed_ref_arr(zend_reference *ref, zend_array *arr);
ZEND_API zend_result zend_try_assign_typed_ref_res(zend_reference *ref, zend_resource *res);
ZEND_API zend_result zend_try_assign_typed_ref_zval(zend_reference *ref, zval *zv);
ZEND_API zend_result zend_try_assign_typed_ref_zval_ex(zend_reference *ref, zval *zv, bool strict);
ZEND_API zend_result zend_try_assign_typed_ref_zval_ex(zend_reference *ref, zval *zv, zend_bool strict);
#define _ZEND_TRY_ASSIGN_NULL(zv, is_ref) do { \
zval *_zv = zv; \
@@ -1300,8 +1282,8 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
zval *_real_arg, *_arg = NULL; \
zend_expected_type _expected_type = Z_EXPECTED_LONG; \
char *_error = NULL; \
ZEND_ATTRIBUTE_UNUSED bool _dummy; \
bool _optional = 0; \
ZEND_ATTRIBUTE_UNUSED zend_bool _dummy; \
zend_bool _optional = 0; \
int _error_code = ZPP_ERROR_OK; \
((void)_i); \
((void)_real_arg); \
@@ -1332,7 +1314,6 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
} while (0)
#define ZEND_PARSE_PARAMETERS_END_EX(failure) \
ZEND_ASSERT(_i == _max_num_args || _max_num_args == (uint32_t) -1); \
} while (0); \
if (UNEXPECTED(_error_code != ZPP_ERROR_OK)) { \
if (!(_flags & ZEND_PARSE_PARAMS_QUIET)) { \
@@ -1415,14 +1396,17 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
Z_PARAM_ITERABLE_EX(dest, 1)
/* old "b" */
#define Z_PARAM_BOOL_EX(dest, is_null, check_null, deref) \
Z_PARAM_PROLOGUE(deref, 0); \
#define Z_PARAM_BOOL_EX2(dest, is_null, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
if (UNEXPECTED(!zend_parse_arg_bool(_arg, &dest, &is_null, check_null))) { \
_expected_type = check_null ? Z_EXPECTED_BOOL_OR_NULL : Z_EXPECTED_BOOL; \
_error_code = ZPP_ERROR_WRONG_ARG; \
break; \
}
#define Z_PARAM_BOOL_EX(dest, is_null, check_null, separate) \
Z_PARAM_BOOL_EX2(dest, is_null, check_null, separate, separate)
#define Z_PARAM_BOOL(dest) \
Z_PARAM_BOOL_EX(dest, _dummy, 0, 0)
@@ -1430,13 +1414,16 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
Z_PARAM_BOOL_EX(dest, is_null, 1, 0)
/* old "C" */
#define Z_PARAM_CLASS_EX(dest, check_null, deref) \
Z_PARAM_PROLOGUE(deref, 0); \
#define Z_PARAM_CLASS_EX2(dest, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
if (UNEXPECTED(!zend_parse_arg_class(_arg, &dest, _i, check_null))) { \
_error_code = ZPP_ERROR_FAILURE; \
break; \
}
#define Z_PARAM_CLASS_EX(dest, check_null, separate) \
Z_PARAM_CLASS_EX2(dest, check_null, separate, separate)
#define Z_PARAM_CLASS(dest) \
Z_PARAM_CLASS_EX(dest, 0, 0)
@@ -1492,14 +1479,17 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
Z_PARAM_OBJ_OF_CLASS_OR_STR_EX(destination_object, base_ce, destination_string, 1);
/* old "d" */
#define Z_PARAM_DOUBLE_EX(dest, is_null, check_null, deref) \
Z_PARAM_PROLOGUE(deref, 0); \
#define Z_PARAM_DOUBLE_EX2(dest, is_null, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
if (UNEXPECTED(!zend_parse_arg_double(_arg, &dest, &is_null, check_null))) { \
_expected_type = check_null ? Z_EXPECTED_DOUBLE_OR_NULL : Z_EXPECTED_DOUBLE; \
_error_code = ZPP_ERROR_WRONG_ARG; \
break; \
}
#define Z_PARAM_DOUBLE_EX(dest, is_null, check_null, separate) \
Z_PARAM_DOUBLE_EX2(dest, is_null, check_null, separate, separate)
#define Z_PARAM_DOUBLE(dest) \
Z_PARAM_DOUBLE_EX(dest, _dummy, 0, 0)
@@ -1507,8 +1497,8 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
Z_PARAM_DOUBLE_EX(dest, is_null, 1, 0)
/* old "f" */
#define Z_PARAM_FUNC_EX(dest_fci, dest_fcc, check_null, deref) \
Z_PARAM_PROLOGUE(deref, 0); \
#define Z_PARAM_FUNC_EX2(dest_fci, dest_fcc, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
if (UNEXPECTED(!zend_parse_arg_func(_arg, &dest_fci, &dest_fcc, check_null, &_error))) { \
if (!_error) { \
_expected_type = check_null ? Z_EXPECTED_FUNC_OR_NULL : Z_EXPECTED_FUNC; \
@@ -1519,6 +1509,9 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
break; \
} \
#define Z_PARAM_FUNC_EX(dest_fci, dest_fcc, check_null, separate) \
Z_PARAM_FUNC_EX2(dest_fci, dest_fcc, check_null, separate, separate)
#define Z_PARAM_FUNC(dest_fci, dest_fcc) \
Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 0, 0)
@@ -1573,14 +1566,17 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
Z_PARAM_ARRAY_OR_OBJECT_HT_EX(dest, 0, 0)
/* old "l" */
#define Z_PARAM_LONG_EX(dest, is_null, check_null, deref) \
Z_PARAM_PROLOGUE(deref, 0); \
#define Z_PARAM_LONG_EX2(dest, is_null, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
if (UNEXPECTED(!zend_parse_arg_long(_arg, &dest, &is_null, check_null))) { \
_expected_type = check_null ? Z_EXPECTED_LONG_OR_NULL : Z_EXPECTED_LONG; \
_error_code = ZPP_ERROR_WRONG_ARG; \
break; \
}
#define Z_PARAM_LONG_EX(dest, is_null, check_null, separate) \
Z_PARAM_LONG_EX2(dest, is_null, check_null, separate, separate)
#define Z_PARAM_LONG(dest) \
Z_PARAM_LONG_EX(dest, _dummy, 0, 0)
@@ -1603,29 +1599,35 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
Z_PARAM_NUMBER_EX(dest, 0)
/* old "o" */
#define Z_PARAM_OBJECT_EX(dest, check_null, deref) \
Z_PARAM_PROLOGUE(deref, 0); \
#define Z_PARAM_OBJECT_EX2(dest, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
if (UNEXPECTED(!zend_parse_arg_object(_arg, &dest, NULL, check_null))) { \
_expected_type = check_null ? Z_EXPECTED_OBJECT_OR_NULL : Z_EXPECTED_OBJECT; \
_error_code = ZPP_ERROR_WRONG_ARG; \
break; \
}
#define Z_PARAM_OBJECT_EX(dest, check_null, separate) \
Z_PARAM_OBJECT_EX2(dest, check_null, separate, separate)
#define Z_PARAM_OBJECT(dest) \
Z_PARAM_OBJECT_EX(dest, 0, 0)
#define Z_PARAM_OBJECT_OR_NULL(dest) \
Z_PARAM_OBJECT_EX(dest, 1, 0)
/* The same as Z_PARAM_OBJECT_EX except that dest is a zend_object rather than a zval */
#define Z_PARAM_OBJ_EX(dest, check_null, deref) \
Z_PARAM_PROLOGUE(deref, 0); \
/* The same as Z_PARAM_OBJECT_EX2 except that dest is a zend_object rather than a zval */
#define Z_PARAM_OBJ_EX2(dest, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
if (UNEXPECTED(!zend_parse_arg_obj(_arg, &dest, NULL, check_null))) { \
_expected_type = check_null ? Z_EXPECTED_OBJECT_OR_NULL : Z_EXPECTED_OBJECT; \
_error_code = ZPP_ERROR_WRONG_ARG; \
break; \
}
#define Z_PARAM_OBJ_EX(dest, check_null, separate) \
Z_PARAM_OBJ_EX2(dest, check_null, separate, separate)
#define Z_PARAM_OBJ(dest) \
Z_PARAM_OBJ_EX(dest, 0, 0)
@@ -1633,8 +1635,8 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
Z_PARAM_OBJ_EX(dest, 1, 0)
/* old "O" */
#define Z_PARAM_OBJECT_OF_CLASS_EX(dest, _ce, check_null, deref) \
Z_PARAM_PROLOGUE(deref, 0); \
#define Z_PARAM_OBJECT_OF_CLASS_EX2(dest, _ce, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
if (UNEXPECTED(!zend_parse_arg_object(_arg, &dest, _ce, check_null))) { \
if (_ce) { \
_error = ZSTR_VAL((_ce)->name); \
@@ -1647,15 +1649,18 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
} \
}
#define Z_PARAM_OBJECT_OF_CLASS_EX(dest, _ce, check_null, separate) \
Z_PARAM_OBJECT_OF_CLASS_EX2(dest, _ce, check_null, separate, separate)
#define Z_PARAM_OBJECT_OF_CLASS(dest, _ce) \
Z_PARAM_OBJECT_OF_CLASS_EX(dest, _ce, 0, 0)
#define Z_PARAM_OBJECT_OF_CLASS_OR_NULL(dest, _ce) \
Z_PARAM_OBJECT_OF_CLASS_EX(dest, _ce, 1, 0)
/* The same as Z_PARAM_OBJECT_OF_CLASS_EX except that dest is a zend_object rather than a zval */
#define Z_PARAM_OBJ_OF_CLASS_EX(dest, _ce, check_null, deref) \
Z_PARAM_PROLOGUE(deref, 0); \
/* The same as Z_PARAM_OBJECT_OF_CLASS_EX2 except that dest is a zend_object rather than a zval */
#define Z_PARAM_OBJ_OF_CLASS_EX2(dest, _ce, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
if (UNEXPECTED(!zend_parse_arg_obj(_arg, &dest, _ce, check_null))) { \
if (_ce) { \
_error = ZSTR_VAL((_ce)->name); \
@@ -1668,6 +1673,9 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
} \
}
#define Z_PARAM_OBJ_OF_CLASS_EX(dest, _ce, check_null, separate) \
Z_PARAM_OBJ_OF_CLASS_EX2(dest, _ce, check_null, separate, separate)
#define Z_PARAM_OBJ_OF_CLASS(dest, _ce) \
Z_PARAM_OBJ_OF_CLASS_EX(dest, _ce, 0, 0)
@@ -1689,14 +1697,17 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
Z_PARAM_OBJ_OF_CLASS_OR_LONG_EX(dest_obj, _ce, dest_long, is_null, 1)
/* old "p" */
#define Z_PARAM_PATH_EX(dest, dest_len, check_null, deref) \
Z_PARAM_PROLOGUE(deref, 0); \
#define Z_PARAM_PATH_EX2(dest, dest_len, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
if (UNEXPECTED(!zend_parse_arg_path(_arg, &dest, &dest_len, check_null))) { \
_expected_type = check_null ? Z_EXPECTED_PATH_OR_NULL : Z_EXPECTED_PATH; \
_error_code = ZPP_ERROR_WRONG_ARG; \
break; \
}
#define Z_PARAM_PATH_EX(dest, dest_len, check_null, separate) \
Z_PARAM_PATH_EX2(dest, dest_len, check_null, separate, separate)
#define Z_PARAM_PATH(dest, dest_len) \
Z_PARAM_PATH_EX(dest, dest_len, 0, 0)
@@ -1704,14 +1715,17 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
Z_PARAM_PATH_EX(dest, dest_len, 1, 0)
/* old "P" */
#define Z_PARAM_PATH_STR_EX(dest, check_null, deref) \
Z_PARAM_PROLOGUE(deref, 0); \
#define Z_PARAM_PATH_STR_EX2(dest, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
if (UNEXPECTED(!zend_parse_arg_path_str(_arg, &dest, check_null))) { \
_expected_type = check_null ? Z_EXPECTED_PATH_OR_NULL : Z_EXPECTED_PATH; \
_error_code = ZPP_ERROR_WRONG_ARG; \
break; \
}
#define Z_PARAM_PATH_STR_EX(dest, check_null, separate) \
Z_PARAM_PATH_STR_EX2(dest, check_null, separate, separate)
#define Z_PARAM_PATH_STR(dest) \
Z_PARAM_PATH_STR_EX(dest, 0, 0)
@@ -1719,14 +1733,17 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
Z_PARAM_PATH_STR_EX(dest, 1, 0)
/* old "r" */
#define Z_PARAM_RESOURCE_EX(dest, check_null, deref) \
Z_PARAM_PROLOGUE(deref, 0); \
#define Z_PARAM_RESOURCE_EX2(dest, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
if (UNEXPECTED(!zend_parse_arg_resource(_arg, &dest, check_null))) { \
_expected_type = check_null ? Z_EXPECTED_RESOURCE_OR_NULL : Z_EXPECTED_RESOURCE; \
_error_code = ZPP_ERROR_WRONG_ARG; \
break; \
}
#define Z_PARAM_RESOURCE_EX(dest, check_null, separate) \
Z_PARAM_RESOURCE_EX2(dest, check_null, separate, separate)
#define Z_PARAM_RESOURCE(dest) \
Z_PARAM_RESOURCE_EX(dest, 0, 0)
@@ -1734,14 +1751,17 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
Z_PARAM_RESOURCE_EX(dest, 1, 0)
/* old "s" */
#define Z_PARAM_STRING_EX(dest, dest_len, check_null, deref) \
Z_PARAM_PROLOGUE(deref, 0); \
#define Z_PARAM_STRING_EX2(dest, dest_len, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
if (UNEXPECTED(!zend_parse_arg_string(_arg, &dest, &dest_len, check_null))) { \
_expected_type = check_null ? Z_EXPECTED_STRING_OR_NULL : Z_EXPECTED_STRING; \
_error_code = ZPP_ERROR_WRONG_ARG; \
break; \
}
#define Z_PARAM_STRING_EX(dest, dest_len, check_null, separate) \
Z_PARAM_STRING_EX2(dest, dest_len, check_null, separate, separate)
#define Z_PARAM_STRING(dest, dest_len) \
Z_PARAM_STRING_EX(dest, dest_len, 0, 0)
@@ -1749,14 +1769,17 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
Z_PARAM_STRING_EX(dest, dest_len, 1, 0)
/* old "S" */
#define Z_PARAM_STR_EX(dest, check_null, deref) \
Z_PARAM_PROLOGUE(deref, 0); \
#define Z_PARAM_STR_EX2(dest, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null))) { \
_expected_type = check_null ? Z_EXPECTED_STRING_OR_NULL : Z_EXPECTED_STRING; \
_error_code = ZPP_ERROR_WRONG_ARG; \
break; \
}
#define Z_PARAM_STR_EX(dest, check_null, separate) \
Z_PARAM_STR_EX2(dest, check_null, separate, separate)
#define Z_PARAM_STR(dest) \
Z_PARAM_STR_EX(dest, 0, 0)
@@ -1847,8 +1870,8 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
/* Inlined implementations shared by new and old parameter parsing APIs */
ZEND_API bool ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pce, uint32_t num, bool check_null);
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, bool *dest);
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, bool *dest);
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, zend_bool *dest);
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, zend_bool *dest);
ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow(zval *arg, zend_long *dest);
ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(zval *arg, zend_long *dest);
ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(zval *arg, double *dest);
@@ -1858,7 +1881,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, zend_string **des
ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest);
ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_or_long_slow(zval *arg, zend_string **dest_str, zend_long *dest_long);
static zend_always_inline bool zend_parse_arg_bool(zval *arg, bool *dest, bool *is_null, bool check_null)
static zend_always_inline bool zend_parse_arg_bool(zval *arg, zend_bool *dest, zend_bool *is_null, bool check_null)
{
if (check_null) {
*is_null = 0;
@@ -1876,7 +1899,7 @@ static zend_always_inline bool zend_parse_arg_bool(zval *arg, bool *dest, bool *
return 1;
}
static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, bool *is_null, bool check_null)
static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, zend_bool *is_null, bool check_null)
{
if (check_null) {
*is_null = 0;
@@ -1892,7 +1915,7 @@ static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, b
return 1;
}
static zend_always_inline bool zend_parse_arg_double(zval *arg, double *dest, bool *is_null, bool check_null)
static zend_always_inline bool zend_parse_arg_double(zval *arg, double *dest, zend_bool *is_null, bool check_null)
{
if (check_null) {
*is_null = 0;
@@ -2027,7 +2050,7 @@ static zend_always_inline bool zend_parse_arg_array_ht(zval *arg, HashTable **de
}
static zend_always_inline bool zend_parse_arg_array_ht_or_long(
zval *arg, HashTable **dest_ht, zend_long *dest_long, bool *is_null, bool allow_null
zval *arg, HashTable **dest_ht, zend_long *dest_long, zend_bool *is_null, bool allow_null
) {
if (allow_null) {
*is_null = 0;
@@ -2076,7 +2099,7 @@ static zend_always_inline bool zend_parse_arg_obj(zval *arg, zend_object **dest,
}
static zend_always_inline bool zend_parse_arg_obj_or_long(
zval *arg, zend_object **dest_obj, zend_class_entry *ce, zend_long *dest_long, bool *is_null, bool allow_null
zval *arg, zend_object **dest_obj, zend_class_entry *ce, zend_long *dest_long, zend_bool *is_null, bool allow_null
) {
if (allow_null) {
*is_null = 0;
@@ -2159,7 +2182,7 @@ static zend_always_inline bool zend_parse_arg_array_ht_or_str(
}
static zend_always_inline bool zend_parse_arg_str_or_long(zval *arg, zend_string **dest_str, zend_long *dest_long,
bool *is_null, bool allow_null)
zend_bool *is_null, bool allow_null)
{
if (allow_null) {
*is_null = 0;
+3 -3
View File
@@ -117,7 +117,7 @@ static size_t _real_page_size = ZEND_MM_PAGE_SIZE;
/* Mac allows to track anonymous page via vmmap per TAG id.
* user land applications are allowed to take from 240 to 255.
*/
# define ZEND_MM_FD (250u << 24u)
# define ZEND_MM_FD (250<<24)
#endif
#ifndef ZEND_MM_STAT
@@ -1510,7 +1510,7 @@ static zend_never_inline void *zend_mm_realloc_huge(zend_mm_heap *heap, void *pt
return zend_mm_realloc_slow(heap, ptr, size, MIN(old_size, copy_size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
static zend_always_inline void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, bool use_copy_size, size_t copy_size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
static zend_always_inline void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, zend_bool use_copy_size, size_t copy_size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
size_t page_offset;
size_t old_size;
@@ -2789,7 +2789,7 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
#if ZEND_MM_CUSTOM
tmp = getenv("USE_ZEND_ALLOC");
if (tmp && !zend_atoi(tmp, 0)) {
bool tracked = (tmp = getenv("USE_TRACKED_ALLOC")) && zend_atoi(tmp, 0);
zend_bool tracked = (tmp = getenv("USE_TRACKED_ALLOC")) && zend_atoi(tmp, 0);
zend_mm_heap *mm_heap = alloc_globals->mm_heap = malloc(sizeof(zend_mm_heap));
memset(mm_heap, 0, sizeof(zend_mm_heap));
mm_heap->use_custom_heap = ZEND_MM_CUSTOM_HEAP_STD;
+2 -2
View File
@@ -110,7 +110,7 @@ static zend_always_inline void zend_arena_release(zend_arena **arena_ptr, void *
arena->ptr = (char*)checkpoint;
}
static zend_always_inline bool zend_arena_contains(zend_arena *arena, void *ptr)
static zend_always_inline zend_bool zend_arena_contains(zend_arena *arena, void *ptr)
{
while (arena) {
if ((char*)ptr > (char*)arena && (char*)ptr <= arena->ptr) {
@@ -213,7 +213,7 @@ static zend_always_inline void zend_arena_release(zend_arena **arena_ptr, void *
}
}
static zend_always_inline bool zend_arena_contains(zend_arena *arena, void *ptr)
static zend_always_inline zend_bool zend_arena_contains(zend_arena *arena, void *ptr)
{
/* TODO: Dummy */
return 1;
+3 -3
View File
@@ -423,7 +423,7 @@ ZEND_API zend_ast *zend_ast_create_list(uint32_t init_children, zend_ast_kind ki
}
#endif
static inline bool is_power_of_two(uint32_t n) {
static inline zend_bool is_power_of_two(uint32_t n) {
return ((n != 0) && (n == (n & (~n + 1))));
}
@@ -1375,7 +1375,7 @@ static ZEND_COLD void zend_ast_export_attribute_group(smart_str *str, zend_ast *
}
}
static ZEND_COLD void zend_ast_export_attributes(smart_str *str, zend_ast *ast, int indent, bool newlines) {
static ZEND_COLD void zend_ast_export_attributes(smart_str *str, zend_ast *ast, int indent, zend_bool newlines) {
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
@@ -1497,7 +1497,7 @@ tail_call:
case ZEND_AST_METHOD:
decl = (zend_ast_decl *) ast;
if (decl->child[4]) {
bool newlines = !(ast->kind == ZEND_AST_CLOSURE || ast->kind == ZEND_AST_ARROW_FUNC);
zend_bool newlines = !(ast->kind == ZEND_AST_CLOSURE || ast->kind == ZEND_AST_ARROW_FUNC);
zend_ast_export_attributes(str, decl->child[4], indent, newlines);
}
+2 -2
View File
@@ -301,11 +301,11 @@ ZEND_API void ZEND_FASTCALL zend_ast_ref_destroy(zend_ast_ref *ast);
typedef void (*zend_ast_apply_func)(zend_ast **ast_ptr);
ZEND_API void zend_ast_apply(zend_ast *ast, zend_ast_apply_func fn);
static zend_always_inline bool zend_ast_is_special(zend_ast *ast) {
static zend_always_inline zend_bool zend_ast_is_special(zend_ast *ast) {
return (ast->kind >> ZEND_AST_SPECIAL_SHIFT) & 1;
}
static zend_always_inline bool zend_ast_is_list(zend_ast *ast) {
static zend_always_inline zend_bool zend_ast_is_list(zend_ast *ast) {
return (ast->kind >> ZEND_AST_IS_LIST_SHIFT) & 1;
}
static zend_always_inline zend_ast_list *zend_ast_get_list(zend_ast *ast) {
+1 -1
View File
@@ -163,7 +163,7 @@ ZEND_API zend_string *zend_get_attribute_target_names(uint32_t flags)
return smart_str_extract(&str);
}
ZEND_API bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *attr)
ZEND_API zend_bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *attr)
{
zend_attribute *other;
+1 -1
View File
@@ -72,7 +72,7 @@ ZEND_API zend_attribute *zend_get_parameter_attribute_str(HashTable *attributes,
ZEND_API zend_result zend_get_attribute_value(zval *ret, zend_attribute *attr, uint32_t i, zend_class_entry *scope);
ZEND_API zend_string *zend_get_attribute_target_names(uint32_t targets);
ZEND_API bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *attr);
ZEND_API zend_bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *attr);
ZEND_API zend_internal_attribute *zend_internal_attribute_register(zend_class_entry *ce, uint32_t flags);
ZEND_API zend_internal_attribute *zend_internal_attribute_get(zend_string *lcname);
+3 -3
View File
@@ -122,7 +122,7 @@ static inline uint32_t zend_bitset_len(uint32_t n)
return (n + ((sizeof(zend_long) * 8) - 1)) / (sizeof(zend_long) * 8);
}
static inline bool zend_bitset_in(zend_bitset set, uint32_t n)
static inline zend_bool zend_bitset_in(zend_bitset set, uint32_t n)
{
return ZEND_BIT_TEST(set, n);
}
@@ -158,7 +158,7 @@ static inline void zend_bitset_fill(zend_bitset set, uint32_t len)
memset(set, 0xff, len * ZEND_BITSET_ELM_SIZE);
}
static inline bool zend_bitset_equal(zend_bitset set1, zend_bitset set2, uint32_t len)
static inline zend_bool zend_bitset_equal(zend_bitset set1, zend_bitset set2, uint32_t len)
{
return memcmp(set1, set2, len * ZEND_BITSET_ELM_SIZE) == 0;
}
@@ -213,7 +213,7 @@ static inline void zend_bitset_union_with_difference(zend_bitset set1, zend_bits
}
}
static inline bool zend_bitset_subset(zend_bitset set1, zend_bitset set2, uint32_t len)
static inline zend_bool zend_bitset_subset(zend_bitset set1, zend_bitset set2, uint32_t len)
{
uint32_t i;
+25 -23
View File
@@ -370,7 +370,7 @@ ZEND_FUNCTION(strncasecmp)
ZEND_FUNCTION(error_reporting)
{
zend_long err;
bool err_is_null = 1;
zend_bool err_is_null = 1;
int old_error_reporting;
ZEND_PARSE_PARAMETERS_START(0, 1)
@@ -426,7 +426,7 @@ static bool validate_constant_array_argument(HashTable *ht, int argument_number)
zval *val;
GC_PROTECT_RECURSION(ht);
ZEND_HASH_FOREACH_VAL(ht, val) {
ZEND_HASH_FOREACH_VAL_IND(ht, val) {
ZVAL_DEREF(val);
if (Z_REFCOUNTED_P(val)) {
if (Z_TYPE_P(val) == IS_ARRAY) {
@@ -459,7 +459,7 @@ static void copy_constant_array(zval *dst, zval *src) /* {{{ */
zval *new_val, *val;
array_init_size(dst, zend_hash_num_elements(Z_ARRVAL_P(src)));
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(src), idx, key, val) {
ZEND_HASH_FOREACH_KEY_VAL_IND(Z_ARRVAL_P(src), idx, key, val) {
/* constant arrays can't contain references */
ZVAL_DEREF(val);
if (key) {
@@ -483,7 +483,7 @@ ZEND_FUNCTION(define)
{
zend_string *name;
zval *val, val_free;
bool non_cs = 0;
zend_bool non_cs = 0;
zend_constant c;
ZEND_PARSE_PARAMETERS_START(2, 3)
@@ -631,14 +631,14 @@ ZEND_FUNCTION(get_parent_class)
}
/* }}} */
static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, bool only_subclass) /* {{{ */
static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) /* {{{ */
{
zval *obj;
zend_string *class_name;
zend_class_entry *instance_ce;
zend_class_entry *ce;
bool allow_string = only_subclass;
bool retval;
zend_bool allow_string = only_subclass;
zend_bool retval;
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_ZVAL(obj)
@@ -769,6 +769,7 @@ ZEND_FUNCTION(get_class_vars)
/* {{{ Returns an array of object properties */
ZEND_FUNCTION(get_object_vars)
{
zval *obj;
zval *value;
HashTable *properties;
zend_string *key;
@@ -776,9 +777,10 @@ ZEND_FUNCTION(get_object_vars)
zend_ulong num_key;
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_OBJ(zobj)
Z_PARAM_OBJECT(obj)
ZEND_PARSE_PARAMETERS_END();
zobj = Z_OBJ_P(obj);
properties = zobj->handlers->get_properties(zobj);
if (properties == NULL) {
RETURN_EMPTY_ARRAY();
@@ -794,7 +796,7 @@ ZEND_FUNCTION(get_object_vars)
array_init_size(return_value, zend_hash_num_elements(properties));
ZEND_HASH_FOREACH_KEY_VAL(properties, num_key, key, value) {
bool is_dynamic = 1;
zend_bool is_dynamic = 1;
if (Z_TYPE_P(value) == IS_INDIRECT) {
value = Z_INDIRECT_P(value);
if (UNEXPECTED(Z_ISUNDEF_P(value))) {
@@ -837,22 +839,22 @@ ZEND_FUNCTION(get_object_vars)
/* {{{ Returns an array of mangled object properties. Does not respect property visibility. */
ZEND_FUNCTION(get_mangled_object_vars)
{
zend_object *obj;
zval *obj;
HashTable *properties;
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_OBJ(obj)
Z_PARAM_OBJECT(obj)
ZEND_PARSE_PARAMETERS_END();
properties = obj->handlers->get_properties(obj);
properties = Z_OBJ_HT_P(obj)->get_properties(Z_OBJ_P(obj));
if (!properties) {
ZVAL_EMPTY_ARRAY(return_value);
return;
}
properties = zend_proptable_to_symtable(properties,
(obj->ce->default_properties_count ||
obj->handlers != &std_object_handlers ||
(Z_OBJCE_P(obj)->default_properties_count ||
Z_OBJ_P(obj)->handlers != &std_object_handlers ||
GC_IS_RECURSIVE(properties)));
RETURN_ARR(properties);
}
@@ -1007,7 +1009,7 @@ static inline void class_exists_impl(INTERNAL_FUNCTION_PARAMETERS, int flags, in
zend_string *name;
zend_string *lcname;
zend_class_entry *ce;
bool autoload = 1;
zend_bool autoload = 1;
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STR(name)
@@ -1063,7 +1065,7 @@ ZEND_FUNCTION(trait_exists)
ZEND_FUNCTION(function_exists)
{
zend_string *name;
bool exists;
zend_bool exists;
zend_string *lcname;
ZEND_PARSE_PARAMETERS_START(1, 1)
@@ -1092,7 +1094,7 @@ ZEND_FUNCTION(class_alias)
char *alias_name;
zend_class_entry *ce;
size_t alias_name_len;
bool autoload = 1;
zend_bool autoload = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ss|b", &class_name, &alias_name, &alias_name_len, &autoload) == FAILURE) {
RETURN_THROWS();
@@ -1326,7 +1328,7 @@ ZEND_FUNCTION(get_defined_functions)
zval internal, user;
zend_string *key;
zend_function *func;
bool exclude_disabled = 1;
zend_bool exclude_disabled = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &exclude_disabled) == FAILURE) {
RETURN_THROWS();
@@ -1474,7 +1476,7 @@ static void add_zendext_info(zend_extension *ext, void *arg) /* {{{ */
/* {{{ Return an array containing names of loaded extensions */
ZEND_FUNCTION(get_loaded_extensions)
{
bool zendext = 0;
zend_bool zendext = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &zendext) == FAILURE) {
RETURN_THROWS();
@@ -1497,7 +1499,7 @@ ZEND_FUNCTION(get_loaded_extensions)
/* {{{ Return an array containing the names and values of all defined constants */
ZEND_FUNCTION(get_defined_constants)
{
bool categorize = 0;
zend_bool categorize = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &categorize) == FAILURE) {
RETURN_THROWS();
@@ -1666,7 +1668,7 @@ void debug_print_backtrace_args(zval *arg_array) /* {{{ */
}
/* }}} */
static inline bool skip_internal_handler(zend_execute_data *skip) /* {{{ */
static inline zend_bool skip_internal_handler(zend_execute_data *skip) /* {{{ */
{
return !(skip->func && ZEND_USER_CODE(skip->func->common.type))
&& skip->prev_execute_data
@@ -1778,7 +1780,7 @@ ZEND_FUNCTION(debug_print_backtrace)
}
} else {
/* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */
bool build_filename_arg = 1;
zend_bool build_filename_arg = 1;
uint32_t include_kind = 0;
if (ptr->func && ZEND_USER_CODE(ptr->func->common.type) && ptr->opline->opcode == ZEND_INCLUDE_OR_EVAL) {
include_kind = ptr->opline->extended_value;
@@ -2009,7 +2011,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
}
} else {
/* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */
bool build_filename_arg = 1;
zend_bool build_filename_arg = 1;
zend_string *pseudo_function_name;
uint32_t include_kind = 0;
if (ptr->func && ZEND_USER_CODE(ptr->func->common.type) && ptr->opline->opcode == ZEND_INCLUDE_OR_EVAL) {
+9 -11
View File
@@ -69,11 +69,11 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */
}
/* }}} */
static bool zend_valid_closure_binding(
static zend_bool zend_valid_closure_binding(
zend_closure *closure, zval *newthis, zend_class_entry *scope) /* {{{ */
{
zend_function *func = &closure->func;
bool is_fake_closure = (func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) != 0;
zend_bool is_fake_closure = (func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) != 0;
if (newthis) {
if (func->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(E_WARNING, "Cannot bind an instance to a static closure");
@@ -128,7 +128,6 @@ ZEND_METHOD(Closure, call)
zend_fcall_info_cache fci_cache;
zend_function my_function;
zend_object *newobj;
zend_class_entry *newclass;
fci.param_count = 0;
fci.params = NULL;
@@ -141,27 +140,26 @@ ZEND_METHOD(Closure, call)
closure = (zend_closure *) Z_OBJ_P(ZEND_THIS);
newobj = Z_OBJ_P(newthis);
newclass = newobj->ce;
if (!zend_valid_closure_binding(closure, newthis, newclass)) {
if (!zend_valid_closure_binding(closure, newthis, Z_OBJCE_P(newthis))) {
return;
}
if (closure->func.common.fn_flags & ZEND_ACC_GENERATOR) {
zval new_closure;
zend_create_closure(&new_closure, &closure->func, newclass, closure->called_scope, newthis);
zend_create_closure(&new_closure, &closure->func, Z_OBJCE_P(newthis), closure->called_scope, newthis);
closure = (zend_closure *) Z_OBJ(new_closure);
fci_cache.function_handler = &closure->func;
} else {
memcpy(&my_function, &closure->func, closure->func.type == ZEND_USER_FUNCTION ? sizeof(zend_op_array) : sizeof(zend_internal_function));
my_function.common.fn_flags &= ~ZEND_ACC_CLOSURE;
/* use scope of passed object */
my_function.common.scope = newclass;
my_function.common.scope = Z_OBJCE_P(newthis);
fci_cache.function_handler = &my_function;
/* Runtime cache relies on bound scope to be immutable, hence we need a separate rt cache in case scope changed */
if (ZEND_USER_CODE(my_function.type)
&& (closure->func.common.scope != newclass
&& (closure->func.common.scope != Z_OBJCE_P(newthis)
|| (closure->func.common.fn_flags & ZEND_ACC_HEAP_RT_CACHE))) {
void *ptr;
@@ -174,7 +172,7 @@ ZEND_METHOD(Closure, call)
}
}
fci_cache.called_scope = newclass;
fci_cache.called_scope = newobj->ce;
fci_cache.object = fci.object = newobj;
fci.size = sizeof(fci);
@@ -520,7 +518,7 @@ static zend_object *zend_closure_clone(zend_object *zobject) /* {{{ */
}
/* }}} */
int zend_closure_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only) /* {{{ */
int zend_closure_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, zend_bool check_only) /* {{{ */
{
zend_closure *closure = (zend_closure *)obj;
*fptr_ptr = &closure->func;
@@ -543,7 +541,7 @@ static HashTable *zend_closure_get_debug_info(zend_object *object, int *is_temp)
zval val;
struct _zend_arg_info *arg_info = closure->func.common.arg_info;
HashTable *debug_info;
bool zstr_args = (closure->func.type == ZEND_USER_FUNCTION) || (closure->func.common.fn_flags & ZEND_ACC_USER_ARG_INFO);
zend_bool zstr_args = (closure->func.type == ZEND_USER_FUNCTION) || (closure->func.common.fn_flags & ZEND_ACC_USER_ARG_INFO);
*is_temp = 1;
+160 -256
View File
File diff suppressed because it is too large. Load diff
+23 -21
View File
@@ -107,8 +107,8 @@ typedef struct _zend_file_context {
zend_declarables declarables;
zend_string *current_namespace;
bool in_namespace;
bool has_bracketed_namespaces;
zend_bool in_namespace;
zend_bool has_bracketed_namespaces;
HashTable *imports;
HashTable *imports_function;
@@ -117,12 +117,17 @@ typedef struct _zend_file_context {
HashTable seen_symbols;
} zend_file_context;
typedef struct {
uint32_t offset;
uint32_t len;
} zend_lexer_ident_ref;
typedef union _zend_parser_stack_elem {
zend_ast *ast;
zend_string *str;
zend_ulong num;
unsigned char *ptr;
unsigned char *ident;
zend_lexer_ident_ref ident;
} zend_parser_stack_elem;
void zend_compile_top_stmt(zend_ast *ast);
@@ -153,7 +158,7 @@ typedef struct _zend_brk_cont_element {
int cont;
int brk;
int parent;
bool is_switch;
zend_bool is_switch;
} zend_brk_cont_element;
typedef struct _zend_label {
@@ -233,7 +238,7 @@ typedef struct _zend_oparray_context {
/* op_array or class is preloaded | | | */
#define ZEND_ACC_PRELOADED (1 << 10) /* X | X | | */
/* | | | */
/* Class Flags (unused: 23...) | | | */
/* Class Flags (unused: 22...) | | | */
/* =========== | | | */
/* | | | */
/* Special class types | | | */
@@ -282,9 +287,6 @@ typedef struct _zend_oparray_context {
/* Whether this class was used in its unlinked state. | | | */
#define ZEND_ACC_HAS_UNLINKED_USES (1 << 21) /* X | | | */
/* | | | */
/* stored in opcache (may be partially) | | | */
#define ZEND_ACC_CACHED (1 << 22) /* X | | | */
/* | | | */
/* Function Flags (unused: 27-30) | | | */
/* ============== | | | */
/* | | | */
@@ -766,7 +768,7 @@ zend_ast *zend_ast_append_str(zend_ast *left, zend_ast *right);
zend_ast *zend_negate_num_string(zend_ast *ast);
uint32_t zend_add_class_modifier(uint32_t flags, uint32_t new_flag);
uint32_t zend_add_member_modifier(uint32_t flags, uint32_t new_flag);
bool zend_handle_encoding_declaration(zend_ast *ast);
zend_bool zend_handle_encoding_declaration(zend_ast *ast);
/* parser-driven code generators */
void zend_do_free(znode *op1);
@@ -796,7 +798,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type);
ZEND_API zend_op_array *compile_string(zend_string *source_string, const char *filename);
ZEND_API zend_op_array *compile_filename(int type, zval *filename);
ZEND_API zend_ast *zend_compile_string_to_ast(
zend_string *code, struct _zend_arena **ast_arena, zend_string *filename);
zend_string *code, struct _zend_arena **ast_arena, const char *filename);
ZEND_API int zend_execute_scripts(int type, zval *retval, int file_count, ...);
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle);
ZEND_API void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_size);
@@ -804,7 +806,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array);
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle);
ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce);
ZEND_API void zend_cleanup_internal_classes(void);
ZEND_API void zend_type_release(zend_type type, bool persistent);
ZEND_API void zend_type_release(zend_type type, zend_bool persistent);
ZEND_API zend_string *zend_create_member_string(zend_string *class_name, zend_string *member_name);
@@ -838,30 +840,30 @@ static zend_always_inline const char *zend_get_unmangled_property_name(const zen
#define ZEND_FUNCTION_DTOR zend_function_dtor
#define ZEND_CLASS_DTOR destroy_zend_class
typedef bool (*zend_needs_live_range_cb)(zend_op_array *op_array, zend_op *opline);
typedef zend_bool (*zend_needs_live_range_cb)(zend_op_array *op_array, zend_op *opline);
ZEND_API void zend_recalc_live_ranges(
zend_op_array *op_array, zend_needs_live_range_cb needs_live_range);
ZEND_API void pass_two(zend_op_array *op_array);
ZEND_API bool zend_is_compiling(void);
ZEND_API zend_bool zend_is_compiling(void);
ZEND_API char *zend_make_compiled_string_description(const char *name);
ZEND_API void zend_initialize_class_data(zend_class_entry *ce, bool nullify_handlers);
ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers);
uint32_t zend_get_class_fetch_type(zend_string *name);
ZEND_API zend_uchar zend_get_call_op(const zend_op *init_op, zend_function *fbc);
ZEND_API bool zend_is_smart_branch(const zend_op *opline);
typedef bool (*zend_auto_global_callback)(zend_string *name);
typedef zend_bool (*zend_auto_global_callback)(zend_string *name);
typedef struct _zend_auto_global {
zend_string *name;
zend_auto_global_callback auto_global_callback;
bool jit;
bool armed;
zend_bool jit;
zend_bool armed;
} zend_auto_global;
ZEND_API zend_result zend_register_auto_global(zend_string *name, bool jit, zend_auto_global_callback auto_global_callback);
ZEND_API zend_result zend_register_auto_global(zend_string *name, zend_bool jit, zend_auto_global_callback auto_global_callback);
ZEND_API void zend_activate_auto_globals(void);
ZEND_API bool zend_is_auto_global(zend_string *name);
ZEND_API bool zend_is_auto_global_str(const char *name, size_t len);
ZEND_API zend_bool zend_is_auto_global(zend_string *name);
ZEND_API zend_bool zend_is_auto_global_str(const char *name, size_t len);
ZEND_API size_t zend_dirname(char *path, size_t len);
ZEND_API void zend_set_function_arg_flags(zend_function *func);
@@ -1132,6 +1134,6 @@ END_EXTERN_C()
/* The default value for CG(compiler_options) during eval() */
#define ZEND_COMPILE_DEFAULT_FOR_EVAL 0
ZEND_API bool zend_binary_op_produces_error(uint32_t opcode, zval *op1, zval *op2);
ZEND_API zend_bool zend_binary_op_produces_error(uint32_t opcode, zval *op1, zval *op2);
#endif /* ZEND_COMPILE_H */
+2 -2
View File
@@ -158,7 +158,7 @@ ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int
zend_register_constant(&c);
}
ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, bool bval, int flags, int module_number)
ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, zend_bool bval, int flags, int module_number)
{
zend_constant c;
@@ -482,7 +482,7 @@ ZEND_API zend_result zend_register_constant(zend_constant *c)
zend_string *lowercase_name = NULL;
zend_string *name;
zend_result ret = SUCCESS;
bool persistent = (ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) != 0;
zend_bool persistent = (ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) != 0;
#if 0
printf("Registering constant for module %d\n", c->module_number);
+1 -1
View File
@@ -76,7 +76,7 @@ ZEND_API bool zend_verify_const_access(zend_class_constant *c, zend_class_entry
ZEND_API zval *zend_get_constant(zend_string *name);
ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len);
ZEND_API zval *zend_get_constant_ex(zend_string *name, zend_class_entry *scope, uint32_t flags);
ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, bool bval, int flags, int module_number);
ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, zend_bool bval, int flags, int module_number);
ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int flags, int module_number);
ZEND_API void zend_register_long_constant(const char *name, size_t name_len, zend_long lval, int flags, int module_number);
ZEND_API void zend_register_double_constant(const char *name, size_t name_len, double dval, int flags, int module_number);
+2 -2
View File
@@ -90,7 +90,7 @@ static unsigned get_xcr0_eax() {
# endif
}
static bool is_avx_supported() {
static zend_bool is_avx_supported() {
if (!(cpuinfo.ecx & ZEND_CPU_FEATURE_AVX)) {
/* No support for AVX */
return 0;
@@ -106,7 +106,7 @@ static bool is_avx_supported() {
return 1;
}
#else
static bool is_avx_supported() {
static zend_bool is_avx_supported() {
return 0;
}
#endif
+62 -32
View File
@@ -53,21 +53,14 @@ static zend_object_handlers default_exception_handlers;
/* {{{ zend_implement_throwable */
static int zend_implement_throwable(zend_class_entry *interface, zend_class_entry *class_type)
{
/* zend_ce_exception and zend_ce_error may not be initialized yet when this is caleld (e.g when
* implementing Throwable for Exception itself). Perform a manual inheritance check. */
zend_class_entry *root = class_type;
while (root->parent) {
root = root->parent;
}
if (zend_string_equals_literal(root->name, "Exception")
|| zend_string_equals_literal(root->name, "Error")) {
if (instanceof_function(class_type, zend_ce_exception) || instanceof_function(class_type, zend_ce_error)) {
return SUCCESS;
}
zend_error_noreturn(E_ERROR,
"Class %s cannot implement interface %s, extend Exception or Error instead",
zend_error_noreturn(E_ERROR, "Class %s cannot implement interface %s, extend %s or %s instead",
ZSTR_VAL(class_type->name),
ZSTR_VAL(interface->name));
ZSTR_VAL(interface->name),
ZSTR_VAL(zend_ce_exception->name),
ZSTR_VAL(zend_ce_error->name));
return FAILURE;
}
/* }}} */
@@ -151,7 +144,7 @@ void zend_exception_restore(void) /* {{{ */
}
/* }}} */
static zend_always_inline bool is_handle_exception_set() {
static zend_always_inline zend_bool is_handle_exception_set() {
zend_execute_data *execute_data = EG(current_execute_data);
return !execute_data->func
|| !ZEND_USER_CODE(execute_data->func->common.type)
@@ -346,7 +339,7 @@ ZEND_METHOD(ErrorException, __construct)
{
zend_string *message = NULL, *filename = NULL;
zend_long code = 0, severity = E_ERROR, lineno;
bool lineno_is_null = 1;
zend_bool lineno_is_null = 1;
zval tmp, *object, *previous = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|SllS!l!O!", &message, &code, &severity, &filename, &lineno, &lineno_is_null, &previous, zend_ce_throwable) == FAILURE) {
@@ -485,7 +478,7 @@ ZEND_METHOD(ErrorException, getSeverity)
static void _build_trace_args(zval *arg, smart_str *str) /* {{{ */
{
/* the trivial way would be to do
* convert_to_string(arg);
* convert_to_string_ex(arg);
* append it and kill the now tmp arg.
* but that could cause some E_NOTICE and also damn long lines.
*/
@@ -747,50 +740,87 @@ ZEND_METHOD(Exception, __toString)
}
/* }}} */
static void declare_exception_properties(zend_class_entry *ce)
{
zval val;
zend_declare_property_string(ce, "message", sizeof("message")-1, "", ZEND_ACC_PROTECTED);
zend_declare_property_string(ce, "string", sizeof("string")-1, "", ZEND_ACC_PRIVATE);
zend_declare_property_long(ce, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED);
zend_declare_property_null(ce, "file", sizeof("file")-1, ZEND_ACC_PROTECTED);
zend_declare_property_null(ce, "line", sizeof("line")-1, ZEND_ACC_PROTECTED);
ZVAL_EMPTY_ARRAY(&val);
zend_declare_typed_property(
ce, ZSTR_KNOWN(ZEND_STR_TRACE), &val, ZEND_ACC_PRIVATE, NULL,
(zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY));
ZVAL_NULL(&val);
zend_declare_typed_property(
ce, ZSTR_KNOWN(ZEND_STR_PREVIOUS), &val, ZEND_ACC_PRIVATE, NULL,
(zend_type) ZEND_TYPE_INIT_CE(zend_ce_throwable, /* allow_null */ 1, 0));
}
void zend_register_default_exception(void) /* {{{ */
{
zend_ce_throwable = register_class_Throwable(zend_ce_stringable);
zend_ce_throwable->interface_gets_implemented = zend_implement_throwable;
zend_class_entry ce;
REGISTER_MAGIC_INTERFACE(throwable, Throwable);
zend_class_implements(zend_ce_throwable, 1, zend_ce_stringable);
memcpy(&default_exception_handlers, &std_object_handlers, sizeof(zend_object_handlers));
default_exception_handlers.clone_obj = NULL;
zend_ce_exception = register_class_Exception(zend_ce_throwable);
INIT_CLASS_ENTRY(ce, "Exception", class_Exception_methods);
zend_ce_exception = zend_register_internal_class_ex(&ce, NULL);
zend_ce_exception->create_object = zend_default_exception_new;
zend_class_implements(zend_ce_exception, 1, zend_ce_throwable);
declare_exception_properties(zend_ce_exception);
zend_ce_error_exception = register_class_ErrorException(zend_ce_exception);
INIT_CLASS_ENTRY(ce, "ErrorException", class_ErrorException_methods);
zend_ce_error_exception = zend_register_internal_class_ex(&ce, zend_ce_exception);
zend_ce_error_exception->create_object = zend_error_exception_new;
/* Declared manually because it uses constant E_ERROR. */
zend_declare_property_long(zend_ce_error_exception, "severity", sizeof("severity")-1, E_ERROR, ZEND_ACC_PROTECTED);
zend_ce_error = register_class_Error(zend_ce_throwable);
INIT_CLASS_ENTRY(ce, "Error", class_Error_methods);
zend_ce_error = zend_register_internal_class_ex(&ce, NULL);
zend_ce_error->create_object = zend_default_exception_new;
zend_class_implements(zend_ce_error, 1, zend_ce_throwable);
declare_exception_properties(zend_ce_error);
zend_ce_compile_error = register_class_CompileError(zend_ce_error);
INIT_CLASS_ENTRY(ce, "CompileError", class_CompileError_methods);
zend_ce_compile_error = zend_register_internal_class_ex(&ce, zend_ce_error);
zend_ce_compile_error->create_object = zend_default_exception_new;
zend_ce_parse_error = register_class_ParseError(zend_ce_compile_error);
INIT_CLASS_ENTRY(ce, "ParseError", class_ParseError_methods);
zend_ce_parse_error = zend_register_internal_class_ex(&ce, zend_ce_compile_error);
zend_ce_parse_error->create_object = zend_default_exception_new;
zend_ce_type_error = register_class_TypeError(zend_ce_error);
INIT_CLASS_ENTRY(ce, "TypeError", class_TypeError_methods);
zend_ce_type_error = zend_register_internal_class_ex(&ce, zend_ce_error);
zend_ce_type_error->create_object = zend_default_exception_new;
zend_ce_argument_count_error = register_class_ArgumentCountError(zend_ce_type_error);
INIT_CLASS_ENTRY(ce, "ArgumentCountError", class_ArgumentCountError_methods);
zend_ce_argument_count_error = zend_register_internal_class_ex(&ce, zend_ce_type_error);
zend_ce_argument_count_error->create_object = zend_default_exception_new;
zend_ce_value_error = register_class_ValueError(zend_ce_error);
INIT_CLASS_ENTRY(ce, "ValueError", class_ValueError_methods);
zend_ce_value_error = zend_register_internal_class_ex(&ce, zend_ce_error);
zend_ce_value_error->create_object = zend_default_exception_new;
zend_ce_arithmetic_error = register_class_ArithmeticError(zend_ce_error);
INIT_CLASS_ENTRY(ce, "ArithmeticError", class_ArithmeticError_methods);
zend_ce_arithmetic_error = zend_register_internal_class_ex(&ce, zend_ce_error);
zend_ce_arithmetic_error->create_object = zend_default_exception_new;
zend_ce_division_by_zero_error = register_class_DivisionByZeroError(zend_ce_arithmetic_error);
INIT_CLASS_ENTRY(ce, "DivisionByZeroError", class_DivisionByZeroError_methods);
zend_ce_division_by_zero_error = zend_register_internal_class_ex(&ce, zend_ce_arithmetic_error);
zend_ce_division_by_zero_error->create_object = zend_default_exception_new;
zend_ce_unhandled_match_error = register_class_UnhandledMatchError(zend_ce_error);
zend_ce_unhandled_match_error->create_object = zend_default_exception_new;
INIT_CLASS_ENTRY(zend_ce_unwind_exit, "UnwindExit", NULL);
INIT_CLASS_ENTRY(ce, "UnhandledMatchError", NULL);
zend_ce_unhandled_match_error = zend_register_internal_class_ex(&ce, zend_ce_error);
zend_ce_unhandled_match_error->create_object = zend_default_exception_new;
}
/* }}} */
@@ -987,7 +1017,7 @@ ZEND_API ZEND_COLD void zend_throw_unwind_exit(void)
EG(current_execute_data)->opline = EG(exception_op);
}
ZEND_API bool zend_is_unwind_exit(zend_object *ex)
ZEND_API zend_bool zend_is_unwind_exit(zend_object *ex)
{
return ex->ce == &zend_ce_unwind_exit;
}
+1 -1
View File
@@ -70,7 +70,7 @@ extern ZEND_API void (*zend_throw_exception_hook)(zend_object *ex);
ZEND_API ZEND_COLD zend_result zend_exception_error(zend_object *exception, int severity);
ZEND_API ZEND_COLD void zend_throw_unwind_exit(void);
ZEND_API bool zend_is_unwind_exit(zend_object *ex);
ZEND_API zend_bool zend_is_unwind_exit(zend_object *ex);
#include "zend_globals.h"
+2 -41
View File
@@ -1,9 +1,6 @@
<?php
/**
* @generate-function-entries
* @generate-class-entries
*/
/** @generate-function-entries */
interface Throwable extends Stringable
{
@@ -25,19 +22,6 @@ interface Throwable extends Stringable
class Exception implements Throwable
{
/** @var string */
protected $message = "";
/** @var string */
private $string = "";
/** @var int */
protected $code = 0;
/** @var string|null */
protected $file = null;
/** @var int|null */
protected $line = null;
private array $trace = [];
private ?Throwable $previous = null;
final private function __clone(): void {}
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null) {}
@@ -65,36 +49,13 @@ class Exception implements Throwable
class ErrorException extends Exception
{
/** @var int */
protected $severity = E_ERROR;
public function __construct(
string $message = "",
int $code = 0,
int $severity = E_ERROR,
?string $filename = null,
?int $line = null,
?Throwable $previous = null
) {}
public function __construct(string $message = "", int $code = 0, int $severity = E_ERROR, ?string $filename = null, ?int $line = null, ?Throwable $previous = null) {}
final public function getSeverity(): int {}
}
class Error implements Throwable
{
/** @var string */
protected $message = "";
/** @var string */
private $string = "";
/** @var int */
protected $code = 0;
/** @var string|null */
protected $file = null;
/** @var int|null */
protected $line = null;
private array $trace = [];
private ?Throwable $previous = null;
/** @implementation-alias Exception::__clone */
final private function __clone(): void {}
+1 -211
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 053248482a00efc35be505186f8430708bd280e9 */
* Stub hash: 2fa61163fb7db8d87b14f9cf9a42c3cd8093f2a6 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Throwable_getMessage, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
@@ -185,213 +185,3 @@ static const zend_function_entry class_DivisionByZeroError_methods[] = {
static const zend_function_entry class_UnhandledMatchError_methods[] = {
ZEND_FE_END
};
zend_class_entry *register_class_Throwable(zend_class_entry *class_entry_Stringable)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "Throwable", class_Throwable_methods);
class_entry = zend_register_internal_interface(&ce);
zend_class_implements(class_entry, 1, class_entry_Stringable);
return class_entry;
}
zend_class_entry *register_class_Exception(zend_class_entry *class_entry_Throwable)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "Exception", class_Exception_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
zend_class_implements(class_entry, 1, class_entry_Throwable);
zval property_message_default_value;
ZVAL_EMPTY_STRING(&property_message_default_value);
zend_string *property_message_name = zend_string_init("message", sizeof("message") - 1, 1);
zend_declare_property_ex(class_entry, property_message_name, &property_message_default_value, ZEND_ACC_PROTECTED, NULL);
zend_string_release(property_message_name);
zval property_string_default_value;
ZVAL_EMPTY_STRING(&property_string_default_value);
zend_string *property_string_name = zend_string_init("string", sizeof("string") - 1, 1);
zend_declare_property_ex(class_entry, property_string_name, &property_string_default_value, ZEND_ACC_PRIVATE, NULL);
zend_string_release(property_string_name);
zval property_code_default_value;
ZVAL_LONG(&property_code_default_value, 0);
zend_string *property_code_name = zend_string_init("code", sizeof("code") - 1, 1);
zend_declare_property_ex(class_entry, property_code_name, &property_code_default_value, ZEND_ACC_PROTECTED, NULL);
zend_string_release(property_code_name);
zval property_file_default_value;
ZVAL_NULL(&property_file_default_value);
zend_string *property_file_name = zend_string_init("file", sizeof("file") - 1, 1);
zend_declare_property_ex(class_entry, property_file_name, &property_file_default_value, ZEND_ACC_PROTECTED, NULL);
zend_string_release(property_file_name);
zval property_line_default_value;
ZVAL_NULL(&property_line_default_value);
zend_string *property_line_name = zend_string_init("line", sizeof("line") - 1, 1);
zend_declare_property_ex(class_entry, property_line_name, &property_line_default_value, ZEND_ACC_PROTECTED, NULL);
zend_string_release(property_line_name);
zval property_trace_default_value;
ZVAL_EMPTY_ARRAY(&property_trace_default_value);
zend_string *property_trace_name = zend_string_init("trace", sizeof("trace") - 1, 1);
zend_declare_typed_property(class_entry, property_trace_name, &property_trace_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY));
zend_string_release(property_trace_name);
zend_string *property_previous_class_Throwable = zend_string_init("Throwable", sizeof("Throwable")-1, 1);
zval property_previous_default_value;
ZVAL_NULL(&property_previous_default_value);
zend_string *property_previous_name = zend_string_init("previous", sizeof("previous") - 1, 1);
zend_declare_typed_property(class_entry, property_previous_name, &property_previous_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previous_class_Throwable, 1, 0));
zend_string_release(property_previous_name);
return class_entry;
}
zend_class_entry *register_class_ErrorException(zend_class_entry *class_entry_Exception)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "ErrorException", class_ErrorException_methods);
class_entry = zend_register_internal_class_ex(&ce, class_entry_Exception);
return class_entry;
}
zend_class_entry *register_class_Error(zend_class_entry *class_entry_Throwable)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "Error", class_Error_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
zend_class_implements(class_entry, 1, class_entry_Throwable);
zval property_message_default_value;
ZVAL_EMPTY_STRING(&property_message_default_value);
zend_string *property_message_name = zend_string_init("message", sizeof("message") - 1, 1);
zend_declare_property_ex(class_entry, property_message_name, &property_message_default_value, ZEND_ACC_PROTECTED, NULL);
zend_string_release(property_message_name);
zval property_string_default_value;
ZVAL_EMPTY_STRING(&property_string_default_value);
zend_string *property_string_name = zend_string_init("string", sizeof("string") - 1, 1);
zend_declare_property_ex(class_entry, property_string_name, &property_string_default_value, ZEND_ACC_PRIVATE, NULL);
zend_string_release(property_string_name);
zval property_code_default_value;
ZVAL_LONG(&property_code_default_value, 0);
zend_string *property_code_name = zend_string_init("code", sizeof("code") - 1, 1);
zend_declare_property_ex(class_entry, property_code_name, &property_code_default_value, ZEND_ACC_PROTECTED, NULL);
zend_string_release(property_code_name);
zval property_file_default_value;
ZVAL_NULL(&property_file_default_value);
zend_string *property_file_name = zend_string_init("file", sizeof("file") - 1, 1);
zend_declare_property_ex(class_entry, property_file_name, &property_file_default_value, ZEND_ACC_PROTECTED, NULL);
zend_string_release(property_file_name);
zval property_line_default_value;
ZVAL_NULL(&property_line_default_value);
zend_string *property_line_name = zend_string_init("line", sizeof("line") - 1, 1);
zend_declare_property_ex(class_entry, property_line_name, &property_line_default_value, ZEND_ACC_PROTECTED, NULL);
zend_string_release(property_line_name);
zval property_trace_default_value;
ZVAL_EMPTY_ARRAY(&property_trace_default_value);
zend_string *property_trace_name = zend_string_init("trace", sizeof("trace") - 1, 1);
zend_declare_typed_property(class_entry, property_trace_name, &property_trace_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY));
zend_string_release(property_trace_name);
zend_string *property_previous_class_Throwable = zend_string_init("Throwable", sizeof("Throwable")-1, 1);
zval property_previous_default_value;
ZVAL_NULL(&property_previous_default_value);
zend_string *property_previous_name = zend_string_init("previous", sizeof("previous") - 1, 1);
zend_declare_typed_property(class_entry, property_previous_name, &property_previous_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previous_class_Throwable, 1, 0));
zend_string_release(property_previous_name);
return class_entry;
}
zend_class_entry *register_class_CompileError(zend_class_entry *class_entry_Error)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "CompileError", class_CompileError_methods);
class_entry = zend_register_internal_class_ex(&ce, class_entry_Error);
return class_entry;
}
zend_class_entry *register_class_ParseError(zend_class_entry *class_entry_CompileError)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "ParseError", class_ParseError_methods);
class_entry = zend_register_internal_class_ex(&ce, class_entry_CompileError);
return class_entry;
}
zend_class_entry *register_class_TypeError(zend_class_entry *class_entry_Error)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "TypeError", class_TypeError_methods);
class_entry = zend_register_internal_class_ex(&ce, class_entry_Error);
return class_entry;
}
zend_class_entry *register_class_ArgumentCountError(zend_class_entry *class_entry_TypeError)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "ArgumentCountError", class_ArgumentCountError_methods);
class_entry = zend_register_internal_class_ex(&ce, class_entry_TypeError);
return class_entry;
}
zend_class_entry *register_class_ValueError(zend_class_entry *class_entry_Error)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "ValueError", class_ValueError_methods);
class_entry = zend_register_internal_class_ex(&ce, class_entry_Error);
return class_entry;
}
zend_class_entry *register_class_ArithmeticError(zend_class_entry *class_entry_Error)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "ArithmeticError", class_ArithmeticError_methods);
class_entry = zend_register_internal_class_ex(&ce, class_entry_Error);
return class_entry;
}
zend_class_entry *register_class_DivisionByZeroError(zend_class_entry *class_entry_ArithmeticError)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "DivisionByZeroError", class_DivisionByZeroError_methods);
class_entry = zend_register_internal_class_ex(&ce, class_entry_ArithmeticError);
return class_entry;
}
zend_class_entry *register_class_UnhandledMatchError(zend_class_entry *class_entry_Error)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "UnhandledMatchError", class_UnhandledMatchError_methods);
class_entry = zend_register_internal_class_ex(&ce, class_entry_Error);
return class_entry;
}
+63 -38
View File
@@ -716,12 +716,12 @@ ZEND_API ZEND_COLD void zend_verify_arg_error(
zend_string_release(need_msg);
}
static bool zend_verify_weak_scalar_type_hint(uint32_t type_mask, zval *arg)
static zend_bool zend_verify_weak_scalar_type_hint(uint32_t type_mask, zval *arg)
{
zend_long lval;
double dval;
zend_string *str;
bool bval;
zend_bool bval;
/* Type preference order: int -> float -> string -> bool */
if (type_mask & MAY_BE_LONG) {
@@ -775,11 +775,11 @@ static bool can_convert_to_string(zval *zv) {
}
/* Used to sanity-check internal arginfo types without performing any actual type conversions. */
static bool zend_verify_weak_scalar_type_hint_no_sideeffect(uint32_t type_mask, zval *arg)
static zend_bool zend_verify_weak_scalar_type_hint_no_sideeffect(uint32_t type_mask, zval *arg)
{
zend_long lval;
double dval;
bool bval;
zend_bool bval;
if ((type_mask & MAY_BE_LONG) && zend_parse_arg_long_weak(arg, &lval)) {
return 1;
@@ -797,7 +797,7 @@ static bool zend_verify_weak_scalar_type_hint_no_sideeffect(uint32_t type_mask,
}
#endif
ZEND_API bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, bool strict, bool is_internal_arg)
ZEND_API zend_bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, zend_bool strict, zend_bool is_internal_arg)
{
if (UNEXPECTED(strict)) {
/* SSTH Exception: IS_LONG may be accepted as IS_DOUBLE (converted) */
@@ -851,7 +851,7 @@ static zend_class_entry *resolve_single_class_type(zend_string *name, zend_class
}
}
static bool zend_check_and_resolve_property_class_type(
static zend_bool zend_check_and_resolve_property_class_type(
zend_property_info *info, zend_class_entry *object_ce) {
zend_class_entry *ce;
if (ZEND_TYPE_HAS_LIST(info->type)) {
@@ -890,7 +890,7 @@ static bool zend_check_and_resolve_property_class_type(
}
}
static zend_always_inline bool i_zend_check_property_type(zend_property_info *info, zval *property, bool strict)
static zend_always_inline zend_bool i_zend_check_property_type(zend_property_info *info, zval *property, zend_bool strict)
{
ZEND_ASSERT(!Z_ISREF_P(property));
if (EXPECTED(ZEND_TYPE_CONTAINS_CODE(info->type, Z_TYPE_P(property)))) {
@@ -910,7 +910,7 @@ static zend_always_inline bool i_zend_check_property_type(zend_property_info *in
return zend_verify_scalar_type_hint(type_mask, property, strict, 0);
}
static zend_always_inline bool i_zend_verify_property_type(zend_property_info *info, zval *property, bool strict)
static zend_always_inline zend_bool i_zend_verify_property_type(zend_property_info *info, zval *property, zend_bool strict)
{
if (i_zend_check_property_type(info, property, strict)) {
return 1;
@@ -920,7 +920,7 @@ static zend_always_inline bool i_zend_verify_property_type(zend_property_info *i
return 0;
}
ZEND_API bool zend_never_inline zend_verify_property_type(zend_property_info *info, zval *property, bool strict) {
ZEND_API zend_bool zend_never_inline zend_verify_property_type(zend_property_info *info, zval *property, zend_bool strict) {
return i_zend_verify_property_type(info, property, strict);
}
@@ -939,7 +939,7 @@ static zend_never_inline zval* zend_assign_to_typed_prop(zend_property_info *inf
return zend_assign_to_variable(property_val, &tmp, IS_TMP_VAR, EX_USES_STRICT_TYPES());
}
ZEND_API bool zend_value_instanceof_static(zval *zv) {
ZEND_API zend_bool zend_value_instanceof_static(zval *zv) {
if (Z_TYPE_P(zv) != IS_OBJECT) {
return 0;
}
@@ -959,9 +959,9 @@ ZEND_API bool zend_value_instanceof_static(zval *zv) {
# define HAVE_CACHE_SLOT 1
#endif
static zend_always_inline bool zend_check_type_slow(
static zend_always_inline zend_bool zend_check_type_slow(
zend_type type, zval *arg, zend_reference *ref, void **cache_slot, zend_class_entry *scope,
bool is_return_type, bool is_internal)
zend_bool is_return_type, zend_bool is_internal)
{
uint32_t type_mask;
if (ZEND_TYPE_HAS_CLASS(type) && Z_TYPE_P(arg) == IS_OBJECT) {
@@ -1039,9 +1039,9 @@ builtin_types:
* because this case is already checked at compile-time. */
}
static zend_always_inline bool zend_check_type(
static zend_always_inline zend_bool zend_check_type(
zend_type type, zval *arg, void **cache_slot, zend_class_entry *scope,
bool is_return_type, bool is_internal)
zend_bool is_return_type, zend_bool is_internal)
{
zend_reference *ref = NULL;
ZEND_ASSERT(ZEND_TYPE_IS_SET(type));
@@ -1115,7 +1115,7 @@ static zend_never_inline ZEND_ATTRIBUTE_UNUSED bool zend_verify_internal_arg_typ
/* Determine whether an internal call should throw, because the passed arguments violate
* an arginfo constraint. This is only checked in debug builds. In release builds, we
* trust that arginfo matches what is enforced by zend_parse_parameters. */
static zend_always_inline bool zend_internal_call_should_throw(zend_function *fbc, zend_execute_data *call)
static zend_always_inline zend_bool zend_internal_call_should_throw(zend_function *fbc, zend_execute_data *call)
{
if (fbc->internal_function.handler == ZEND_FN(pass)) {
/* Be lenient about the special pass function. */
@@ -1144,7 +1144,7 @@ static zend_always_inline bool zend_internal_call_should_throw(zend_function *fb
static ZEND_COLD void zend_internal_call_arginfo_violation(zend_function *fbc)
{
zend_error(E_CORE_ERROR, "Arginfo / zpp mismatch during call of %s%s%s()",
zend_error(E_ERROR, "Arginfo / zpp mismatch during call of %s%s%s()",
fbc->common.scope ? ZSTR_VAL(fbc->common.scope->name) : "",
fbc->common.scope ? "::" : "",
ZSTR_VAL(fbc->common.function_name));
@@ -2100,7 +2100,31 @@ num_undef:
}
str_index:
retval = zend_hash_find_ex(ht, offset_key, ZEND_CONST_COND(dim_type == IS_CONST, 0));
if (!retval) {
if (retval) {
/* support for $GLOBALS[...] */
if (UNEXPECTED(Z_TYPE_P(retval) == IS_INDIRECT)) {
retval = Z_INDIRECT_P(retval);
if (UNEXPECTED(Z_TYPE_P(retval) == IS_UNDEF)) {
switch (type) {
case BP_VAR_R:
zend_undefined_index(offset_key);
/* break missing intentionally */
case BP_VAR_UNSET:
case BP_VAR_IS:
retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
if (UNEXPECTED(zend_undefined_index_write(ht, offset_key))) {
return NULL;
}
/* break missing intentionally */
case BP_VAR_W:
ZVAL_NULL(retval);
break;
}
}
}
} else {
switch (type) {
case BP_VAR_R:
zend_undefined_index(offset_key);
@@ -2454,7 +2478,7 @@ num_idx:
return zend_hash_index_find(ht, hval);
} else if (Z_TYPE_P(offset) == IS_NULL) {
str_idx:
return zend_hash_find_ex(ht, ZSTR_EMPTY_ALLOC(), 1);
return zend_hash_find_ex_ind(ht, ZSTR_EMPTY_ALLOC(), 1);
} else if (Z_TYPE_P(offset) == IS_FALSE) {
hval = 0;
goto num_idx;
@@ -2552,7 +2576,7 @@ str_offset:
}
}
static zend_never_inline bool ZEND_FASTCALL zend_array_key_exists_fast(HashTable *ht, zval *key OPLINE_DC EXECUTE_DATA_DC)
static zend_never_inline zend_bool ZEND_FASTCALL zend_array_key_exists_fast(HashTable *ht, zval *key OPLINE_DC EXECUTE_DATA_DC)
{
zend_string *str;
zend_ulong hval;
@@ -2564,11 +2588,11 @@ try_again:
goto num_key;
}
str_key:
return zend_hash_exists(ht, str);
return zend_hash_find_ind(ht, str) != NULL;
} else if (EXPECTED(Z_TYPE_P(key) == IS_LONG)) {
hval = Z_LVAL_P(key);
num_key:
return zend_hash_index_exists(ht, hval);
return zend_hash_index_find(ht, hval) != NULL;
} else if (EXPECTED(Z_ISREF_P(key))) {
key = Z_REFVAL_P(key);
goto try_again;
@@ -2612,12 +2636,12 @@ static ZEND_COLD void ZEND_FASTCALL zend_array_key_exists_error(
}
}
static zend_always_inline bool promotes_to_array(zval *val) {
static zend_always_inline zend_bool promotes_to_array(zval *val) {
return Z_TYPE_P(val) <= IS_FALSE
|| (Z_ISREF_P(val) && Z_TYPE_P(Z_REFVAL_P(val)) <= IS_FALSE);
}
static zend_always_inline bool check_type_array_assignable(zend_type type) {
static zend_always_inline zend_bool check_type_array_assignable(zend_type type) {
if (!ZEND_TYPE_IS_SET(type)) {
return 1;
}
@@ -2625,7 +2649,7 @@ static zend_always_inline bool check_type_array_assignable(zend_type type) {
}
/* Checks whether an array can be assigned to the reference. Throws error if not assignable. */
ZEND_API bool zend_verify_ref_array_assignable(zend_reference *ref) {
ZEND_API zend_bool zend_verify_ref_array_assignable(zend_reference *ref) {
zend_property_info *prop;
ZEND_ASSERT(ZEND_REF_HAS_TYPE_SOURCES(ref));
ZEND_REF_FOREACH_TYPE_SOURCES(ref, prop) {
@@ -2653,7 +2677,7 @@ static zend_property_info *zend_object_fetch_property_type_info(
return zend_get_typed_property_info_for_slot(obj, slot);
}
static zend_never_inline bool zend_handle_fetch_obj_flags(
static zend_never_inline zend_bool zend_handle_fetch_obj_flags(
zval *result, zval *ptr, zend_object *obj, zend_property_info *prop_info, uint32_t flags)
{
switch (flags) {
@@ -2698,7 +2722,7 @@ static zend_never_inline bool zend_handle_fetch_obj_flags(
return 1;
}
static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, void **cache_slot, int type, uint32_t flags, bool init_undef OPLINE_DC EXECUTE_DATA_DC)
static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, void **cache_slot, int type, uint32_t flags, zend_bool init_undef OPLINE_DC EXECUTE_DATA_DC)
{
zval *ptr;
zend_object *zobj;
@@ -3039,7 +3063,7 @@ ZEND_API ZEND_COLD void zend_throw_conflicting_coercion_error(zend_property_info
/* 1: valid, 0: invalid, -1: may be valid after type coercion */
static zend_always_inline int i_zend_verify_type_assignable_zval(
zend_property_info *info, zval *zv, bool strict) {
zend_property_info *info, zval *zv, zend_bool strict) {
zend_type type = info->type;
uint32_t type_mask;
zend_uchar zv_type = Z_TYPE_P(zv);
@@ -3082,7 +3106,7 @@ static zend_always_inline int i_zend_verify_type_assignable_zval(
return -1;
}
ZEND_API bool ZEND_FASTCALL zend_verify_ref_assignable_zval(zend_reference *ref, zval *zv, bool strict)
ZEND_API zend_bool ZEND_FASTCALL zend_verify_ref_assignable_zval(zend_reference *ref, zval *zv, zend_bool strict)
{
zend_property_info *prop;
@@ -3161,9 +3185,9 @@ static zend_always_inline void i_zval_ptr_dtor_noref(zval *zval_ptr) {
}
}
ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *orig_value, zend_uchar value_type, bool strict)
ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *orig_value, zend_uchar value_type, zend_bool strict)
{
bool ret;
zend_bool ret;
zval value;
zend_refcounted *ref = NULL;
@@ -3194,7 +3218,7 @@ ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *orig_value, ze
return variable_ptr;
}
ZEND_API bool ZEND_FASTCALL zend_verify_prop_assignable_by_ref(zend_property_info *prop_info, zval *orig_val, bool strict) {
ZEND_API zend_bool ZEND_FASTCALL zend_verify_prop_assignable_by_ref(zend_property_info *prop_info, zval *orig_val, zend_bool strict) {
zval *val = orig_val;
if (Z_ISREF_P(val) && ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(val))) {
int result;
@@ -3372,12 +3396,13 @@ ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_val
ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table) /* {{{ */
{
/* Clean before putting into the cache, since clean could call dtors,
* which could use the cached hash. Also do this before the check for
* available cache slots, as those may be used by a dtor as well. */
zend_symtable_clean(symbol_table);
if (EG(symtable_cache_ptr) >= EG(symtable_cache_limit)) {
zend_array_destroy(symbol_table);
} else {
/* clean before putting into the cache, since clean
could call dtors, which could use cached hash */
zend_symtable_clean(symbol_table);
*(EG(symtable_cache_ptr)++) = symbol_table;
}
}
@@ -3501,7 +3526,7 @@ static zend_always_inline void zend_init_cvs(uint32_t first, uint32_t last EXECU
}
}
static zend_always_inline void i_init_func_execute_data(zend_op_array *op_array, zval *return_value, bool may_be_trampoline EXECUTE_DATA_DC) /* {{{ */
static zend_always_inline void i_init_func_execute_data(zend_op_array *op_array, zval *return_value, zend_bool may_be_trampoline EXECUTE_DATA_DC) /* {{{ */
{
uint32_t first_extra_arg, num_args;
ZEND_ASSERT(EX(func) == (zend_function*)op_array);
@@ -4200,7 +4225,7 @@ static zend_never_inline zend_op_array* ZEND_FASTCALL zend_include_or_eval(zval
already_compiled:
new_op_array = ZEND_FAKE_OP_ARRAY;
}
} else {
} else if (!EG(exception)) {
zend_message_dispatcher(
(type == ZEND_INCLUDE_ONCE) ?
ZMSG_FAILED_INCLUDE_FOPEN : ZMSG_FAILED_REQUIRE_FOPEN,
@@ -4238,11 +4263,11 @@ already_compiled:
}
/* }}} */
static zend_never_inline bool ZEND_FASTCALL zend_fe_reset_iterator(zval *array_ptr, int by_ref OPLINE_DC EXECUTE_DATA_DC) /* {{{ */
static zend_never_inline zend_bool ZEND_FASTCALL zend_fe_reset_iterator(zval *array_ptr, int by_ref OPLINE_DC EXECUTE_DATA_DC) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(array_ptr);
zend_object_iterator *iter = ce->get_iterator(ce, array_ptr, by_ref);
bool is_empty;
zend_bool is_empty;
if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) {
if (iter) {
+12 -12
View File
@@ -43,7 +43,7 @@ ZEND_API void zend_init_code_execute_data(zend_execute_data *execute_data, zend_
ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value);
ZEND_API void execute_ex(zend_execute_data *execute_data);
ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value);
ZEND_API bool zend_is_valid_class_name(zend_string *name);
ZEND_API zend_bool zend_is_valid_class_name(zend_string *name);
ZEND_API zend_class_entry *zend_lookup_class(zend_string *name);
ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, zend_string *lcname, uint32_t flags);
ZEND_API zend_class_entry *zend_get_called_scope(zend_execute_data *ex);
@@ -60,21 +60,21 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_function(const zend_function *fbc);
ZEND_COLD void ZEND_FASTCALL zend_param_must_be_ref(const zend_function *func, uint32_t arg_num);
ZEND_API bool ZEND_FASTCALL zend_verify_ref_assignable_zval(zend_reference *ref, zval *zv, bool strict);
ZEND_API bool ZEND_FASTCALL zend_verify_prop_assignable_by_ref(zend_property_info *prop_info, zval *orig_val, bool strict);
ZEND_API zend_bool ZEND_FASTCALL zend_verify_ref_assignable_zval(zend_reference *ref, zval *zv, zend_bool strict);
ZEND_API zend_bool ZEND_FASTCALL zend_verify_prop_assignable_by_ref(zend_property_info *prop_info, zval *orig_val, zend_bool strict);
ZEND_API ZEND_COLD void zend_throw_ref_type_error_zval(zend_property_info *prop, zval *zv);
ZEND_API ZEND_COLD void zend_throw_ref_type_error_type(zend_property_info *prop1, zend_property_info *prop2, zval *zv);
ZEND_API ZEND_COLD zend_result ZEND_FASTCALL zend_undefined_offset_write(HashTable *ht, zend_long lval);
ZEND_API ZEND_COLD zend_result ZEND_FASTCALL zend_undefined_index_write(HashTable *ht, zend_string *offset);
ZEND_API bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, bool strict, bool is_internal_arg);
ZEND_API zend_bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, zend_bool strict, zend_bool is_internal_arg);
ZEND_API ZEND_COLD void zend_verify_arg_error(
const zend_function *zf, const zend_arg_info *arg_info, int arg_num, zval *value);
ZEND_API ZEND_COLD void zend_verify_return_error(
const zend_function *zf, zval *value);
ZEND_API bool zend_verify_ref_array_assignable(zend_reference *ref);
ZEND_API bool zend_value_instanceof_static(zval *zv);
ZEND_API zend_bool zend_verify_ref_array_assignable(zend_reference *ref);
ZEND_API zend_bool zend_value_instanceof_static(zval *zv);
#define ZEND_REF_TYPE_SOURCES(ref) \
@@ -92,7 +92,7 @@ ZEND_API bool zend_value_instanceof_static(zval *zv);
ZEND_API void ZEND_FASTCALL zend_ref_add_type_source(zend_property_info_source_list *source_list, zend_property_info *prop);
ZEND_API void ZEND_FASTCALL zend_ref_del_type_source(zend_property_info_source_list *source_list, zend_property_info *prop);
ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *value, zend_uchar value_type, bool strict);
ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *value, zend_uchar value_type, zend_bool strict);
static zend_always_inline void zend_copy_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type)
{
@@ -121,7 +121,7 @@ static zend_always_inline void zend_copy_to_variable(zval *variable_ptr, zval *v
}
}
static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type, bool strict)
static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type, zend_bool strict)
{
do {
if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) {
@@ -155,8 +155,8 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
return variable_ptr;
}
ZEND_API zend_result ZEND_FASTCALL zval_update_constant(zval *pp);
ZEND_API zend_result ZEND_FASTCALL zval_update_constant_ex(zval *pp, zend_class_entry *scope);
ZEND_API zend_result zval_update_constant(zval *pp);
ZEND_API zend_result zval_update_constant_ex(zval *pp, zend_class_entry *scope);
/* dedicated Zend executor functions - do not use! */
struct _zend_vm_stack {
@@ -317,7 +317,7 @@ ZEND_API const char *zend_get_executed_filename(void);
ZEND_API zend_string *zend_get_executed_filename_ex(void);
ZEND_API uint32_t zend_get_executed_lineno(void);
ZEND_API zend_class_entry *zend_get_executed_scope(void);
ZEND_API bool zend_is_executing(void);
ZEND_API zend_bool zend_is_executing(void);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_cannot_pass_by_reference(uint32_t arg_num);
ZEND_API void zend_set_timeout(zend_long seconds, bool reset_signals);
@@ -418,7 +418,7 @@ ZEND_API int ZEND_FASTCALL zend_handle_undef_args(zend_execute_data *call);
#define ZEND_CLASS_HAS_TYPE_HINTS(ce) ((ce->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) == ZEND_ACC_HAS_TYPE_HINTS)
ZEND_API bool zend_verify_property_type(zend_property_info *info, zval *property, bool strict);
ZEND_API zend_bool zend_verify_property_type(zend_property_info *info, zval *property, zend_bool strict);
ZEND_COLD void zend_verify_property_type_error(zend_property_info *info, zval *property);
#define ZEND_REF_ADD_TYPE_SOURCE(ref, source) \
+9 -9
View File
@@ -258,9 +258,9 @@ void shutdown_executor(void) /* {{{ */
zend_string *key;
zval *zv;
#if ZEND_DEBUG
bool fast_shutdown = 0;
zend_bool fast_shutdown = 0;
#else
bool fast_shutdown = is_zend_mm() && !EG(full_tables_cleanup);
zend_bool fast_shutdown = is_zend_mm() && !EG(full_tables_cleanup);
#endif
zend_try {
@@ -604,13 +604,13 @@ ZEND_API zend_class_entry *zend_get_executed_scope(void) /* {{{ */
}
/* }}} */
ZEND_API bool zend_is_executing(void) /* {{{ */
ZEND_API zend_bool zend_is_executing(void) /* {{{ */
{
return EG(current_execute_data) != 0;
}
/* }}} */
ZEND_API zend_result ZEND_FASTCALL zval_update_constant_ex(zval *p, zend_class_entry *scope) /* {{{ */
ZEND_API zend_result zval_update_constant_ex(zval *p, zend_class_entry *scope) /* {{{ */
{
if (Z_TYPE_P(p) == IS_CONSTANT_AST) {
zend_ast *ast = Z_ASTVAL_P(p);
@@ -638,7 +638,7 @@ ZEND_API zend_result ZEND_FASTCALL zval_update_constant_ex(zval *p, zend_class_e
}
/* }}} */
ZEND_API zend_result ZEND_FASTCALL zval_update_constant(zval *pp) /* {{{ */
ZEND_API zend_result zval_update_constant(zval *pp) /* {{{ */
{
return zval_update_constant_ex(pp, EG(current_execute_data) ? zend_get_executed_scope() : CG(active_class_entry));
}
@@ -759,7 +759,7 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_
for (i=0; i<fci->param_count; i++) {
zval *param = ZEND_CALL_ARG(call, i+1);
zval *arg = &fci->params[i];
bool must_wrap = 0;
zend_bool must_wrap = 0;
if (UNEXPECTED(Z_ISUNDEF_P(arg))) {
/* Allow forwarding undef slots. This is only used by Closure::__invoke(). */
ZVAL_UNDEF(param);
@@ -806,9 +806,9 @@ cleanup_args:
zend_string *name;
zval *arg;
uint32_t arg_num = ZEND_CALL_NUM_ARGS(call) + 1;
bool have_named_params = 0;
zend_bool have_named_params = 0;
ZEND_HASH_FOREACH_STR_KEY_VAL(fci->named_params, name, arg) {
bool must_wrap = 0;
zend_bool must_wrap = 0;
zval *target;
if (name) {
void *cache_slot[2] = {NULL, NULL};
@@ -1017,7 +1017,7 @@ static const uint32_t valid_chars[8] = {
0xffffffff,
};
ZEND_API bool zend_is_valid_class_name(zend_string *name) {
ZEND_API zend_bool zend_is_valid_class_name(zend_string *name) {
for (size_t i = 0; i < ZSTR_LEN(name); i++) {
unsigned char c = ZSTR_VAL(name)[i];
if (!ZEND_BIT_TEST(valid_chars, c)) {
+6 -6
View File
@@ -44,7 +44,7 @@ You can use the following macro to check the extension API version for compatibi
/* The first number is the engine version and the rest is the date (YYYYMMDD).
* This way engine 2/3 API no. is always greater than engine 1 API no.. */
#define ZEND_EXTENSION_API_NO 420201009
#define ZEND_EXTENSION_API_NO 420200930
typedef struct _zend_extension_version_info {
int zend_extension_api_no;
@@ -75,11 +75,11 @@ typedef size_t (*op_array_persist_calc_func_t)(zend_op_array *op_array);
typedef size_t (*op_array_persist_func_t)(zend_op_array *op_array, void *mem);
struct _zend_extension {
const char *name;
const char *version;
const char *author;
const char *URL;
const char *copyright;
char *name;
char *version;
char *author;
char *URL;
char *copyright;
startup_func_t startup;
shutdown_func_t shutdown;
+27 -16
View File
@@ -209,10 +209,10 @@ typedef struct _gc_root_buffer {
typedef struct _zend_gc_globals {
gc_root_buffer *buf; /* preallocated arrays of buffers */
bool gc_enabled;
bool gc_active; /* GC currently running, forbid nested GC */
bool gc_protected; /* GC protected, forbid root additions */
bool gc_full;
zend_bool gc_enabled;
zend_bool gc_active; /* GC currently running, forbid nested GC */
zend_bool gc_protected; /* GC protected, forbid root additions */
zend_bool gc_full;
uint32_t unused; /* linked list of unused buffers */
uint32_t first_unused; /* first unused buffer */
@@ -493,9 +493,9 @@ void gc_reset(void)
}
}
ZEND_API bool gc_enable(bool enable)
ZEND_API zend_bool gc_enable(zend_bool enable)
{
bool old_enabled = GC_G(gc_enabled);
zend_bool old_enabled = GC_G(gc_enabled);
GC_G(gc_enabled) = enable;
if (enable && !old_enabled && GC_G(buf) == NULL) {
GC_G(buf) = (gc_root_buffer*) pemalloc(sizeof(gc_root_buffer) * GC_DEFAULT_BUF_SIZE, 1);
@@ -507,19 +507,19 @@ ZEND_API bool gc_enable(bool enable)
return old_enabled;
}
ZEND_API bool gc_enabled(void)
ZEND_API zend_bool gc_enabled(void)
{
return GC_G(gc_enabled);
}
ZEND_API bool gc_protect(bool protect)
ZEND_API zend_bool gc_protect(zend_bool protect)
{
bool old_protected = GC_G(gc_protected);
zend_bool old_protected = GC_G(gc_protected);
GC_G(gc_protected) = protect;
return old_protected;
}
ZEND_API bool gc_protected(void)
ZEND_API zend_bool gc_protected(void)
{
return GC_G(gc_protected);
}
@@ -740,8 +740,11 @@ tail_call:
goto next;
}
} else if (GC_TYPE(ref) == IS_ARRAY) {
ZEND_ASSERT((zend_array*)ref != &EG(symbol_table));
ht = (zend_array*)ref;
if ((zend_array*)ref != &EG(symbol_table)) {
ht = (zend_array*)ref;
} else {
goto next;
}
} else if (GC_TYPE(ref) == IS_REFERENCE) {
if (Z_REFCOUNTED(((zend_reference*)ref)->val)) {
ref = Z_COUNTED(((zend_reference*)ref)->val);
@@ -858,8 +861,12 @@ static void gc_mark_grey(zend_refcounted *ref, gc_stack *stack)
goto next;
}
} else if (GC_TYPE(ref) == IS_ARRAY) {
ZEND_ASSERT(((zend_array*)ref) != &EG(symbol_table));
ht = (zend_array*)ref;
if (((zend_array*)ref) == &EG(symbol_table)) {
GC_REF_SET_BLACK(ref);
goto next;
} else {
ht = (zend_array*)ref;
}
} else if (GC_TYPE(ref) == IS_REFERENCE) {
if (Z_REFCOUNTED(((zend_reference*)ref)->val)) {
ref = Z_COUNTED(((zend_reference*)ref)->val);
@@ -1039,8 +1046,12 @@ tail_call:
goto next;
}
} else if (GC_TYPE(ref) == IS_ARRAY) {
ZEND_ASSERT((zend_array*)ref != &EG(symbol_table));
ht = (zend_array*)ref;
if ((zend_array*)ref == &EG(symbol_table)) {
GC_REF_SET_BLACK(ref);
goto next;
} else {
ht = (zend_array*)ref;
}
} else if (GC_TYPE(ref) == IS_REFERENCE) {
if (Z_REFCOUNTED(((zend_reference*)ref)->val)) {
ref = Z_COUNTED(((zend_reference*)ref)->val);
+4 -4
View File
@@ -35,12 +35,12 @@ ZEND_API void ZEND_FASTCALL gc_possible_root(zend_refcounted *ref);
ZEND_API void ZEND_FASTCALL gc_remove_from_buffer(zend_refcounted *ref);
/* enable/disable automatic start of GC collection */
ZEND_API bool gc_enable(bool enable);
ZEND_API bool gc_enabled(void);
ZEND_API zend_bool gc_enable(zend_bool enable);
ZEND_API zend_bool gc_enabled(void);
/* enable/disable possible root additions */
ZEND_API bool gc_protect(bool protect);
ZEND_API bool gc_protected(void);
ZEND_API zend_bool gc_protect(zend_bool protect);
ZEND_API zend_bool gc_protected(void);
/* The default implementation of the gc_collect_cycles callback. */
ZEND_API int zend_gc_collect_cycles(void);
+18 -8
View File
@@ -115,7 +115,7 @@ static void zend_generator_cleanup_unfinished_execution(
}
/* }}} */
ZEND_API void zend_generator_close(zend_generator *generator, bool finished_execution) /* {{{ */
ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution) /* {{{ */
{
if (EXPECTED(generator->execute_data)) {
zend_execute_data *execute_data = generator->execute_data;
@@ -165,14 +165,14 @@ static void zend_generator_remove_child(zend_generator_node *node, zend_generato
{
ZEND_ASSERT(node->children >= 1);
if (node->children == 1) {
node->child.single = NULL;
node->child.single.child = NULL;
} else {
HashTable *ht = node->child.ht;
zend_hash_index_del(ht, (zend_ulong) child);
if (node->children == 2) {
zend_generator *other_child;
ZEND_HASH_FOREACH_PTR(ht, other_child) {
node->child.single = other_child;
node->child.single.child = other_child;
break;
} ZEND_HASH_FOREACH_END();
zend_hash_destroy(ht);
@@ -479,13 +479,13 @@ static void zend_generator_add_child(zend_generator *generator, zend_generator *
zend_generator_node *node = &generator->node;
if (node->children == 0) {
node->child.single = child;
node->child.single.child = child;
} else {
if (node->children == 1) {
HashTable *ht = emalloc(sizeof(HashTable));
zend_hash_init(ht, 0, NULL, NULL, 0);
zend_hash_index_add_new_ptr(ht,
(zend_ulong) node->child.single, node->child.single);
(zend_ulong) node->child.single.child, node->child.single.child);
node->child.ht = ht;
}
@@ -524,7 +524,7 @@ ZEND_API zend_generator *zend_generator_update_root(zend_generator *generator)
static zend_generator *get_new_root(zend_generator *generator, zend_generator *root)
{
while (!root->execute_data && root->node.children == 1) {
root = root->node.child.single;
root = root->node.child.single.child;
}
if (root->execute_data) {
@@ -614,6 +614,9 @@ static zend_result zend_generator_get_next_delegated_value(zend_generator *gener
p = &ht->arData[pos];
value = &p->val;
if (Z_TYPE_P(value) == IS_INDIRECT) {
value = Z_INDIRECT_P(value);
}
pos++;
} while (Z_ISUNDEF_P(value));
@@ -1112,11 +1115,17 @@ zend_object_iterator *zend_generator_get_iterator(zend_class_entry *ce, zval *ob
void zend_register_generator_ce(void) /* {{{ */
{
zend_ce_generator = register_class_Generator(zend_ce_iterator);
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "Generator", class_Generator_methods);
zend_ce_generator = zend_register_internal_class(&ce);
zend_ce_generator->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
zend_ce_generator->create_object = zend_generator_create;
zend_ce_generator->serialize = zend_class_serialize_deny;
zend_ce_generator->unserialize = zend_class_unserialize_deny;
/* get_iterator has to be assigned *after* implementing the interface */
zend_class_implements(zend_ce_generator, 1, zend_ce_iterator);
zend_ce_generator->get_iterator = zend_generator_get_iterator;
memcpy(&zend_generator_handlers, &std_object_handlers, sizeof(zend_object_handlers));
@@ -1126,6 +1135,7 @@ void zend_register_generator_ce(void) /* {{{ */
zend_generator_handlers.clone_obj = NULL;
zend_generator_handlers.get_constructor = zend_generator_get_constructor;
zend_ce_ClosedGeneratorException = register_class_ClosedGeneratorException(zend_ce_exception);
INIT_CLASS_ENTRY(ce, "ClosedGeneratorException", NULL);
zend_ce_ClosedGeneratorException = zend_register_internal_class_ex(&ce, zend_ce_exception);
}
/* }}} */
+5 -2
View File
@@ -41,7 +41,10 @@ struct _zend_generator_node {
uint32_t children;
union {
HashTable *ht; /* if multiple children */
zend_generator *single; /* if one child */
struct { /* if one child */
zend_generator *leaf; /* TODO: Unused, remove. */
zend_generator *child;
} single;
} child;
/* One generator can cache a direct pointer to the current root.
* The leaf member points back to the generator using the root cache. */
@@ -94,7 +97,7 @@ static const zend_uchar ZEND_GENERATOR_AT_FIRST_YIELD = 0x4;
static const zend_uchar ZEND_GENERATOR_DO_INIT = 0x8;
void zend_register_generator_ce(void);
ZEND_API void zend_generator_close(zend_generator *generator, bool finished_execution);
ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution);
ZEND_API void zend_generator_resume(zend_generator *generator);
ZEND_API void zend_generator_restore_call_stack(zend_generator *generator);
+1 -5
View File
@@ -1,11 +1,7 @@
<?php
/**
* @generate-function-entries
* @generate-class-entries
*/
/** @generate-function-entries */
/** @strict-properties */
final class Generator implements Iterator
{
public function rewind(): void {}
+1 -24
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 9d6c2801abbb78d402efb2b2ccdd5242438bd6a1 */
* Stub hash: 50044c6c8d2a162a988906c0b752a5fe28adb933 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Generator_rewind, 0, 0, IS_VOID, 0)
ZEND_END_ARG_INFO()
@@ -51,26 +51,3 @@ static const zend_function_entry class_Generator_methods[] = {
static const zend_function_entry class_ClosedGeneratorException_methods[] = {
ZEND_FE_END
};
zend_class_entry *register_class_Generator(zend_class_entry *class_entry_Iterator)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "Generator", class_Generator_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES;
zend_class_implements(class_entry, 1, class_entry_Iterator);
return class_entry;
}
zend_class_entry *register_class_ClosedGeneratorException(zend_class_entry *class_entry_Exception)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "ClosedGeneratorException", class_ClosedGeneratorException_methods);
class_entry = zend_register_internal_class_ex(&ce, class_entry_Exception);
return class_entry;
}
+17 -17
View File
@@ -81,19 +81,19 @@ struct _zend_compiler_globals {
/* Refer to zend_yytnamerr() in zend_language_parser.y for meaning of values */
zend_uchar parse_error;
bool in_compilation;
bool short_tags;
zend_bool in_compilation;
zend_bool short_tags;
bool unclean_shutdown;
zend_bool unclean_shutdown;
bool ini_parser_unbuffered_errors;
zend_bool ini_parser_unbuffered_errors;
zend_llist open_files;
struct _zend_ini_parser_param *ini_parser_param;
bool skip_shebang;
bool increment_lineno;
zend_bool skip_shebang;
zend_bool increment_lineno;
zend_string *doc_comment;
uint32_t extra_fn_flags;
@@ -109,9 +109,9 @@ struct _zend_compiler_globals {
const zend_encoding **script_encoding_list;
size_t script_encoding_list_size;
bool multibyte;
bool detect_unicode;
bool encoding_declared;
zend_bool multibyte;
zend_bool detect_unicode;
zend_bool encoding_declared;
zend_ast *ast;
zend_arena *ast_arena;
@@ -176,13 +176,13 @@ struct _zend_executor_globals {
uint32_t persistent_classes_count;
HashTable *in_autoload;
bool full_tables_cleanup;
zend_bool full_tables_cleanup;
/* for extended information support */
bool no_extensions;
zend_bool no_extensions;
bool vm_interrupt;
bool timed_out;
zend_bool vm_interrupt;
zend_bool timed_out;
zend_long hard_timeout;
#ifdef ZEND_WIN32
@@ -218,7 +218,7 @@ struct _zend_executor_globals {
struct _zend_module_entry *current_module;
bool active;
zend_bool active;
zend_uchar flags;
zend_long assertions;
@@ -238,7 +238,7 @@ struct _zend_executor_globals {
HashTable weakrefs;
bool exception_ignore_args;
zend_bool exception_ignore_args;
zend_long exception_string_param_max_len;
zend_get_gc_buffer get_gc_buffer;
@@ -291,9 +291,9 @@ struct _zend_php_scanner_globals {
zend_stack state_stack;
zend_ptr_stack heredoc_label_stack;
zend_stack nest_location_stack; /* for syntax error reporting */
bool heredoc_scan_ahead;
zend_bool heredoc_scan_ahead;
int heredoc_indentation;
bool heredoc_indentation_uses_spaces;
zend_bool heredoc_indentation_uses_spaces;
/* original (unfiltered) script */
unsigned char *script_org;
+11 -11
View File
@@ -246,7 +246,7 @@ ZEND_API const HashTable zend_empty_array = {
.pDestructor = ZVAL_PTR_DTOR
};
static zend_always_inline void _zend_hash_init_int(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, bool persistent)
static zend_always_inline void _zend_hash_init_int(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent)
{
GC_SET_REFCOUNT(ht, 1);
GC_TYPE_INFO(ht) = GC_ARRAY | (persistent ? ((GC_PERSISTENT|GC_NOT_COLLECTABLE) << GC_FLAGS_SHIFT) : 0);
@@ -261,7 +261,7 @@ static zend_always_inline void _zend_hash_init_int(HashTable *ht, uint32_t nSize
ht->nTableSize = zend_hash_check_size(nSize);
}
ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, bool persistent)
ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent)
{
_zend_hash_init_int(ht, nSize, pDestructor, persistent);
}
@@ -310,7 +310,7 @@ static void ZEND_FASTCALL zend_hash_packed_grow(HashTable *ht)
HT_SET_DATA_ADDR(ht, perealloc2(HT_GET_DATA_ADDR(ht), HT_SIZE_EX(ht->nTableSize, HT_MIN_MASK), HT_USED_SIZE(ht), GC_FLAGS(ht) & IS_ARRAY_PERSISTENT));
}
ZEND_API void ZEND_FASTCALL zend_hash_real_init(HashTable *ht, bool packed)
ZEND_API void ZEND_FASTCALL zend_hash_real_init(HashTable *ht, zend_bool packed)
{
IS_CONSISTENT(ht);
@@ -365,7 +365,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_to_packed(HashTable *ht)
pefree(old_data, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
}
ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, bool packed)
ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, zend_bool packed)
{
HT_ASSERT_RC1(ht);
if (nSize == 0) return;
@@ -636,7 +636,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_iterators_advance(HashTable *ht, HashPosit
}
}
static zend_always_inline Bucket *zend_hash_find_bucket(const HashTable *ht, zend_string *key, bool known_hash)
static zend_always_inline Bucket *zend_hash_find_bucket(const HashTable *ht, zend_string *key, zend_bool known_hash)
{
zend_ulong h;
uint32_t nIndex;
@@ -2145,7 +2145,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
}
ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, bool overwrite)
ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, zend_bool overwrite)
{
uint32_t idx;
Bucket *p;
@@ -2203,7 +2203,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source
}
static bool ZEND_FASTCALL zend_hash_replace_checker_wrapper(HashTable *target, zval *source_data, Bucket *p, void *pParam, merge_checker_func_t merge_checker_func)
static zend_bool ZEND_FASTCALL zend_hash_replace_checker_wrapper(HashTable *target, zval *source_data, Bucket *p, void *pParam, merge_checker_func_t merge_checker_func)
{
zend_hash_key hash_key;
@@ -2494,7 +2494,7 @@ ZEND_API void zend_hash_bucket_packed_swap(Bucket *p, Bucket *q)
q->h = h;
}
ZEND_API void ZEND_FASTCALL zend_hash_sort_ex(HashTable *ht, sort_func_t sort, bucket_compare_func_t compar, bool renumber)
ZEND_API void ZEND_FASTCALL zend_hash_sort_ex(HashTable *ht, sort_func_t sort, bucket_compare_func_t compar, zend_bool renumber)
{
Bucket *p;
uint32_t i, j;
@@ -2566,7 +2566,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_sort_ex(HashTable *ht, sort_func_t sort, b
}
}
static zend_always_inline int zend_hash_compare_impl(HashTable *ht1, HashTable *ht2, compare_func_t compar, bool ordered) {
static zend_always_inline int zend_hash_compare_impl(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered) {
uint32_t idx1, idx2;
if (ht1->nNumOfElements != ht2->nNumOfElements) {
@@ -2644,7 +2644,7 @@ static zend_always_inline int zend_hash_compare_impl(HashTable *ht1, HashTable *
return 0;
}
ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, bool ordered)
ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered)
{
int result;
IS_CONSISTENT(ht1);
@@ -2803,7 +2803,7 @@ convert:
* a "symtable" (contains integer and non-numeric string keys).
* If the proptable didn't need duplicating, its refcount is incremented.
*/
ZEND_API HashTable* ZEND_FASTCALL zend_proptable_to_symtable(HashTable *ht, bool always_duplicate)
ZEND_API HashTable* ZEND_FASTCALL zend_proptable_to_symtable(HashTable *ht, zend_bool always_duplicate)
{
zend_ulong num_key;
zend_string *str_key;
+14 -41
View File
@@ -92,24 +92,24 @@ typedef struct _zend_hash_key {
zend_string *key;
} zend_hash_key;
typedef bool (*merge_checker_func_t)(HashTable *target_ht, zval *source_data, zend_hash_key *hash_key, void *pParam);
typedef zend_bool (*merge_checker_func_t)(HashTable *target_ht, zval *source_data, zend_hash_key *hash_key, void *pParam);
BEGIN_EXTERN_C()
/* startup/shutdown */
ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, bool persistent);
ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent);
ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht);
ZEND_API void ZEND_FASTCALL zend_hash_clean(HashTable *ht);
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) \
_zend_hash_init((ht), (nSize), (pDestructor), (persistent))
ZEND_API void ZEND_FASTCALL zend_hash_real_init(HashTable *ht, bool packed);
ZEND_API void ZEND_FASTCALL zend_hash_real_init(HashTable *ht, zend_bool packed);
ZEND_API void ZEND_FASTCALL zend_hash_real_init_packed(HashTable *ht);
ZEND_API void ZEND_FASTCALL zend_hash_real_init_mixed(HashTable *ht);
ZEND_API void ZEND_FASTCALL zend_hash_packed_to_hash(HashTable *ht);
ZEND_API void ZEND_FASTCALL zend_hash_to_packed(HashTable *ht);
ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, bool packed);
ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, zend_bool packed);
ZEND_API void ZEND_FASTCALL zend_hash_discard(HashTable *ht, uint32_t nNumUsed);
/* additions/updates/changes */
@@ -178,7 +178,7 @@ ZEND_API zval* ZEND_FASTCALL _zend_hash_index_find(const HashTable *ht, zend_ulo
/* The same as zend_hash_find(), but hash value of the key must be already calculated */
ZEND_API zval* ZEND_FASTCALL _zend_hash_find_known_hash(const HashTable *ht, zend_string *key);
static zend_always_inline zval *zend_hash_find_ex(const HashTable *ht, zend_string *key, bool known_hash)
static zend_always_inline zval *zend_hash_find_ex(const HashTable *ht, zend_string *key, zend_bool known_hash)
{
if (known_hash) {
return _zend_hash_find_known_hash(ht, key);
@@ -207,17 +207,17 @@ static zend_always_inline zval *zend_hash_find_ex(const HashTable *ht, zend_stri
/* Misc */
static zend_always_inline bool zend_hash_exists(const HashTable *ht, zend_string *key)
static zend_always_inline zend_bool zend_hash_exists(const HashTable *ht, zend_string *key)
{
return zend_hash_find(ht, key) != NULL;
}
static zend_always_inline bool zend_hash_str_exists(const HashTable *ht, const char *str, size_t len)
static zend_always_inline zend_bool zend_hash_str_exists(const HashTable *ht, const char *str, size_t len)
{
return zend_hash_str_find(ht, str, len) != NULL;
}
static zend_always_inline bool zend_hash_index_exists(const HashTable *ht, zend_ulong h)
static zend_always_inline zend_bool zend_hash_index_exists(const HashTable *ht, zend_ulong h)
{
return zend_hash_index_find(ht, h) != NULL;
}
@@ -257,15 +257,15 @@ ZEND_API void ZEND_FASTCALL zend_hash_internal_pointer_end_ex(HashTable *ht, Ha
/* Copying, merging and sorting */
ZEND_API void ZEND_FASTCALL zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor);
ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, bool overwrite);
ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, zend_bool overwrite);
ZEND_API void ZEND_FASTCALL zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, merge_checker_func_t pMergeSource, void *pParam);
ZEND_API void zend_hash_bucket_swap(Bucket *p, Bucket *q);
ZEND_API void zend_hash_bucket_renum_swap(Bucket *p, Bucket *q);
ZEND_API void zend_hash_bucket_packed_swap(Bucket *p, Bucket *q);
typedef int (*bucket_compare_func_t)(Bucket *a, Bucket *b);
ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, bool ordered);
ZEND_API void ZEND_FASTCALL zend_hash_sort_ex(HashTable *ht, sort_func_t sort_func, bucket_compare_func_t compare_func, bool renumber);
ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered);
ZEND_API void ZEND_FASTCALL zend_hash_sort_ex(HashTable *ht, sort_func_t sort_func, bucket_compare_func_t compare_func, zend_bool renumber);
ZEND_API zval* ZEND_FASTCALL zend_hash_minmax(const HashTable *ht, bucket_compare_func_t compar, uint32_t flag);
#define zend_hash_sort(ht, compare_func, renumber) \
@@ -303,7 +303,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source);
ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht);
ZEND_API void ZEND_FASTCALL zend_symtable_clean(HashTable *ht);
ZEND_API HashTable* ZEND_FASTCALL zend_symtable_to_proptable(HashTable *ht);
ZEND_API HashTable* ZEND_FASTCALL zend_proptable_to_symtable(HashTable *ht, bool always_duplicate);
ZEND_API HashTable* ZEND_FASTCALL zend_proptable_to_symtable(HashTable *ht, zend_bool always_duplicate);
ZEND_API bool ZEND_FASTCALL _zend_handle_numeric_str_ex(const char *key, size_t length, zend_ulong *idx);
@@ -386,7 +386,7 @@ static zend_always_inline zval *zend_hash_find_ind(const HashTable *ht, zend_str
}
static zend_always_inline zval *zend_hash_find_ex_ind(const HashTable *ht, zend_string *key, bool known_hash)
static zend_always_inline zval *zend_hash_find_ex_ind(const HashTable *ht, zend_string *key, zend_bool known_hash)
{
zval *zv;
@@ -839,7 +839,7 @@ static zend_always_inline void *zend_hash_find_ptr(const HashTable *ht, zend_str
}
}
static zend_always_inline void *zend_hash_find_ex_ptr(const HashTable *ht, zend_string *key, bool known_hash)
static zend_always_inline void *zend_hash_find_ex_ptr(const HashTable *ht, zend_string *key, zend_bool known_hash)
{
zval *zv;
@@ -1188,33 +1188,6 @@ static zend_always_inline void *zend_hash_get_current_data_ptr_ex(HashTable *ht,
ZEND_HASH_FILL_FINISH(); \
} while (0)
/* Check if an array is a list */
static zend_always_inline zend_bool zend_array_is_list(zend_array *array)
{
zend_long expected_idx = 0;
zend_long num_idx;
zend_string* str_idx;
/* Empty arrays are lists */
if (zend_hash_num_elements(array) == 0) {
return 1;
}
/* Packed arrays are lists */
if (HT_IS_PACKED(array) && HT_IS_WITHOUT_HOLES(array)) {
return 1;
}
/* Check if the list could theoretically be repacked */
ZEND_HASH_FOREACH_KEY(array, num_idx, str_idx) {
if (str_idx != NULL || num_idx != expected_idx++) {
return 0;
}
} ZEND_HASH_FOREACH_END();
return 1;
}
static zend_always_inline zval *_zend_hash_append_ex(HashTable *ht, zend_string *key, zval *zv, bool interned)
{
uint32_t idx = ht->nNumUsed++;
+1 -1
View File
@@ -40,7 +40,7 @@ BEGIN_EXTERN_C()
ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini);
ZEND_API void zend_strip(void);
ZEND_API zend_result highlight_file(const char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini);
ZEND_API void highlight_string(zend_string *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, const char *str_name);
ZEND_API void highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, const char *str_name);
ZEND_API void zend_html_putc(char c);
ZEND_API void zend_html_puts(const char *s, size_t len);
END_EXTERN_C()
+26 -25
View File
@@ -35,7 +35,7 @@ static void add_property_compatibility_obligation(
zend_class_entry *ce, const zend_property_info *child_prop,
const zend_property_info *parent_prop);
static void zend_type_copy_ctor(zend_type *type, bool persistent) {
static void zend_type_copy_ctor(zend_type *type, zend_bool persistent) {
if (ZEND_TYPE_HAS_LIST(*type)) {
zend_type_list *old_list = ZEND_TYPE_LIST(*type);
size_t size = ZEND_TYPE_LIST_SIZE(old_list->num_types);
@@ -111,7 +111,7 @@ static zend_function *zend_duplicate_user_function(zend_function *func) /* {{{ *
}
/* }}} */
static zend_always_inline zend_function *zend_duplicate_function(zend_function *func, zend_class_entry *ce, bool is_interface) /* {{{ */
static zend_always_inline zend_function *zend_duplicate_function(zend_function *func, zend_class_entry *ce, zend_bool is_interface) /* {{{ */
{
if (UNEXPECTED(func->type == ZEND_INTERNAL_FUNCTION)) {
return zend_duplicate_internal_function(func, ce);
@@ -229,7 +229,7 @@ static zend_string *resolve_class_name(zend_class_entry *scope, zend_string *nam
}
}
static bool class_visible(zend_class_entry *ce) {
static zend_bool class_visible(zend_class_entry *ce) {
if (ce->type == ZEND_INTERNAL_CLASS) {
return !(CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_CLASSES);
} else {
@@ -240,7 +240,7 @@ static bool class_visible(zend_class_entry *ce) {
}
static zend_class_entry *lookup_class(
zend_class_entry *scope, zend_string *name, bool register_unresolved) {
zend_class_entry *scope, zend_string *name, zend_bool register_unresolved) {
uint32_t flags = ZEND_FETCH_CLASS_ALLOW_UNLINKED | ZEND_FETCH_CLASS_NO_AUTOLOAD;
zend_class_entry *ce = zend_lookup_class_ex(name, NULL, flags);
if (!CG(in_compilation)) {
@@ -271,7 +271,7 @@ static zend_class_entry *lookup_class(
}
/* Instanceof that's safe to use on unlinked classes. */
static bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce2) {
static zend_bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce2) {
if (ce1 == ce2) {
return 1;
}
@@ -322,7 +322,7 @@ static bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce2) {
return 0;
}
static bool zend_type_contains_traversable(zend_type type) {
static zend_bool zend_type_contains_traversable(zend_type type) {
zend_type *single_type;
if (ZEND_TYPE_FULL_MASK(type) & MAY_BE_OBJECT) {
return 1;
@@ -337,7 +337,7 @@ static bool zend_type_contains_traversable(zend_type type) {
return 0;
}
static bool zend_type_permits_self(
static zend_bool zend_type_permits_self(
zend_type type, zend_class_entry *scope, zend_class_entry *self) {
if (ZEND_TYPE_FULL_MASK(type) & MAY_BE_OBJECT) {
return 1;
@@ -371,8 +371,8 @@ typedef enum {
static inheritance_status zend_perform_covariant_class_type_check(
zend_class_entry *fe_scope, zend_string *fe_class_name, zend_class_entry *fe_ce,
zend_class_entry *proto_scope, zend_type proto_type,
bool register_unresolved) {
bool have_unresolved = 0;
zend_bool register_unresolved) {
zend_bool have_unresolved = 0;
if (ZEND_TYPE_FULL_MASK(proto_type) & MAY_BE_OBJECT) {
/* Currently, any class name would be allowed here. We still perform a class lookup
* for forward-compatibility reasons, as we may have named types in the future that
@@ -458,7 +458,7 @@ static inheritance_status zend_perform_covariant_type_check(
}
zend_type *single_type;
bool all_success = 1;
zend_bool all_success = 1;
/* First try to check whether we can succeed without resolving anything */
ZEND_TYPE_FOREACH(fe_type, single_type) {
@@ -540,7 +540,7 @@ static inheritance_status zend_do_perform_implementation_check(
{
uint32_t i, num_args, proto_num_args, fe_num_args;
inheritance_status status, local_status;
bool proto_is_variadic, fe_is_variadic;
zend_bool proto_is_variadic, fe_is_variadic;
/* Checks for constructors only if they are declared in an interface,
* or explicitly marked as abstract
@@ -833,7 +833,7 @@ static zend_always_inline inheritance_status do_inheritance_check_on_method_ex(
zend_function *child, zend_class_entry *child_scope,
zend_function *parent, zend_class_entry *parent_scope,
zend_class_entry *ce, zval *child_zv,
bool check_visibility, bool check_only, bool checked) /* {{{ */
zend_bool check_visibility, zend_bool check_only, zend_bool checked) /* {{{ */
{
uint32_t child_flags;
uint32_t parent_flags = parent->common.fn_flags;
@@ -943,12 +943,12 @@ static zend_always_inline inheritance_status do_inheritance_check_on_method_ex(
static zend_never_inline void do_inheritance_check_on_method(
zend_function *child, zend_class_entry *child_scope,
zend_function *parent, zend_class_entry *parent_scope,
zend_class_entry *ce, zval *child_zv, bool check_visibility)
zend_class_entry *ce, zval *child_zv, zend_bool check_visibility)
{
do_inheritance_check_on_method_ex(child, child_scope, parent, parent_scope, ce, child_zv, check_visibility, 0, 0);
}
static zend_always_inline void do_inherit_method(zend_string *key, zend_function *parent, zend_class_entry *ce, bool is_interface, bool checked) /* {{{ */
static zend_always_inline void do_inherit_method(zend_string *key, zend_function *parent, zend_class_entry *ce, zend_bool is_interface, zend_bool checked) /* {{{ */
{
zval *child = zend_hash_find_ex(&ce->function_table, key, 1);
@@ -1189,7 +1189,7 @@ void zend_build_properties_info_table(zend_class_entry *ce)
} ZEND_HASH_FOREACH_END();
}
ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *parent_ce, bool checked) /* {{{ */
ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *parent_ce, zend_bool checked) /* {{{ */
{
zend_property_info *property_info;
zend_function *func;
@@ -1412,7 +1412,7 @@ ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *par
}
/* }}} */
static bool do_inherit_constant_check(HashTable *child_constants_table, zend_class_constant *parent_constant, zend_string *name, const zend_class_entry *iface) /* {{{ */
static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zend_class_constant *parent_constant, zend_string *name, const zend_class_entry *iface) /* {{{ */
{
zval *zv = zend_hash_find_ex(child_constants_table, name, 1);
zend_class_constant *old_constant;
@@ -1549,13 +1549,11 @@ static void zend_do_implement_interfaces(zend_class_entry *ce, zend_class_entry
}
}
if (!(ce->ce_flags & ZEND_ACC_CACHED)) {
for (i = 0; i < ce->num_interfaces; i++) {
zend_string_release_ex(ce->interface_names[i].name, 0);
zend_string_release_ex(ce->interface_names[i].lc_name, 0);
}
efree(ce->interface_names);
for (i = 0; i < ce->num_interfaces; i++) {
zend_string_release_ex(ce->interface_names[i].name, 0);
zend_string_release_ex(ce->interface_names[i].lc_name, 0);
}
efree(ce->interface_names);
ce->num_interfaces = num_interfaces;
ce->interfaces = interfaces;
@@ -1878,6 +1876,9 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce, zend_class_e
}
aliases[i] = trait;
/* TODO: try to avoid this assignment (it's necessary only for reflection) */
cur_method_ref->class_name = zend_string_copy(trait->name);
}
zend_string_release_ex(lcname, 0);
i++;
@@ -1951,7 +1952,7 @@ static void zend_do_traits_property_binding(zend_class_entry *ce, zend_class_ent
zend_property_info *new_prop;
zend_string* prop_name;
const char* class_name_unused;
bool not_compatible;
zend_bool not_compatible;
zval* prop_value;
uint32_t flags;
zend_string *doc_comment;
@@ -2161,7 +2162,7 @@ void zend_verify_abstract_class(zend_class_entry *ce) /* {{{ */
{
zend_function *func;
zend_abstract_info ai;
bool is_explicit_abstract = (ce->ce_flags & ZEND_ACC_EXPLICIT_ABSTRACT_CLASS) != 0;
zend_bool is_explicit_abstract = (ce->ce_flags & ZEND_ACC_EXPLICIT_ABSTRACT_CLASS) != 0;
memset(&ai, 0, sizeof(ai));
ZEND_HASH_FOREACH_PTR(&ce->function_table, func) {
@@ -2539,7 +2540,7 @@ static inheritance_status zend_can_early_bind(zend_class_entry *ce, zend_class_e
}
/* }}} */
bool zend_try_early_bind(zend_class_entry *ce, zend_class_entry *parent_ce, zend_string *lcname, zval *delayed_early_binding) /* {{{ */
zend_bool zend_try_early_bind(zend_class_entry *ce, zend_class_entry *parent_ce, zend_string *lcname, zval *delayed_early_binding) /* {{{ */
{
inheritance_status status = zend_can_early_bind(ce, parent_ce);
+2 -2
View File
@@ -25,7 +25,7 @@
BEGIN_EXTERN_C()
ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface);
ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *parent_ce, bool checked);
ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *parent_ce, zend_bool checked);
#define zend_do_inheritance(ce, parent_ce) \
zend_do_inheritance_ex(ce, parent_ce, 0)
@@ -34,7 +34,7 @@ ZEND_API zend_result zend_do_link_class(zend_class_entry *ce, zend_string *lc_pa
void zend_verify_abstract_class(zend_class_entry *ce);
void zend_build_properties_info_table(zend_class_entry *ce);
bool zend_try_early_bind(zend_class_entry *ce, zend_class_entry *parent_ce, zend_string *lcname, zval *delayed_early_binding);
zend_bool zend_try_early_bind(zend_class_entry *ce, zend_class_entry *parent_ce, zend_string *lcname, zval *delayed_early_binding);
END_EXTERN_C()
Loaded 100 of 1210 files, more files were not shown because too many files have changed in this diff. Show more