Compare commits

..
263 Commits
Author SHA1 Message Date
Gabriel Caruso 94d96b3c97 Update versions for PHP 8.0.1 2021-01-05 13:50:36 +00:00
Gabriel Caruso 701e423288 Update NEWS for PHP 8.0.1 2021-01-05 13:50:31 +00:00
Christoph M. Becker b7f837381e Fix #77423: parse_url() will deliver a wrong host to user
To avoid that `parse_url()` returns an erroneous host, which would be
valid for `FILTER_VALIDATE_URL`, we make sure that only userinfo which
is valid according to RFC 3986 is treated as such.

For consistency with the existing url parsing code, we use ctype
functions, although that is not necessarily correct.

(cherry picked from commit b132da7f9d)
2021-01-05 10:30:56 -03:00
Gabriel Caruso b4b4a75afc Update NEWS for 8.0.2RC1 2020-12-15 13:01:18 +00:00
Gabriel Caruso 83e42955a3 Update NEWS for PHP 8.0.1RC1 2020-12-15 12:51:06 +00:00
Dmitry Stogov de78786566 Optimize out result value of ASSIGN, ASSIGN_OP and INC/DEC opcodes, if possible. 2020-12-15 14:30:58 +03:00
Christoph M. Becker c2fbab392c Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #77322: PharData::addEmptyDir('/') Possible integer overflow
2020-12-15 11:46:28 +01:00
Christoph M. Becker a53d67ceac Fix #77322: PharData::addEmptyDir('/') Possible integer overflow
`phar_path_check()` already strips a leading slash, so we must not
attempt to strip the trailing slash from an now empty directory name.

Closes GH-6508.
2020-12-15 11:44:53 +01:00
Christoph M. Becker 305500a3b1 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  7.3.27 is next
2020-12-15 11:32:10 +01:00
Christoph M. Becker c0a1c2c5ee Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  7.3.27 is next
2020-12-15 11:30:46 +01:00
Christoph M. Becker 40d9e3ab86 7.3.27 is next 2020-12-15 11:28:01 +01:00
Ayesh Karunaratne 724e241c9d JIT: Update invalid opcache.jit INI value message to include "tracing" and "function" values
`opcache.jit` accepts `tracing` and `function` as aliases, but they were not mentioned in the start-up INI warning message.
This updates the error message to include all possible values.

Closes GH-6490.
2020-12-15 10:18:33 +01:00
Nikita Popov b6d043aae2 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  IBM i PASE doesn't support ITIMER_PROF
2020-12-15 10:15:47 +01:00
Calvin Buckley 54248b18fe IBM i PASE doesn't support ITIMER_PROF
Like Cygwin, this platform needs to use a real-time timer.

This was based on a patch by @kadler, but it didn't handle unsetting
the timer, so the timeout would continue to be active, triggering
`hard_timeout` unexpectedly. The patch is fixed to handle unsetting.

Closes GH-6503.
2020-12-15 10:15:28 +01:00
David Carlier 1e6c7e776c JIT disabled build fix.
Closes GH-6514.
2020-12-15 09:51:16 +01:00
Christoph M. Becker 2e974c8c81 Add Windows support for OCI 19
As requested by Christopher Jones.
2020-12-14 23:11:04 +01:00
Christoph M. Becker 15d9c42070 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Drop pdo_mysql_prepare_load_data.phpt
2020-12-14 18:27:53 +01:00
Christoph M. Becker 10c9d615de Drop pdo_mysql_prepare_load_data.phpt
Like the test title and some comments in this test describe, this test
was supposed to have `::prepare()` failing because `LOAD DATA INFILE`
would not be supported as prepared statement, and then the test checks
whether follow-up queries would succeed.  However, `LOAD DATA INFILE`
is supported for prepared statements at least on Windows with mysqlnd,
so the test does no longer test what it is supposed to do.  Therefore,
we drop it.

Closes GH-6509.
2020-12-14 18:26:12 +01:00
Dmitry Stogov b3377028dc Remove unused flag 2020-12-14 15:29:21 +03:00
Dmitry Stogov 66e390707c Fixed bug #80506 (Immediate SIGSEGV upon ini_set("opcache.jit_debug", 1)) 2020-12-14 15:28:03 +03:00
Dmitry Stogov a12e7affd7 Fixed bug #80506 (Immediate SIGSEGV upon ini_set("opcache.jit_debug", 1)) 2020-12-14 15:26:11 +03:00
Jakub Zelenka d254078020 Merge branch 'PHP-7.4' into PHP-8.0 2020-12-13 18:42:11 +00:00
Jakub Zelenka a221e17b41 Fix bug #69625: FPM returns 200 status on request without SCRIPT_FILENAME 2020-12-13 18:39:48 +00:00
ekinhbayar b0e858da8b Remove bug41347.phpt as the error cases are already tested
Closes GH-6506.
2020-12-11 16:47:40 +01:00
Nikita Popov ccb7f1c7d8 Fixed bug #79132
Following cmb's suggestion and replacing the counter with a check
against the bound_params HT, which ensures that both cannot go
out of sync.
2020-12-11 16:35:03 +01:00
Nikita Popov 7a89157f8c PDO MySQL: Fix nextRowset() on libmysqlclient with native PS
The logic after next_result should match the one after execute.
This was the case for mysqlnd but not libmysqlclient, which used
the non-PS logic.
2020-12-11 14:48:44 +01:00
Nikita Popov 81f012a164 PDO MySQL: Don't skip two LOCAL_INFILE tests with libmysqlclient 2020-12-11 14:48:43 +01:00
Nikita Popov e4e88bd7e3 PDO MySQL: Unskip bug_41125.phpt
This test was always skipped (leftover debug statement?)

Contrary to the comments in the test and the test expectation,
this actually works fine.
2020-12-11 13:04:20 +01:00
Nikita Popov ad8eb116d8 Fixed bug #67004
Repeated execute() with native PS failed to release the previous
result set on libmysqlclient.

Move freeing the result set into a common location.
2020-12-11 12:52:59 +01:00
Nikita Popov d6b4b82a38 PDO MySQL: Use stmt_next_result with libmysqlclient as well
libmysqlclient added this function in version 5.5, which happens
to be the minimum we support. If we have a prepared statement,
we should use it on both mysqlnd and libmysqlclient, even if the
handling afterwards is different.

This fixes error handling with native prepared statements.
2020-12-11 12:20:04 +01:00
Nikita Popov 4e51059d52 PDO MySQL: Fix libmysql option test
The fact that getAttribute() fails for various libmysqlclient-only
options is a known issue, and the test was taking that into account.
However, the change of the default error mode broke the handling.
We need to handle the exceptions now.
2020-12-11 12:20:02 +01:00
Nikita Popov 43741a3f26 Fixed bug #62889
Our minimum libmysqlclient version requirement is high enough
that we don't need to check for MYSQL_OPT_LOCAL_INFILE support.

However, the mysql_get_option() function seems to only be available
since 5.7 (though it's really hard to find any definitie information
on when MySQL introduced certain functions or changes...) so we
need to store the value of the flag locally to make it available
through getAttribute().
2020-12-11 11:25:36 +01:00
Nikita Popov c927c831e6 PDO MySQL: Fix leak with libmysqlclient and multiple rowsets
stmt->column_count gets reset before the next_rowset handler is
invoked, so we need to fetch the value from the result set instead.

Arguably PDO should be separating the destruction of the previous
result set and the switch to the next result set more cleanly...
2020-12-11 10:51:14 +01:00
Dharman 54a63d91b8 Fix test cases for MariaDB
And remove unnecessary try-catch.

Closes GH-6505.
2020-12-11 09:53:20 +01:00
Nikita Popov 9e3ba775b7 Fixed bug #72368
Generate a param count mismatch error even if the query contains
no placeholders.

Additionally we shouldn't HANDLE errors from pdo_parse_params,
which are always reported via raise_impl_error. Doing so results
in duplicate error messages.
2020-12-10 16:53:08 +01:00
Nikita Popov a5527577e7 Allow drivers to omit error code
And thus generate error messages that match what PDO emulation
would generate.

This fixes the error message regression from the previous commit.
2020-12-10 16:04:33 +01:00
Nikita Popov 15b51a215a Fixed bug #79131
When a driver reports an error during EVT_ALLOC (and some over EVTs),
make sure we handle it as usual, i.e. warn or throw.

This requires some adjustments in PDO PgSQL to stop manually doing
this through an impl error.

Unfortunately the PDO PgSQL error messages regress because of this,
as they now include a completely arbitrary error code. There doesn't
seem to be an ability to skip it right now.
2020-12-10 15:53:23 +01:00
Dmitry Stogov dde5572937 Eliminate some repeatable IS_REFERENCE checks 2020-12-10 14:45:54 +03:00
Nikita Popov 288581fade Fixed bug #79872 by improving error message
The actual behavior here is correct, but the previous error
message was misleading, as neither fetchAll() nor buffered queries
would help in this situation. Instead it is necessary to consume
all rowsets, which can be done by either unsetting the statement
or calling closeCursor().
2020-12-10 11:46:29 +01:00
Nikita Popov d63aedd173 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #76815
2020-12-10 11:24:19 +01:00
Nikita Popov e450621f5e Fixed bug #76815
When we receive an error while reading a result set, we should
assume that no more result sets are available. libmysqlclient
implements the same behavior.
2020-12-10 11:23:41 +01:00
Nikita Popov 9b678bc4d5 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #71145
2020-12-10 10:31:36 +01:00
Nikita Popov 4922049213 Fixed bug #71145
Consume any additional result sets when running INIT_COMMAND.
2020-12-10 10:28:10 +01:00
twosee 26c7b9402d EXTERN_C wrapping for GC buffer APIs
Closes GH-6502.
2020-12-10 17:15:19 +08:00
Nikita Popov c95680d4b7 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Backport fix for bug #70066
2020-12-10 10:05:38 +01:00
Nikita Popov f3d5877845 Backport fix for bug #70066
Given the number of duplicates this bug report had, it seems
worthwhile to fix this on PHP-7.4 as well.

Cherry-pick of 106e7e4bca.
2020-12-10 09:58:47 +01:00
Dmitry Stogov e9f9e9f863 Perform early guard type check for result of FETCH_CONSTANT 2020-12-09 22:24:03 +03:00
Nikita Popov 106e7e4bca Fixed bug #70066
If we fall back to emulated prepared statements, destroy S->stmt,
so the code doesn't get confused about which mode we're in.
2020-12-09 17:24:30 +01:00
Nikita Popov fcfa7fd06b Fixed bug #66878
Keep track of whether we have fully consumed all result sets,
either using nextRowset() calls or closeCursor() and skip the
attempt to consume remaining results sets during destruction in
that case.

Especiall if closeCursor() has been used, we really shouldn't
have this sort of cross-statement inference.
2020-12-09 16:38:22 +01:00
Nikita Popov ef342b0730 Remove unnecessary more_results() checks
Just calling next_result() is sufficient.
2020-12-09 16:16:17 +01:00
Nikita Popov a073b0218c Add ifdef for mysqlnd only function 2020-12-09 16:16:17 +01:00
Nikita Popov b9ea8d6b96 PDO MySQL: Extract common code for handling PS results 2020-12-09 15:28:16 +01:00
Nikita Popov fb69c7752d PDO MySQL: Use set_row_count() helper 2020-12-09 15:21:12 +01:00
Dmitry Stogov 8d268e8443 Fixed IS_32BIT/IS_SIGNED_32BIT mess 2020-12-09 17:16:54 +03:00
Nikita Popov 186b766368 PDO MySQL: Make sure nextRowset() works with partially consumed result
This was already working in all cases apart from native prepared
statements with unbuffered queries. In that case invoking
stmt_free_result() addresses the issue.
2020-12-09 14:46:49 +01:00
Nikita Popov 23193e89e4 PDO MySQL: Handle error during closeCursor() 2020-12-09 14:04:30 +01:00
Nikita Popov 71b5f1446e Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #78154
2020-12-09 12:47:34 +01:00
Nikita Popov 44b234a9bc Fixed bug #78154
Handle errors during next_result in exec.
2020-12-09 12:46:47 +01:00
Nikita Popov 18517e7a63 Fix stmt_free_result implementation and usage
Two bugs both affecting the bug_pecl_7976.phpt test ("works with
mysqlnd" haha):

 * We should not change the connection state in stmt_free_result.
   This makes mysql_stmt_free_result usable under mysqlnd and
   not just libmysqlclient.
 * If we call mysql_stmt_free_result, we still need to consume
   any outstanding result sets.
2020-12-09 11:13:48 +01:00
Nikita Popov 9c0712d2cd Make XFAILED test less broken
At least allow it to print some output rather than throw right
away...
2020-12-09 10:42:44 +01:00
Nikita Popov 311a77d08e Handle changing column count in mysqlnd result binding
If the count changes from prepare to execute and result_bind is
alreadly allocated, reallocate it there.

This is something of a hack. It would be cleaner to require that
result bindings are registered only after execute, when the final
result set fields are known. But mysqli at least directly exposes
this to the user, so we have no guarantee.
2020-12-09 10:30:23 +01:00
Nikita Popov 2df09b9b64 PDO MySQL: Normalize handling of empty stored procedure result set
MySQL always returns a trailing empty result set for stored
procedure calls, which is used to convey status information.
The PDO MySQL implementation is presently confused about what to
do with it: If mysqlnd is used and native prepared statements are
used, this result set is skipped. In all other cases it is not
skipped. We also have quite a few XFAILed tests relating to this.

This patch normalizes (for PHP-8.0 only) the behavior towards
always retaining the empty result set. This is simply how MySQL
stored procedures work (some expletives omitted here) and we can't
distinguish this "useless" result set from an empty result of a
multi query. Multi queries are not a concern for native prepared
statements, as PDO does not allow them in that case, but they are
a concern for emulated prepared statements.

Closes GH-6497.
2020-12-08 17:01:56 +01:00
Nikita Popov bfa69d27bc Handle column count change in PDO MySQL
This has been fixed for PDO SQlite by GH-4313, however the same
issue also applied to PDO MySQL.

Move the column count setting function into the main PDO layer
(and export it) and then use it in both PDO SQLite and PDO MySQL.
2020-12-08 16:41:35 +01:00
Nikita Popov 713ef8511b Enable XFAILed test
This one had a rather scary XFAIL message, but seems to work just
fine...
2020-12-08 16:03:50 +01:00
Christoph M. Becker fb4bc0f9e5 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #48725: Support for flushing in zlib stream
2020-12-08 12:24:49 +01:00
Christoph M. Becker 20e75329f2 Fix #48725: Support for flushing in zlib stream
When `php_zlib_deflate_filter()` is called with `PSFS_FLAG_FLUSH_INC`
but without new buckets being available (e.g. because a user calls
`rewind()` after writing to the stream), we have to make sure that any
pending data are flushed.  This could basically be done like in the
attached patch[1], but that could cause unnessary flushes, which can be
harmful for compression, and adds unnecessary flush markers to the
stream.  Thus, we use the `php_zlib_filter_data.finished` field, which
has not been used for `zlib.deflate` filters, and properly keep track
of the need to flush.

[1] <https://bugs.php.net/patch-display.php?bug_id=48725&patch=zlib-filter-flush-fix.patch&revision=latest>

Closes GH-6019.
2020-12-08 12:23:24 +01:00
Christoph M. Becker d6ae0f010e Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #77069: stream filter loses final block of data
2020-12-08 11:49:28 +01:00
Christoph M. Becker 65f5573bc8 Fix #77069: stream filter loses final block of data
Reading from a stream may return greater than zero, but nonetheless the
stream's EOF flag may have been set.  We have to cater to this
condition by setting the close flag for filters.

We also have to cater to that change in the zlib.inflate filter:

If `inflate()` is called with flush mode `Z_FINISH`, but the output
buffer is not large enough to inflate all available data, it fails with
`Z_BUF_ERROR`.  However, `Z_BUF_ERROR` is not fatal; in fact, the zlib
manual states: "If deflate returns with Z_OK or Z_BUF_ERROR, this
function must be called again with Z_FINISH and more output space
(updated avail_out) but no more input data, until it returns with
Z_STREAM_END or an error."  Hence, we do so.

Closes GH-6001.
2020-12-08 11:47:49 +01:00
Christoph M. Becker c3734f9ae1 ldap_exop_whoami() does not return TRUE
Closes GH-6496.
2020-12-08 11:44:04 +01:00
Nikita Popov bd72e4aa44 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #63185
2020-12-08 11:35:57 +01:00
Nikita Popov bd093ad861 Fixed bug #63185 2020-12-08 11:30:54 +01:00
Dmitry Stogov db34491a62 Avoid unnecessary checks 2020-12-08 13:10:35 +03:00
Nikita Popov 2d467abc46 Fix another typed resource issue in unserialization
We also need to discard old entries in the ref_props HT when values
are overwritten.

We should really forbid these kinds of overwrites. I believe they
can only occur in manually crafted serialization strings, and
cause so many problems...

Fixes oss-fuzz #28257.
2020-12-07 12:36:09 +01:00
Dmitry Stogov 7971602574 Fixed bug #80480 (Segmentation fault with JIT enabled) 2020-12-07 13:28:37 +03:00
Nikita Popov 9dc42b4114 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80458
2020-12-04 17:00:51 +01:00
Dharman a83cc03c13 Fixed bug #80458
If there is no result set (e.g. for upsert queries), still allow
fetching to occur without error, i.e. treat it the same way as
an empty result set.

This normalizes behavior between native and emulated prepared
statements and addresses a regression in PHP 7.4.13.
2020-12-04 16:59:47 +01:00
Christoph M. Becker b52db133df Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #75102: `PharData` says invalid checksum for valid tar
2020-12-04 13:04:33 +01:00
Christoph M. Becker 8588ae7215 Fix #75102: PharData says invalid checksum for valid tar
Apparently, there are broken tarballs out there which are actually in
ustar format, but did not write the `ustar` marker.  Since popular tar
tools like GNU tar and 7zip have no issues dealing with such tarballs,
Phar should also be more resilient.

Thus, when the first checksum check of a tarball in (presumed) in old-
style format fails, we check whether the checksum would be suitable for
ustar format; if so, we treat the tarball as being in ustar format.

Closes GH-6479.
2020-12-04 13:02:29 +01:00
Nikita Popov 77325c4448 Fix removal of type source during unserialization
Missed a check for info in this code. Add it, and add an assertion
in type source removal to make it easier to catch this issue.

Fixes oss-fuzz #28208 and #28257.
2020-12-04 12:56:05 +01:00
George Peter Banyard 426fe2f20c Standardize behaviour for int message number between functions 2020-12-03 17:43:08 +00:00
George Peter Banyard e45cc31c41 Add tests for passing a UID instead of a message number 2020-12-03 16:38:22 +00:00
Nikita Popov 724ee93ce6 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Upload coverage data to codecov.io
2020-12-03 12:05:14 +01:00
Paul Crovella 8f8e6f95af Upload coverage data to codecov.io
Closes GH-6486.
2020-12-03 12:04:50 +01:00
Nikita Popov 1a1eeee716 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix mysqli_expire_password test for mariadb
2020-12-03 11:02:11 +01:00
Nikita Popov 0f6c41c6f8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix mysqli_expire_password test for mariadb
2020-12-03 11:01:57 +01:00
Daniel Black 0697a64f7e Fix mysqli_expire_password test for mariadb
In MariaDB-10.4.3 EXPIRE passwords where supported for
MariaDB. This only behaves like MySQL when the system
variable disconnect_on_expired_passwords=1.

MariaDB if there was no password it could not be considered
expired. So the test is adjusted to use actual passwords.
(MariaDB commit a94b20a8e0d9e64eeaabdaaa7a3e03fcdb8a686e)

The error codes produced my MariaDB are different
however still conforming to the SQL specification.

Closes GH-6480.
2020-12-03 10:56:00 +01:00
Nikita Popov 98cccd304a Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  fix mysqli_stmt_get_result_metadata_fetch_field test for mariadb
2020-12-03 10:45:27 +01:00
Daniel Black 5d5c1cea5f fix mysqli_stmt_get_result_metadata_fetch_field test for mariadb
MariaDB extended the default decimal field to 39 characters
instead of MySQL's 31 characters.

This small change allows the test to pass on MySQL and MariaDB.

Closes GH-6484.
2020-12-03 10:45:11 +01:00
Dharman 261faa62da Remove PHP 5 mysqli tests
These tests all require functions that no longer exist.
2020-12-03 10:42:46 +01:00
Dharman 53f7bddbeb Fix typos in mysql tests
%d because of line endings on Windows
2020-12-03 10:42:39 +01:00
Nikita Popov 8d2a1c8966 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Backport fix for bug #78750
2020-12-03 10:22:21 +01:00
Peter Kokot d386ed1e6b Backport fix for bug #78750
Cherry-picks
fe2afef36f
and
86e2b7bb70.
2020-12-03 10:07:09 +01:00
Christian Schneider 7bc7a80445 Make is_file() and friends return false when path contains 0-byte
These functions now return false silently:
is_writable, is_readable, is_executable, is_file, is_dir, is_link,
file_exists

These functions now throw a warning an return false (rather than
throwing a ValueError):
fileperms, fileinode, filesize, fileowner, filegroup, filetype,
fileatime, filemtime, filectime, lstat, stat

See also https://externals.io/message/112333.

Closes GH-6478.
2020-12-03 09:43:15 +01:00
Christoph M. Becker 72cd5793be Fix failing VirtualProtect() calls
Whenever JIT is disabled due to incompatibilities, we also need to set
`JIT_G(on)` to zero.

Closes GH-6470.
2020-12-02 16:51:50 +01:00
Nikita Popov 9dda22bd1e Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80457
2020-12-02 11:29:41 +01:00
Nikita Popov f2833ca1be Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #80457
2020-12-02 11:29:06 +01:00
Nikita Popov d6fcaf5da4 Fixed bug #80457
On x32 sizeof(size_t) != sizeof(zend_long), so we need to be
careful with sign extension here.

Patch by bruno dot premont at restena dot lu.
2020-12-02 11:26:10 +01:00
Nikita Popov a89aaf6c38 Don't throw from imagecreatefromstring() with too short string
If the string is too short, we should treat this the same way as
an unrecognized image type. This function should be usable to
determine whether something is a valid image without doing any
checks beforehand.
2020-12-02 10:51:55 +01:00
Nikita Popov 7a61984a2b Fixed bug #80462 2020-12-02 10:19:32 +01:00
George Peter Banyard 5aaffc8095 Backport IMAP test modernization to PHP-8.0 branch
Closes GH-6476
2020-12-01 16:38:08 +00:00
Christoph M. Becker 83cf4aa13a Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #73809: Phar Zip parse crash - mmap fail
2020-12-01 17:00:27 +01:00
Christoph M. Becker c283f53b24 Fix #73809: Phar Zip parse crash - mmap fail
Phar signatures practically are of limited size; for the MD5 and SHA
hashes the size is fixed (at most 64 bytes for SHA512); for OpenSSL
public keys there is no size limit in theory, but "64 KiB ought to be
good enough for anybody".  So we check for that limit, to avoid fatal
errors due to out of memory conditions.

Since it is neither possible to have the signature compressed in the
ZIP archive, nor is it possible to manually add a signature via Phar,
we use ZipArchive to create a suitable archive for the test on the fly.

Closes GH-6474.
2020-12-01 16:58:19 +01:00
Dmitry Stogov 44475e70e2 Fixed bug #80447 (Strange out of memory error when running with JIT) 2020-12-01 16:46:41 +03:00
Dmitry Stogov 1674c96c0b Bug #80447 (Strange out of memory error when running with JIT) 2020-12-01 16:43:05 +03:00
Dmitry Stogov 8ad2b59e12 Disable stack reuse optimization for x86 PIC code. It may clobber local variable used for Global Offset Table. 2020-12-01 15:20:06 +03:00
Nikita Popov f06afc434a Don't use scope when validating Attribute
This is not safe to do at this point. Even if we made it safe,
we'd see inconsistencies due to a partially compiled class.

Fixes oss-fuzz #28129.
2020-12-01 11:49:27 +01:00
Nikita Popov 5dfec886d6 Fix use after free with file cache and arena allocated strings 2020-12-01 11:31:23 +01:00
Nikita Popov 648cda6c9f Don't mark cpu_supports functions as always inline
The use of no-sanitize may result in an inlining failure, which
will be promoted into a compile error by always-inline. Use a
normal inlining hint without enforcing it.
2020-12-01 10:22:36 +01:00
Dmitry Stogov 4959c60524 Fixed incorrect "skipif.inc" include 2020-12-01 11:34:09 +03:00
Dmitry Stogov 31eafedf2e Skip test if JIT is not available 2020-12-01 09:58:33 +03:00
Christoph M. Becker f1d11c118d Fix #62004: SplFileObject: fgets after seek returns wrong line
As it is, `::seek(0)` sets the file pointer to the beginning of the
file, but `::seek($n)` where `$n > 0` sets the file pointer to the
beginning of the following line, having line `$n` already read into the
line buffer.  This is pretty inconsistent; we fix it by always seeking
to the beginning of the line.

We also add a test case for the duplicate bug #46569.

Closes GH-6434.
2020-11-30 16:03:37 +01:00
Dmitry Stogov 841b00f641 Preallocate stack space for JIT in execute_ex() to eliminate JIT prologue/epilogue. 2020-11-30 17:56:08 +03:00
Dmitry Stogov 5f36d0497f Fixed "may be used uninitialized" compilation warnings 2020-11-30 17:46:43 +03:00
Christoph M. Becker 57463cf78b Drop all JIT related XFAILS from phpdbg test suite
phpdbg now disables JIT, so these cause XFAIL warnings.
2020-11-30 15:24:15 +01:00
Nikita Popov 32cd5a1bc8 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Next attempt to fix bug #80368
2020-11-30 15:17:27 +01:00
Nikita Popov ecee3f1209 Next attempt to fix bug #80368
Apparently treating LibreSSL as OpenSSL 1.1 is not just something
we did in our code, it's something that upstream LibreSSL claims,
despite not actually being compatible. Duh.

Check for EVP_CIPH_OCB_MODE instead, which should reliably
determine support...
2020-11-30 15:15:59 +01:00
George Peter Banyard 0076b47326 Fix Bug #80438: imap_msgno() incorrectly warns and return false on valid UIDs in PHP 8.0.0
Checking for a valid Unique ID (UID) cannot use the convenience macro as they might
be larger than the message number which has for maximum value the total number of
current messages available in the mailbox.
2020-11-30 14:08:31 +00:00
George Peter Banyard a55402d07c Rename XmlParser to XMLParser for consistency with XMLWriter/XMLReader 2020-11-30 14:08:31 +00:00
Nikita Popov 24a19cc232 Suppress stream errors in mysqlnd
mysqlnd currently sets error_reporting=0 to suppress errors while
writing to streams. Unfortunately these errors are still visible
to userland error handlers, which is a source of confusion.
See for example https://bugs.php.net/bug.php?id=80412.

Instead add a stream flag that suppresses the emission of
read/write errors in the first place, and set it in mysqlnd.

I think it might be useful to have this option for userland as
well in the future, but for now this is just an internal
mechanism.

Closes GH-6458.
2020-11-30 15:06:28 +01:00
Dmitry Stogov a0baa09b99 Hide phpdbg/JIT incompatibility macro (JIT is disabled for phpdbg) 2020-11-30 16:42:17 +03:00
Nikita Popov 4643c0aac5 Add additional entries to unserialize corpus
These are useful to seed typed property fuzzing.
2020-11-30 14:32:07 +01:00
Nikita Popov ed9532cff0 Fix another ref source management bug in unserialize
When we overwrite an existing property during unserialization,
we also have to drop the ref source from it.
2020-11-30 14:23:54 +01:00
Christoph M. Becker 666833b238 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #76813: Access violation near NULL on source operand
2020-11-30 12:33:13 +01:00
Christoph M. Becker 5e15c9c41f Fix #76813: Access violation near NULL on source operand
We avoid `YYCURSOR` becoming `NULL` by initializing `YYMARKER`, and add
a default rule for `<NORMAL>` where we catch unexpected input.

We also fix the only superficially related issue regarding empty input
followed by `T_SEPARATOR` and command, which caused another segfault.

Closes GH-6464.
2020-11-30 12:29:24 +01:00
Dmitry Stogov d5a82e2c4e Disable JIT with incompatible third-party extensions 2020-11-30 13:58:34 +03:00
Nikita Popov 15073d8e1d Fixed bug #80437
Only chmod if the file has been created.
2020-11-30 11:40:46 +01:00
Nikita Popov fdb05b92bf Only replace IN_ARRAY result type for JMPZ/JMPNZ
Replacing the result type in the general case is dangerous,
because not all opcodes support both VAR and TMP. One common case
is the in_array() result being passed to SEND_VAR, which would
have to be changed to SEND_VAL.

Rather than complicating this logic, reduce the scope to only
doing the type replacement for JMPZ and JMPNZ. The only reason
we're doing this in the first place is to enable the smart branch
optimization, so we can limit it to the relevant opcodes. Replacing
the result type may be marginally useful in other cases as well
(as it may avoid reference checks), but not worth the bother.
2020-11-30 11:18:21 +01:00
Nikita Popov e77ac88a44 Use ephemeral ports in mcast_ipv*_recv.phpt 2020-11-30 09:49:39 +01:00
Christoph M. Becker 44ccccdfb8 tidy::repairFile() and ::repairString() return string|false 2020-11-30 00:29:10 +01:00
Nikita Popov 5b3809e942 Respect strict_types during sccp function call evaluation
Similar to what we do with attributes, add a dummy call frame
on which we can set the strict_types flag.
2020-11-27 20:24:00 +01:00
Nikita Popov 0ce9b5f755 Don't check for throwing calls in sccp function evaluation
We only need to reject functions that could warn (or have runtime
dependent behavior). If a function can throw in some cases, just
let it and discard the result.
2020-11-27 17:49:51 +01:00
Nikita Popov a505fc627e Fix handling of sccp exceptions
We should clear the exception *before* we destroy the execute_data.
Add a variation of the test that indirects through another file,
and would crash otherwise.
2020-11-27 17:44:30 +01:00
Jakub Zelenka a87d620543 Merge branch 'PHP-7.4' into PHP-8.0 2020-11-27 16:35:16 +00:00
Jakub Zelenka b855907f54 Merge branch 'PHP-7.3' into PHP-7.4 2020-11-27 16:33:47 +00:00
Jakub Zelenka 685708160e Fix test for bug62890 to not depend on system cert store 2020-11-27 16:32:43 +00:00
Nikita Popov 08919578ca Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix build for non-x86
2020-11-27 17:04:50 +01:00
Nikita Popov 3430d856ac Fix build for non-x86 2020-11-27 17:04:17 +01:00
Nikita Popov e5aae35855 Handle exceptions during SCCP function evaluation
Easier to handle them than to ensure they can't happen in the
first place.
2020-11-27 17:00:12 +01:00
Nikita Popov 4f3cf983dc Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix AVX detection
2020-11-27 14:49:45 +01:00
Nikita Popov 4e30ab33d8 Fix AVX detection
Our CPU detection code currently only checks whether hardware
support for AVX exists. However, we also need to check for operating
system support for XSAVE, as well as whether XCR0 has the SSE and
AVX bits set.

If this is not the case, unset the AVX and AVX2 bits in the cpuinfo
structure.

Hopefully this resolves our issues with CPU support detection.

Closes GH-6460.
2020-11-27 14:49:31 +01:00
Nikita Popov 8b281e5b6b Only use travis for cron jobs
Our primary CI has been Azure Pipelines for a while now already.
Travis was primarily retained as a) a fast feedback builder and
b) to test architectures not available elsewhere.

Due to Travis CI open source policy changes, Travis is no longer
useful as a fast feedback builder. As such, only use it for cron
job builds.
2020-11-27 14:15:34 +01:00
Nikita Popov 8e25cf26af Make sure zend_cpu_supports_pclmul() is always defined
If __builtin_cpu_supports() is available, but doesn't have support
for pclmul, the function would end up not being defined at all.
2020-11-27 12:22:03 +01:00
Christoph M. Becker bcefbf8602 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix mysqli_get_client_stats test
2020-11-27 11:51:30 +01:00
Christoph M. Becker 07c5efbd76 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix mysqli_get_client_stats test
2020-11-27 11:50:59 +01:00
Daniel Black 4a10037cb4 Fix mysqli_get_client_stats test
MySQL removed RENAME DATABASE in 18300001c1dbbfddf9a0adcbaeea68956102bdd0
(Sept 2007, 5.1.23). As this briefest existance is very insignificant lets remove it.

It also breaks when testing against MariaDB.

As the alternate path in this test covers all supported MySQL and MariaDB
versions and a signifant portion of unsupported versions lets keep it simple.

Closes GH-6459.
2020-11-27 11:43:34 +01:00
Nikita Popov 2772f7c3ad Avoid direct calls to zend_cpu_supports()
While the use of zend_cpu_supports_*() is only strictly necessary
inside ifunc resolvers, where the cpu state has not been initialized
yet, we should prefer the compiler builtins in all cases.
2020-11-27 11:18:10 +01:00
Nikita Popov f35b194029 Assert that cpuinfo is initialized before use
And fix some incorrect indentation.
2020-11-27 11:14:07 +01:00
Nikita Popov 4a7ebb6d83 Move avx check into a macro 2020-11-27 11:06:05 +01:00
Nikita Popov f4e1768e21 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80368
2020-11-27 10:58:34 +01:00
Nikita Popov 0f579fd7c8 Fixed bug #80368
We assume that usually LibreSSL supports everything OpenSSL 1.1 does.
In this instance, this is not the case.
2020-11-27 10:57:19 +01:00
Nikita Popov 48ff654fb9 Fixed bug #80433
Use ZEND_STRTOL to allow leading zeros in opcache.jit option.
2020-11-27 10:51:57 +01:00
Nikita Popov c61390cfb4 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80425
2020-11-27 10:03:21 +01:00
Nikita Popov 5240f8391f Fixed bug #80425
Rename the methods in MessageFormatAdapter to make sure they don't
clash with anything defined by icu itself, which may be a problem
if icu is linked statically.
2020-11-27 10:02:00 +01:00
Christopher Jones a9c44d1b5a Update PECL package release date 2020-11-27 10:17:37 +11:00
Christoph M. Becker 49e1ed1941 Fix bug number 2020-11-26 23:34:35 +01:00
Dmitry Stogov 3697648be5 Eliminate deafd stores 2020-11-26 21:05:07 +03:00
Nikita Popov 6132389d1c Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix bug #80402: Don't strip -lpthread
2020-11-26 11:56:00 +01:00
Nikita Popov ea372e7463 Fix bug #80402: Don't strip -lpthread
The current behavior has been introduced 20 years ago in
f9e375f493 as part of a larger change.
It's not clear to me why special treatement of -lpthread is necessary
here.
2020-11-26 11:54:20 +01:00
Sara Golemon c65f0c7aca Remove -dev from ZEND_VERSION 2020-11-26 02:19:51 +00:00
Nikita Popov 306555e11d Add UPGRADING note for PDO::inTransaction()
[ci skip]
2020-11-25 17:28:23 +01:00
Nikita Popov 217f247bb5 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80411
2020-11-25 17:24:49 +01:00
Nikita Popov 2fb12be84c Fixed bug #80411
References to null-serializations are stored as null, and as such
are part of the reference count.

Reminds me that we really need to deprecate the mess that is
Serializable.
2020-11-25 17:23:42 +01:00
Nikita Popov f5b93626a6 Fix unserialization ref source management, again
Handle one case the previous patch did not account for: If
unserialization of data fails, we should still register a ref
source.

Also add an extra test for a reference between two typed properties,
as this used to be handled incorrectly earlier.
2020-11-25 17:04:07 +01:00
Nikita Popov 518eb0ca2b Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed error reporting in mysqli_stmt::__construct
2020-11-25 16:29:00 +01:00
Dharman 233f507fe6 Fixed error reporting in mysqli_stmt::__construct
For the sake of simplicity, I've synchronized the implementation
with PHP 8, which means null values are also accepted.

Closes GH-6454.
2020-11-25 16:27:41 +01:00
Nikita Popov e3e6e1e59b Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Reindent more mysqli tests
2020-11-25 16:08:28 +01:00
Nikita Popov 367f8452c4 Fix phpt reindentation in tidy script
This was missing adjacent SKIPIF/FILE/CLEAN sections.
2020-11-25 16:07:56 +01:00
Nikita Popov e3e67b721f Reindent more mysqli tests
Due to a bug in the tidy script, most tests did not actually get
reindented...
2020-11-25 16:07:16 +01:00
Nikita Popov 308050e94b Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Reindent ext/mysqli tests
2020-11-25 15:58:21 +01:00
Nikita Popov 97d192b444 Reindent ext/mysqli tests
Reindent ext/mysqli tests on PHP-7.4, so they match with the
indentation on PHP-8.0. Otherwise merging test changes across
branches is very unpleasant.
2020-11-25 15:57:11 +01:00
Nikita Popov 373fd61a51 Allow running tidy.php on specific directory 2020-11-25 15:54:26 +01:00
Nikita Popov 7a3f25e370 Fix ref source management during unserialization
Only register the slot for adding ref sources later if we didn't
immediately register one. Also avoids leaking a ref source if
it is added early and the assignment fails.

Fixes oss-fuzz #27628.
2020-11-25 12:25:07 +01:00
Calvin Buckley e074e029ee sockets: Fix variable/macro name collision on AIX
The name "rem_size" is used by a macro in a system header on AIX,
specifically `sys/xmem.h`. Without changing the name, you get the
name mangled like so:

```
In file included from /usr/include/sys/uio.h:92:0,
                 from /QOpenSys/pkgs/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/include-fixed-7.1/sys/socket.h:83,
                 from /usr/include/sys/syslog.h:151,
                 from /usr/include/syslog.h:29,
                 from /home/calvin/rpmbuild/BUILD/php-8.0.0RC5/main/php_syslog.h:27,
                 from /home/calvin/rpmbuild/BUILD/php-8.0.0RC5/main/php.h:318,
                 from /home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c:17:
/home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c: In function 'zif_socket_cmsg_space':
/home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c:298:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   size_t rem_size = ZEND_LONG_MAX - entry->size;
          ^
/home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c:298:10: error: expected expression before '.' token
/home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c:299:18: error: 'u2' undeclared (first use in this function)
   size_t n_max = rem_size / entry->var_el_size;
                  ^
/home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c:299:18: note: each undeclared identifier is reported only once for each function it appears in
```

...because of the declaration in `sys/xmem.h`:

```
```

This just renames the variable so that it won't trip on this
definition. Tested to fix the build on IBM i PASE.

Closes GH-6453.
2020-11-25 11:54:40 +01:00
Nikita Popov 4633e70ab1 Fixed bug #80377
Make sure the $PHP_THREAD_SAFETY variable is always available
when configuring extensions. It was previously available for
phpized extensions, but for in-tree builds it was being set
too late.

Then, use $PHP_THREAD_SAFETY instead of $enable_zts to check for
ZTS in bundled extensions, which makes sure these checks also
work for phpize builds.
2020-11-25 11:47:05 +01:00
Christopher Jones 37f96d990c Fix test diff 2020-11-25 16:42:12 +11:00
Dmitry Stogov cb399d0410 Use diferent temporary register (%r0 may keep a method address) 2020-11-25 03:49:42 +03:00
Dmitry Stogov 7fc2a3e15e Revert "Fixed bug #80377"
This reverts commit fc26ad9b12.
2020-11-25 01:10:26 +03:00
Florian Engelhardt cdd5ec7a3c [ci skip] Fix misspelled method names
Closes GH-6452.
2020-11-24 18:18:40 +01:00
Nikita Popov 70f59b3416 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix usage of casted string in ReflectionParameter ctor
2020-11-24 16:42:52 +01:00
Nikita Popov 706241f82d Fix usage of casted string in ReflectionParameter ctor
Fixes oss-fuzz #27755.
2020-11-24 16:42:16 +01:00
Nikita Popov fc26ad9b12 Fixed bug #80377
Use $PHP_THREAD_SAFETY instead of $enable_zts to check for ZTS.
This variable is also available for phpize builds, while enable_zts
is only present for in-tree builds.
2020-11-24 15:52:41 +01:00
Nikita Popov ae6e56fb98 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80393
2020-11-24 15:27:43 +01:00
Nikita Popov d016434ad3 Fixed bug #80393
Handle macos versions that don't start with 10.* in libtool.

Patch by kir dot morozov at gmail dot com.
2020-11-24 15:26:40 +01:00
Christoph M. Becker bf244757ee Allow PHP_CURL_APIs to be imported by DLLs
Closes GH-6438.
2020-11-24 14:12:39 +01:00
Christoph M. Becker e589609b4c Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #77961: finfo_open crafted magic parsing SIGABRT
2020-11-24 14:06:53 +01:00
Christoph M. Becker 39f95f5614 Fix #77961: finfo_open crafted magic parsing SIGABRT
libmagic may abort the running process, which is not desirable for PHP;
we raise a fatal error instead.

Closes GH-6437.
2020-11-24 14:01:15 +01:00
Christoph M. Becker 337031abbd [ci skip] Update generate_patch.sh
This has apparently been forgotten when updating to libmagic 5.39.
2020-11-24 13:38:31 +01:00
Christoph M. Becker deb8b8190e Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80366: Return Value of zend_fstat() not Checked
2020-11-24 13:10:35 +01:00
Christoph M. Becker 5f9c82d514 Fix #80366: Return Value of zend_fstat() not Checked
In the somewhat unlikely case that `zend_fstat()` fails, we must not
proceed executing the function, but return `false` instead.

Patch based on the patch contributed by sagpant at microsoft dot com.

Closes GH-6432.
2020-11-24 13:09:16 +01:00
Nikita Popov b91bf22333 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80362: Running dtrace scripts can cause php to crash
2020-11-24 13:02:08 +01:00
Nikita Popov fa713ec17b Fixed bug #80362: Running dtrace scripts can cause php to crash
Patch by al at coralnet dot name.
2020-11-24 13:01:51 +01:00
Nikita Popov 03f8bccaf5 Fixed bug #80404
For a division like [1..1]/[2..2] produce [0..1] as a result, which
would be the integer envelope of the floating-point result.

The implementation is pretty ugly (we're now taking min/max across
eight values...) but I couldn't come up with a more elegant way
to handle this that doesn't make things a lot more complex (the
division sign handling is the annoying issue here).
2020-11-24 11:35:44 +01:00
Nikita Popov 912cb8b8b5 Fixed bug #80391
Iterable was not considered a subtype of array|object, and thus
also not a subtype of mixed.
2020-11-24 10:09:28 +01:00
Benjamin Morel 4bbb98c24f Fix PDOStatement::fetchObject() stub
Closes GH-6449.
2020-11-24 09:49:30 +01:00
Christopher Jones 68d5878097 Sync README with package.xml 2020-11-24 10:45:48 +11:00
Christoph M. Becker 807775b641 Fix COMPersistHelper::__construct() stub
`$variant` is optional.
2020-11-24 00:23:29 +01:00
Remi Collet ce18899b44 zip extension is 1.19.2 2020-11-23 15:59:15 +01:00
Dmitry Stogov 337d2af6ca zend_jit_trace_stack_frame.stack can't be NULL 2020-11-23 16:19:22 +03:00
Dmitry Stogov 586ccfdfd5 Fixed use-after-free in PHPUnit tests 2020-11-23 14:42:38 +03:00
Dmitry Stogov 4cf3da7383 Keep value of register before possible side exit 2020-11-23 12:07:05 +03:00
Christoph M. Becker 9b1c02c2df Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #77594: ob_tidyhandler is never reset
2020-11-22 14:04:59 +01:00
Christoph M. Becker 221345a013 Fix #77594: ob_tidyhandler is never reset
We reset to original INI value on request shutdown.

Closes GH-6425.
2020-11-22 14:02:29 +01:00
Máté Kocsis 40ebfd6730 Remove some incorrect mixed parameter types 2020-11-21 23:17:35 +01:00
Nikita Popov 0dac69c059 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix typos in php.ini files
2020-11-20 16:50:52 +01:00
Benjamin Morel ed949a1973 Fix typos in php.ini files
Closes GH-6441.

[ci skip]
2020-11-20 16:50:29 +01:00
jrfnl 860f46e2f5 UPGRADING: (real) cast has been removed
.. but the removal wasn't mentioned in the `UPGRADING` docs yet.

Ref:
* https://github.com/php/php-src/pull/5220
* https://github.com/php/php-src/commit/c9db32271a8083721582c5ec1dd09c4d4f562c74

Closes GH-6440.

[ci-skip]
2020-11-20 16:48:32 +01:00
Nikita Popov fa67864c13 Use MIN/MAX when dumping RANGE[]
It's very common that one of the bounds is LONG_MIN or LONG_MAX.
Dump them as MIN/MAX instead of the int representation in that
case, as it makes the dump less noisy.
2020-11-20 16:47:46 +01:00
Dmitry Stogov c0d1dbcb43 Fixed incorrect TRACE_FRAME_MASK_NESTED flag setting 2020-11-20 18:22:21 +03:00
Dmitry Stogov c8df28d276 Fixed 32-bit JIT 2020-11-20 15:12:30 +03:00
Christoph M. Becker c7343510e4 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #72964: White space not unfolded for CC/Bcc headers
2020-11-19 19:26:56 +01:00
Christoph M. Becker 881e43a03c Fix #72964: White space not unfolded for CC/Bcc headers
`\r\n` does only terminate a header, if not followed by `\t` or ` `.
We have to cater to that when determining the end position of the
respective headers.

Closes GH-6420.
2020-11-19 19:25:03 +01:00
Christoph M. Becker 2e27bb8682 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80345: PHPIZE configuration has outdated PHP_RELEASE_VERSION
2020-11-19 16:26:45 +01:00
Christoph M. Becker c2b1182879 Fix #80345: PHPIZE configuration has outdated PHP_RELEASE_VERSION
We must not redefine the version "constants" for phpize builds, because
these have already generated in phpize.js, from where we pass these
variables forward to configure.js.

We also add `PHP_EXTRA_VERSION` and `PHP_VERSION_STRING` to the files
for completeness.

Closes GH-6419.
2020-11-19 16:23:20 +01:00
Sara Golemon 3c44e9c080 8.0 branch should be prepping for 8.0.1 2020-11-19 14:37:44 +00:00
Sara Golemon 85c6e9b469 Prepare NEWS file for GA 2020-11-19 14:33:56 +00:00
Dmitry Stogov 069f9cbaa5 Added missing deoptimization code for trampoline handling 2020-11-19 12:32:36 +03:00
Nikita Popov 46b9e0c874 Export zend_is_callable_at_frame
Export the zend_is_callable_impl() function as
zend_is_callable_at_frame() for use by extension. As twose pointed
out, an extension may want to retrieve fcc for a private method.
2020-11-19 10:29:32 +01:00
Nikita Popov 06c4a501fd Fix curl_multi_getcontent() parameter name
While the function name starts with curl_multi_*, the function
actually accepts a CurlHandle. As such, it should also use just
$handle as the parameter name.

Closes GH-6435.
2020-11-19 10:17:17 +01:00
Nikita Popov bbc0dd402a Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Short-circuit get_gc for currently running generator
2020-11-18 12:46:12 +01:00
Nikita Popov 99a8ec6e24 Short-circuit get_gc for currently running generator 2020-11-18 12:45:29 +01:00
Dmitry Stogov feed041fc8 Fixed register clobbering 2020-11-18 10:22:25 +03:00
Dmitry Stogov 9841e8e411 Fixed trampoline handling 2020-11-17 23:56:05 +03:00
Gabriel Caruso fd75589b1f Update NEWS for 8.0.0 2020-11-17 16:34:55 +00:00
Gabriel Caruso 0a9b688bee Update NEWS for PHP 8.0.0RC5 2020-11-17 16:23:11 +00:00
Dmitry Stogov e364af91b5 Fixed allocated register clobbering 2020-11-17 18:31:14 +03:00
Dmitry Stogov 1523733bc4 Fixed false pasitive ASAN NULL pointer dereference warning 2020-11-17 16:23:30 +03:00
Nikita Popov f4a600be04 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80312: change default engine from MyISAM to InnoDB in tests
2020-11-17 13:16:17 +01:00
Darek Slusarczyk 79a606bd95 Fix #80312: change default engine from MyISAM to InnoDB in tests
Change mysqli and pdo_mysql tests configuration to use by default
InnoDB instead of MyISAM.

Closes GH-6405.
2020-11-17 13:15:15 +01:00
Benjamin Eberlei 1727d96d0e Fixed bug #80370: Segmentation fault reflecting attributes of dynamic property
Closes GH-6428.
2020-11-17 10:54:27 +01:00
Sammy Kaye Powers 58d41b8c4f Provide unused retvals to observers
Make sure that the return value is available to observers, even if
it is not used by the caller.

Closes GH-6422.
2020-11-17 10:28:47 +01:00
Nikita Popov 9cfb5261e4 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix incorrectly optimized out live range
2020-11-17 10:20:23 +01:00
Nikita Popov df7417d127 Fix incorrectly optimized out live range
For x ? y : z style structures, the live range starts at z, but
may also hold the value of y. Make sure that the refcounting check
takes this into account, by checking the type of a potential phi
user.
2020-11-17 10:19:57 +01:00
Sammy Kaye Powers 0425a6697a Fire open observer end handlers after a zend_bailout
Closes GH-6377
2020-11-16 15:12:57 -08:00
Dmitry Stogov 3fb1b0862c Fixed MAY_BE_INDIRECT inference 2020-11-16 18:17:05 +03:00
Christoph M. Becker c351768e4f Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #74558: Can't rebind closure returned by Closure::fromCallable()
2020-11-16 14:34:28 +01:00
Christoph M. Becker 78773890f6 Fix #74558: Can't rebind closure returned by Closure::fromCallable()
Failure to rebind such closures is not necessarily related to them
being created by `ReflectionFunctionAbstract::getClosure()`, so we fix
the error message.

Closes GH-6424.
2020-11-16 14:31:06 +01:00
Dmitry Stogov e3c63de05b Fixed alias handling 2020-11-16 16:11:25 +03:00
Dmitry Stogov eb6d496a93 Fixed reference-counting 2020-11-16 14:51:55 +03:00
Dmitry Stogov edf5c1901f Fixed incorrect FETCH_THIS optimization 2020-11-16 14:51:39 +03:00
Dmitry Stogov bd321df479 Fixed inconsistent VM stack state 2020-11-16 13:19:44 +03:00
Dmitry Stogov 64dc79f906 Trampoline cleanup 2020-11-16 12:05:45 +03:00
Pavel Djundik 7bbed18086 [ci skip] Add note that imagedestroy() no longer has an effect
Closes GH-6427.
2020-11-14 15:18:20 +01:00
Nikita Popov f5be0e5110 Inline pair production in json parser
Having this as a separate production has a noticeable performance
impact, and doesn't really make things clearer either.
2020-11-13 14:56:29 +01:00
Christoph M. Becker a08a2b48b4 Strip trailing line breaks and periods from Windows error messages
PHP error messages should not contain line breaks, so we remove these
from the Windows specific error messages.  We also remove trailing
periods for the same reason.

Closes GH-6423.
2020-11-12 16:42:28 +01:00
Nikita Popov 34dd032e4e Don't assume libmysqlclient library name
By simply dropping the additional checks, in line with the general
guideline of trusting the output of config scripts (this should
be migrated to pkg-config though).

Also drop the code for manually adding -z if mysql_config does not
-- that's not our problem.
2020-11-12 15:11:56 +01:00
Nikita Popov 2875d0f920 Fix memory leak when user filter onCreate returns false 2020-11-12 12:18:33 +01:00
Nikita Popov 3d2819e491 Fix memory leak with bcsqrt on number 0<X<1 2020-11-12 11:37:54 +01:00
Nikita Popov d033d5c07a Fix reflection getDefaultValue() with user arg info
The default value is part of the op_array in that case, but we have
no way to access it. Fail gracefully.
2020-11-12 11:02:04 +01:00
Dmitry Stogov 9acebe14df Fixed incorrectly eliminated type store 2020-11-11 20:13:58 +03:00
Dmitry Stogov 03e7854381 Remove assertion 2020-11-11 18:34:16 +03:00
Nikita Popov d776c31a34 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Handle errors during next_result()
2020-11-11 16:03:10 +01:00
Nikita Popov eda7492604 Handle errors during next_result() 2020-11-11 16:02:52 +01:00
Dmitry Stogov 2d2d42b268 Fixed incorrect invariant guard motion 2020-11-11 17:34:46 +03:00
Dmitry Stogov de359c00b4 Stop on fake frame 2020-11-11 14:54:54 +03:00
Dmitry Stogov a0de82ad75 Fixed reference-counting propagation 2020-11-11 14:54:00 +03:00
Nikita Popov 800cf5a20f Fix double free when socket_accept fails 2020-11-11 12:48:25 +01:00
Nikita Popov b4a2a9662b Retain reference to share handle from curl handle
Not keeping a reference will not result in use after free, because
curl protects against it, but it will result in a memory leak,
because curl_share_cleanup() will fail. We should make sure that
the share handle object stays alive as long as the curl handles
use it.
2020-11-11 11:56:03 +01:00
Dmitry Stogov 11c4821ba9 [Observer+JIT] Save opline before calling begin/end handlers 2020-11-11 13:50:53 +03:00
Dmitry Stogov 855d8fa68f [Observer] Save opline before calling begin/end handlers 2020-11-11 13:06:55 +03:00
Nikita Popov 1aff51d421 Fix community job
Made a mistake while merging...
2020-11-11 09:28:20 +01:00
Derick Rethans 9b627c6c27 Merge branch 'PHP-7.4' into PHP-8.0 2020-11-10 17:58:38 +00:00
Derick Rethans c1f8dd4a33 PHP-7.4 is now for 7.4.14 2020-11-10 17:58:21 +00:00
Gabriel Caruso 822e1660c7 Update NEWS for 8.0.0 2020-11-10 11:02:35 +00:00
407 changed files with 7286 additions and 3442 deletions

No files matched your search

+2
View File
@@ -70,8 +70,10 @@ jobs:
include:
- env: ENABLE_ZTS=0 ENABLE_DEBUG=0
arch: amd64
if: type = cron
- env: ENABLE_ZTS=1 ENABLE_DEBUG=1
arch: amd64
if: type = cron
- env: ENABLE_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 ARM64=1
arch: arm64
if: type = cron
+291 -281
View File
@@ -1,307 +1,265 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
12 Nov 2020, PHP 8.0.0RC4
07 Jan 2021, PHP 8.0.1
17 Dec 2020, PHP 8.0.1RC1
- Core:
. Fixed bug #80334 (assert() vs named parameters - confusing error). (Nikita)
. 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)
- FFI:
. Fixed bug #79177 (FFI doesn't handle well PHP exceptions within callback).
(cmb, Dmitry, Nikita)
- Fileinfo:
. Fixed bug #77961 (finfo_open crafted magic parsing SIGABRT). (cmb)
- ODBC:
. Fixed bug #44618 (Fetching may rely on uninitialized data). (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)
- Opcache:
. Fixed run-time binding of preloaded dynamically declared function. (Dmitry)
. 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)
- Reflection:
. Fixed bug #80299 (ReflectionFunction->invokeArgs confused in arguments).
- 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)
- SNMP:
. Fixed bug #70461 (disable md5 code when it is not supported in net-snmp).
(Alexander Bergmann, cmb)
- Standard:
. Don't force rebuild of symbol table, when populating $http_response_header
variable by the HTTP stream wrapper. (Dmitry)
. Fixed bug #80290 (Double free when ASSERT_CALLBACK is used with a dynamic
message). (Nikita)
. Fixed bug #80266 (parse_url silently drops port number 0). (cmb, Nikita)
- Tokenizer:
. Fixed bug #80328 (PhpToken::getAll() confusing name). (Nikita)
29 Oct 2020, PHP 8.0.0RC3
- Core:
. Fixed bug #8055 (Abstract trait methods returning "self" cannot be
fulfilled by traits). (Nikita)
. Fixed bug #80280 (ADD_EXTENSION_DEP() fails for ext/standard and ext/date).
(cmb)
. Fixed bug #80258 (Windows Deduplication Enabled, randon permission errors).
- 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)
- COM:
. Fixed bug #62474 (com_event_sink crashes on certain arguments). (cmb)
- DOM:
. Fixed bug #80268 (loadHTML() truncates at NUL bytes). (cmb)
- IMAP:
. Fixed bug #76618 (segfault on imap_reopen). (girgias)
. Fixed bug #80239 (imap_rfc822_write_address() leaks memory). (cmb)
. Fixed minor regression caused by fixing bug #80220. (cmb)
. Fixed bug #80242 (imap_mail_compose() segfaults for multipart with rfc822).
(cmb)
- Opcache:
. Fixed bug #80255 (Opcache bug (bad condition result) in 8.0.0rc1). (Nikita)
- Standard:
. Fixed bug #80256 (file_get_contents strip first line with chunked encoding
redirect). (Nikita)
15 Oct 2020, PHP 8.0.0RC2
- Core:
. Fixed bug #80225 (broken namespace usage in eval code). (Nikita)
- Curl:
. Fixed bug #80121 (Null pointer deref if CurlHandle directly instantiated).
(Nikita)
- IMAP:
. 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 #80220 (imap_mail_compose() may leak memory). (cmb)
. Fixed bug #80223 (imap_mail_compose() leaks envelope on malformed bodies).
(cmb)
. Fixed bug #80216 (imap_mail_compose() does not validate types/encodings).
(cmb)
. Fixed bug #80226 (imap_sort() leaks sortpgm memory). (cmb)
. Fixed bug #64076 (imap_sort() does not return FALSE on failure). (cmb)
- Opcache:
. Fixed bug #80184 (Complex expression in while / if statements resolves to
false incorrectly). (Nikita)
. Fixed bug #80175 (PHP8 RC1 - JIT Buffer not working). (cmb)
- Reflection:
. Fixed bug #80190 (ReflectionMethod::getReturnType() does not handle static
as part of union type). (Nikita)
- Phpdbg:
. Fixed bug #76813 (Access violation near NULL on source operand). (cmb)
- SPL:
. Fixed bug #65387 (Circular references in SPL iterators are not garbage
collected). (Nikita)
. Fixed #62004 (SplFileObject: fgets after seek returns wrong line). (cmb)
- Standard:
. Fixed bug #64060 (lstat_stat_variation7.phpt fails on certain file systems).
(M. Voelker, cmb)
. Fixed bug #80366 (Return Value of zend_fstat() not Checked). (sagpant, cmb)
. Fixed bug #77423 (FILTER_VALIDATE_URL accepts URLs with invalid userinfo).
(CVE-2020-7071) (cmb)
- XMLWriter:
. Removed return types from XMLWriter stubs. (cmb)
- Tidy:
. Fixed bug #77594 (ob_tidyhandler is never reset). (cmb)
01 Oct 2020, PHP 8.0.0rc1
- 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)
- Core:
. Fixed bug #80109 (Cannot skip arguments when extended debug is enabled).
(Nikita)
- ODBC:
. Fixed bug #22986 (odbc_connect() may reuse persistent connection). (cmb)
- PDO_Firebird:
. Fixed bug #64937 (Firebird PDO preprocessing sql). (Simonov Denis)
- SPL:
. SplFixedArray is now IteratorAggregate rather than Iterator. (alexdowad)
- Zlib:
. Fixed bug #78792 (zlib.output_compression disabled by Content-Type: image/).
(cmb)
17 Sep 2020, PHP 8.0.0beta4
- Core:
. Implement #[Attr] Attribute syntax as per final vote in RFC
https://wiki.php.net/rfc/shorter_attribute_syntax_change
. 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 faulty generator cleanup with yield from. (Bob)
- Date:
. Fixed bug #80057 (DateTimeImmutable::createFromFormat() does not populate
time). (Derick)
- FFI:
. Added FFI\CType::getName() method. (chopins)
03 Sep 2020, PHP 8.0.0beta3
- 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)
- COM:
. Fixed bug #55847 (DOTNET .NET 4.0 GAC new location). (cmb)
- DOM:
. Fixed bug #79968 (DOMChildNode API crash on unattached nodes). (Benjamin)
- Fileinfo:
. Upgrade to libmagic 5.39. (Anatol)
- Opcache:
. Fixed bug #80030 (Optimizer segfault with isset on static property with
undef dynamic class name). (Nikita)
20 Aug 2020, PHP 8.0.0beta2
- SPL:
. Fixed bug #79987 (Memory leak in SplFileInfo because of missing
zend_restore_error_handling()). (Dmitry)
06 Aug 2020, PHP 8.0.0beta1
- Core:
. Fixed bug #78236 (convert error on receiving variables when duplicate [).
. Fixed bug #36365 (scandir duplicates file name at every 65535th file).
(cmb)
. Fixed bug #79108 (Referencing argument in a function makes it a reference
in the stack trace). (Nikita)
. Fixed bug #79897 (Promoted constructor params with attribs cause crash).
(Deus Kane)
. Fixed bug #79946 (Build fails due to undeclared UINT32_C). (Nikita)
. Fixed bug #77561 (Shebang line not stripped for non-primary script).
. 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 #79948 (Exit in auto-prepended file does not abort PHP execution).
. 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 #62294 (register_shutdown_function() does not correctly handle
exit code). (Nikita)
. Fixed bug #79927 (Generator doesn't throw exception after multiple yield
from iterable). (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)
- Date:
. Fixed bug #60302 (DateTime::createFromFormat should new static(), not new
self()). (Derick)
. Implemented FR #79903 (datetime: new format "p", same as "P" but returning
"Z" for UTC). (gharlan)
- JIT:
. Fixed bug #79864 (JIT segfault in Symfony OptionsResolver). (Dmitry)
. Fixed bug #79888 (Incorrect execution with JIT enabled). (Dmitry)
- LDAP:
. Fixed memory leaks. (ptomulik)
- OCI8:
. Modernized oci_register_taf_callback() callable argument parsing
implementation. (girgias)
23 Jul 2020, PHP 8.0.0alpha3
- Core:
. 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 #79841 (Syntax error in configure / unescaped "[]" in php.m4).
(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)
- Standard:
. Fixed bug #79868 (Sorting with array_unique gives unwanted result). (Nikita)
09 Jul 2020, PHP 8.0.0alpha2
- FFI:
. Fixed bug #79749 (Converting FFI instances to bool fails). (cmb)
- JIT:
. Fixed bug #79743 (Fatal error when assigning to array property
with JIT enabled). (Laruence)
- PCRE:
. Updated to PCRE2 10.35. (cmb)
25 Jun 2020, PHP 8.0.0alpha1
- Core:
. Removed the pdo_odbc.db2_instance_name php.ini directive. (Kalle)
. Fixed bug #77619 (Wrong reflection on MultipleIterator::__construct).
(Fabien Villepinte)
. Fixed bug #65274 (Enhance undefined class constant error with class name).
. 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 #49555 (Fatal error "Function must be a string" message should be
renamed). (Nikita)
. Fixed bug #70839 (Converting optional argument to variadic forbidden by LSP
checks). (Nikita)
. Fixed bug #69084 (Unclear error message when not implementing a renamed
abstract trait function). (Nikita)
. Fixed bug #62609 (Allow implementing Traversable on abstract classes).
. 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 #79462 (method_exists and property_exists incoherent behavior).
. 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 #79368 ("Unexpected end of file" is not an acceptable error
message). (Alex Dowad)
. Fixed bug #36365 (scandir duplicates file name at every 65535th file).
. Fixed bug #80280 (ADD_EXTENSION_DEP() fails for ext/standard and ext/date).
(cmb)
. Use SSE2 instructions do locale independent strtolower. (Laruence)
. Fixed bug #79521 (Check __set_state structure). (carusogabriel)
. Fixed bug #79467 (data:// wrappers are writable). (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)
. Fixed bug #77966 (Cannot alias a method named "namespace"). (Nikita)
. Removed the pdo_odbc.db2_instance_name php.ini directive. (Kalle)
. Use SSE2 instructions do locale independent strtolower. (Laruence)
- BZ2:
. Fixed bug #71263 (fread() does not report bzip2.decompress errors). (cmb)
- CURL:
- Curl:
. Bumped required libcurl version to 7.29.0. (cmb)
- Date:
. Fixed bug #65547 (Default value for sunrise/sunset zenith still wrong).
(cmb)
. Fixed bug #69044 (discrepancy between time and microtime). (krakjoe)
. 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.
. Add enchant_dict_add and enchant_dict_is_added functions.
. 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)
. Replaced gd resources with objects. (Mark Randall)
. Made the $num_points parameter of php_imagepolygon optional. (cmb)
. Removed deprecated image2wbmp(). (cmb)
. Removed deprecated png2wbmp() and jpeg2wbmp(). (cmb)
. Added imagegetinterpolation(). (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)
@@ -310,17 +268,22 @@ PHP NEWS
. Removed deprecated INTL_IDNA_VARIANT_2003. (cmb)
- JIT:
. Fixed bug #79582 (Crash seen when opcache.jit=1235 and
opcache.jit_debug=2). (Laruence)
. 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:
@@ -331,34 +294,48 @@ PHP NEWS
. Fixed bug #76809 (SSL settings aren't respected when persistent connections
are used). (fabiomsouto)
- mysqlnd:
- 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)
- OpCache:
- 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 #76535 (Opcache does not replay compile-time warnings). (Nikita)
. 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)
- PGSQL:
. Bumped required libpq version to 9.1. (cmb)
. Updated to PCRE2 10.35. (cmb)
- PDO:
. Changed default PDO error mode to exceptions. (AllenJB)
. Fixed bug #77849 (Disable cloning of PDO handle/connection objects).
(camporter)
- PDO_Firebird:
. Fixed bug #64937 (Firebird PDO preprocessing sql). (Simonov Denis)
- PDO_OCI:
. Added support for setting and getting the oracle OCI 18c call timeout.
(camporter)
@@ -366,7 +343,10 @@ PHP NEWS
- PDO_PGSQL:
. Bumped required libpq version to 9.1. (cmb)
- phpdbg:
- 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).
@@ -374,62 +354,90 @@ PHP NEWS
. Fixed bug #77805 (phpdbg build fails when readline is shared). (krakjoe)
- Reflection:
. Fixed bug #78697 (ReflectionClass::implementsInterface - inaccurate error
message with traits). (villfa)
. Implement ReflectionProperty::hasDefaultValue and
Reflection::getDefaultValue (beberlei)
. Fixed bug #64592 (ReflectionClass::getMethods() returns methods out of
scope). (Nikita)
. Fixed bug #77325 (ReflectionClassConstant::$class returns wrong class when
extending). (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)
. Fixed bug #73529 (session_decode() silently fails on wrong input). (cmb)
- 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)
. Fixed bug #63575 (Root elements are not properly cloned). (cmb)
- sodium:
- Sodium:
. Fixed bug #77646 (sign_detached() strings not terminated). (Frank)
- SQLite3:
. Added SQLite3::setAuthorizer() and respective class constants. (bohwaz)
- SPL:
. Fixed bug #71236 (Second call of spl_autoload_register() does nothing if it
has no arguments). (Nikita)
. Fixed bug #65006 (spl_autoload_register fails with multiple callables using
self, same method). (Nikita)
- Standard:
. Implemented FR #78638 (__PHP_Incomplete_Class should be final). (Laruence)
. Fixed bug #77204 (getimagesize(): Read error! should mention file path).
(peter279k)
. Fixed bug #76859 (stream_get_line skips data if used with data-generating
filter). (kkopachev)
. Fixed bug #78385 (parse_url() does not include 'query' when question mark
is the last char). (Islam Israfilov)
. 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 #47983 (mixed LF and CRLF line endings in mail()). (cmb)
. 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:
- 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)
@@ -438,30 +446,32 @@ PHP NEWS
(cmb)
. Implemented FR #79344 (xmlwriter_write_attribute_ns: $prefix should be
nullable). (cmb)
. Removed return types from XMLWriter stubs. (cmb)
- Zip:
. Fixed bug #72374 (remove_path strips first char of filename). (tyage, Remi)
. Add ZipArchive::setMtimeName and ZipArchive::setMtimeIndex methods. (Remi)
. Add ZipArchive::setProgressCallback method (since libzip 1.3.0). (Remi)
. Add ZipArchive::setCancelCallback method (since libzip 1.6.0). (Remi)
. Add optional "flags" parameter to ZipArchive::addEmptyDir, addFile and
addFromString methods. (Remi)
. Add "flags" options to ZipArchive::addGlob and addPattern methods
keeping previous behavior having FL_OVERWRITE by default. (Remi)
. Add ZipArchive::replaceFile() method. (Remi)
. Add lastId property to ZipArchive. (Remi)
. ZipArchive::status and ZipArchive::statusSys properties and
ZipArchive::getStatusString() method stay valid after the archive
is closed. (Remi)
. Fixed bug #50678 (files extracted by ZipArchive class lost their
original modified time). (Remi)
. Implemented FR #77960 (add compression / encryption options for
ZipArchive::addGlob and ZipArchive::addPattern). (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! >>>
+16 -5
View File
@@ -29,6 +29,7 @@ PHP 8.0 UPGRADE NOTES
. Removed ability to call non-static methods statically.
Thus `is_callable` will fail when checking for a non-static method with a
classname (must check with an object instance).
. Removed (real) cast.
. Removed (unset) cast.
. Removed track_errors ini directive. This means that $php_errormsg is no
longer available. The error_get_last() function may be used instead.
@@ -314,7 +315,9 @@ PHP 8.0 UPGRADE NOTES
. The GD extension now uses a GdImage objects as the underlying data structure
for images, rather than resources. These objects are completely opaque, i.e.
they don't have any methods. Return value checks using is_resource() should
be replaced with checks for `false`.
be replaced with checks for `false`. The imagedestroy() function no longer
has an effect, instead the GdImage instance is automatically destroyed if
it is no longer referenced.
. The deprecated function image2wbmp() has been removed.
RFC: https://wiki.php.net/rfc/image2wbmp
. The deprecated functions png2wbmp() and jpeg2wbmp() have been removed.
@@ -440,6 +443,12 @@ PHP 8.0 UPGRADE NOTES
string $statement, ?int $fetch_mode = null, ...$fetch_mode_args)
PDOStatement::setFetchMode(int $mode, ...$params)
- PDO MySQL:
. PDO::inTransaction() now reports the actual transaction state of the
connection, rather than an approximation maintained by PDO. If a query that
is subject to "implicit commit" is executed, PDO::inTransaction() will
subsequently return false, as a transaction is no longer active.
- PDO_ODBC:
. The php.ini directive pdo_odbc.db2_instance_name has been removed
@@ -507,6 +516,8 @@ PHP 8.0 UPGRADE NOTES
- SPL:
. SplFileObject::fgetss() has been removed.
. SplFileObject::seek() now always seeks to the beginning of the line.
Previously, positions >=1 sought to the beginning of the next line.
. SplHeap::compare($a, $b) now specifies a method signature. Inheriting
classes implementing this method will now have to use a compatible
method signature.
@@ -654,10 +665,10 @@ PHP 8.0 UPGRADE NOTES
RFC: https://wiki.php.net/rfc/namespaced_names_as_token
- XML:
. xml_parser_create(_ns) will now return an XmlParser object rather than a
. xml_parser_create(_ns) will now return an XMLParser object rather than a
resource. Return value checks using is_resource() should be replaced with
checks for `false`. The xml_parser_free() function no longer has an effect,
instead the XmlParser instance is automatically destroyed if it is no longer
instead the XMLParser instance is automatically destroyed if it is no longer
referenced.
- XMLReader:
@@ -979,8 +990,8 @@ PHP 8.0 UPGRADE NOTES
- Zip:
. ZipArchive::setMtimeName and ZipArchive::setMtimeIndex to set the
modification time of an entry.
. ZipArchive::setProgressCallback to provide updates during archive close.
. ZipArchive::setCancelCallback to allow cancellation during archive close.
. ZipArchive::registerProgressCallback to provide updates during archive close.
. ZipArchive::registerCancelCallback to allow cancellation during archive close.
. ZipArchive::replaceFile to replace an entry content.
. ZipArchive::isCompressionMethodSupported to check optional compression
features.
-6
View File
@@ -190,12 +190,6 @@ dnl LIBZEND_OTHER_CHECKS
dnl
AC_DEFUN([LIBZEND_OTHER_CHECKS],[
AC_ARG_ENABLE([zts],
[AS_HELP_STRING([--enable-zts],
[Enable thread safety])],
[ZEND_ZTS=$enableval],
[ZEND_ZTS=no])
AC_MSG_CHECKING(whether to enable thread-safety)
AC_MSG_RESULT($ZEND_ZTS)
@@ -0,0 +1,9 @@
--TEST--
Validation for "Attribute" does not use a scope when evaluating constant ASTs
--FILE--
<?php
#[Attribute(parent::x)]
class x extends y {}
?>
--EXPECTF--
Fatal error: Cannot access "parent" when no class scope is active in %s on line %d
+1 -1
View File
@@ -7,4 +7,4 @@ $x = (new ReflectionFunction("substr"))->getClosure();
$x->call(new a);
?>
--EXPECTF--
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
Warning: Cannot rebind scope of closure created from function in %s on line %d
+1 -1
View File
@@ -18,5 +18,5 @@ var_dump($c);
Warning: Cannot bind method SplDoublyLinkedList::count() to object of class cls in %s on line %d
NULL
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
Warning: Cannot rebind scope of closure created from method in %s on line %d
NULL
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Iterable not covariant to mixed
--FILE--
<?php
class A {
public function method1(): mixed {}
public function method2(): array|object {}
public function method3(iterable $x) {}
public function method4(iterable $x) {}
}
class B extends A {
public function method1(): iterable {}
public function method2(): iterable {}
public function method3(mixed $x) {}
public function method4(array|object $x) {}
}
?>
===DONE===
--EXPECT--
===DONE===
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Bug #80404: Incorrect range inference result when division results in float
--FILE--
<?php
$n = 63;
var_dump((int) ($n / 120 * 100));
?>
--EXPECT--
int(52)
+12 -12
View File
@@ -118,10 +118,10 @@ bindTo(new Cls, null):
Success!
bindTo(new Cls, Cls::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
Cannot rebind scope of closure created from function
bindTo(null, Cls::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
Cannot rebind scope of closure created from function
bindTo(null, stdClass::class):
Cannot bind closure to scope of internal class stdClass
@@ -139,10 +139,10 @@ bindTo(new Cls, null):
Success!
bindTo(new Cls, Cls::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
Cannot rebind scope of closure created from function
bindTo(null, Cls::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
Cannot rebind scope of closure created from function
bindTo(null, stdClass::class):
Cannot bind closure to scope of internal class stdClass
@@ -163,13 +163,13 @@ bindTo(new Cls, Cls::class):
Cannot bind an instance to a static closure
bindTo(null, null):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
Cannot rebind scope of closure created from method
bindTo(null, ClsChild::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
Cannot rebind scope of closure created from method
bindTo(null, ClsUnrelated::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
Cannot rebind scope of closure created from method
(new Cls)->method()
-------------------
@@ -187,13 +187,13 @@ bindTo(new ClsUnrelated, Cls::class):
Cannot bind method Cls::method() to object of class ClsUnrelated
bindTo(new Cls, null):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
Cannot rebind scope of closure created from method
bindTo(new Cls, ClsUnrelated::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
Cannot rebind scope of closure created from method
bindTo(new Cls, ClsChild::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
Cannot rebind scope of closure created from method
(new SplDoublyLinkedList)->count()
----------------------------------
@@ -214,10 +214,10 @@ bindTo(null, SplDoublyLinkedList::class):
Cannot unbind $this of method
bindTo(new SplDoublyLinkedList, null):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
Cannot rebind scope of closure created from method
bindTo(new SplDoublyLinkedList, ClsUnrelated::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
Cannot rebind scope of closure created from method
(function() {})()
-----------------
@@ -0,0 +1,25 @@
--TEST--
GC on running generator
--FILE--
<?php
function gen() {
yield;
// Trigger GC while $v is being reassigned.
$ary = [new stdClass, new stdClass, new stdClass];
$ary[0]->foo = $ary;
foreach ($ary as &$v) { }
}
for ($i = 0; $i < 10000; $i++) {
// Make sure gen is registered as a GC root.
$gen = gen();
$gen2 = $gen;
unset($gen);
foreach ($gen2 as $v) {}
}
?>
===DONE===
--EXPECT--
===DONE===
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Missing live range if part of phi
--FILE--
<?php
function doThrow() {
throw new Exception("Test");
}
function test($k) {
// The 0 gives the QM_ASSIGN a non-refcounted type.
$res[$k ? $k : 0] = doThrow();
}
try {
test(new stdClass);
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Test
+1 -1
View File
@@ -20,7 +20,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "4.0.0-dev"
#define ZEND_VERSION "4.0.1"
#define ZEND_ENGINE_3
+2 -2
View File
@@ -3307,7 +3307,7 @@ ZEND_API zend_string *zend_get_callable_name(zval *callable) /* {{{ */
}
/* }}} */
static zend_always_inline zend_bool zend_is_callable_impl(
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) /* {{{ */
{
@@ -3436,7 +3436,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint
frame = frame->prev_execute_data;
}
zend_bool ret = zend_is_callable_impl(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);
}
+3
View File
@@ -352,6 +352,9 @@ 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 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 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);
+4 -1
View File
@@ -33,7 +33,10 @@ void validate_attribute(zend_attribute *attr, uint32_t target, zend_class_entry
if (attr->argc > 0) {
zval flags;
if (FAILURE == zend_get_attribute_value(&flags, attr, 0, scope)) {
/* As this is run in the middle of compilation, fetch the attribute value without
* specifying a scope. The class is not fully linked yet, and we may seen an
* inconsistent state. */
if (FAILURE == zend_get_attribute_value(&flags, attr, 0, NULL)) {
return;
}
+2 -2
View File
@@ -48,10 +48,10 @@ function get_mangled_object_vars(object $object): array {}
function get_class_methods(object|string $object_or_class): array {}
/** @param object|string $object_or_class */
function method_exists(mixed $object_or_class, string $method): bool {}
function method_exists($object_or_class, string $method): bool {}
/** @param object|string $object_or_class */
function property_exists(mixed $object_or_class, string $property): bool {}
function property_exists($object_or_class, string $property): bool {}
function class_exists(string $class, bool $autoload = true): bool {}
+3 -3
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 9a77101b93e8584315bf43305830e129d359b033 */
* Stub hash: b09e9199a21595a3b6f6c02db81c8e22c36c277f */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_version, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
@@ -84,12 +84,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_class_methods, 0, 1, IS_ARRA
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_method_exists, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, object_or_class, IS_MIXED, 0)
ZEND_ARG_INFO(0, object_or_class)
ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_property_exists, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, object_or_class, IS_MIXED, 0)
ZEND_ARG_INFO(0, object_or_class)
ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0)
ZEND_END_ARG_INFO()
+5 -1
View File
@@ -107,7 +107,11 @@ static zend_bool zend_valid_closure_binding(
}
if (is_fake_closure && scope != func->common.scope) {
zend_error(E_WARNING, "Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()");
if (func->common.scope == NULL) {
zend_error(E_WARNING, "Cannot rebind scope of closure created from function");
} else {
zend_error(E_WARNING, "Cannot rebind scope of closure created from method");
}
return 0;
}
+3 -1
View File
@@ -422,6 +422,9 @@ void init_compiler(void) /* {{{ */
void shutdown_compiler(void) /* {{{ */
{
/* Reset filename before destroying the arena, as file cache may use arena allocated strings. */
zend_restore_compiled_filename(NULL);
zend_stack_destroy(&CG(loop_var_stack));
zend_stack_destroy(&CG(delayed_oplines_stack));
zend_stack_destroy(&CG(short_circuiting_opnums));
@@ -437,7 +440,6 @@ void shutdown_compiler(void) /* {{{ */
FREE_HASHTABLE(CG(delayed_autoloads));
CG(delayed_autoloads) = NULL;
}
zend_restore_compiled_filename(NULL);
}
/* }}} */
+44
View File
@@ -73,6 +73,44 @@ static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo
}
#endif
#if defined(__i386__) || defined(__x86_64__)
/* Function based on compiler-rt implementation. */
static unsigned get_xcr0_eax() {
# if defined(__GNUC__) || defined(__clang__)
// Check xgetbv; this uses a .byte sequence instead of the instruction
// directly because older assemblers do not include support for xgetbv and
// there is no easy way to conditionally compile based on the assembler used.
unsigned eax, edx;
__asm__(".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c"(0));
return eax;
# elif defined(ZEND_WIN32) && defined(_XCR_XFEATURE_ENABLED_MASK)
return _xgetbv(_XCR_XFEATURE_ENABLED_MASK);
# else
return 0;
# endif
}
static zend_bool is_avx_supported() {
if (!(cpuinfo.ecx & ZEND_CPU_FEATURE_AVX)) {
/* No support for AVX */
return 0;
}
if (!(cpuinfo.ecx & ZEND_CPU_FEATURE_OSXSAVE)) {
/* The operating system does not support XSAVE. */
return 0;
}
if ((get_xcr0_eax() & 0x6) != 0x6) {
/* XCR0 SSE and AVX bits must be set. */
return 0;
}
return 1;
}
#else
static zend_bool is_avx_supported() {
return 0;
}
#endif
void zend_cpu_startup(void)
{
if (!cpuinfo.initialized) {
@@ -95,10 +133,16 @@ void zend_cpu_startup(void)
} else {
cpuinfo.ebx = 0;
}
if (!is_avx_supported()) {
cpuinfo.edx &= ~ZEND_CPU_FEATURE_AVX;
cpuinfo.ebx &= ~(ZEND_CPU_FEATURE_AVX2 & ~ZEND_CPU_EBX_MASK);
}
}
}
ZEND_API int zend_cpu_supports(zend_cpu_feature feature) {
ZEND_ASSERT(cpuinfo.initialized);
if (feature & ZEND_CPU_EDX_MASK) {
return (cpuinfo.edx & (feature & ~ZEND_CPU_EDX_MASK));
} else if (feature & ZEND_CPU_EBX_MASK) {
+28 -29
View File
@@ -120,7 +120,7 @@ ZEND_API int zend_cpu_supports(zend_cpu_feature feature);
* resolver functions should not depend on any external
* functions */
ZEND_NO_SANITIZE_ADDRESS
static zend_always_inline int zend_cpu_supports_sse2() {
static inline int zend_cpu_supports_sse2() {
#if PHP_HAVE_BUILTIN_CPU_INIT
__builtin_cpu_init();
#endif
@@ -128,7 +128,7 @@ static zend_always_inline int zend_cpu_supports_sse2() {
}
ZEND_NO_SANITIZE_ADDRESS
static zend_always_inline int zend_cpu_supports_sse3() {
static inline int zend_cpu_supports_sse3() {
#if PHP_HAVE_BUILTIN_CPU_INIT
__builtin_cpu_init();
#endif
@@ -136,7 +136,7 @@ static zend_always_inline int zend_cpu_supports_sse3() {
}
ZEND_NO_SANITIZE_ADDRESS
static zend_always_inline int zend_cpu_supports_ssse3() {
static inline int zend_cpu_supports_ssse3() {
#if PHP_HAVE_BUILTIN_CPU_INIT
__builtin_cpu_init();
#endif
@@ -144,7 +144,7 @@ static zend_always_inline int zend_cpu_supports_ssse3() {
}
ZEND_NO_SANITIZE_ADDRESS
static zend_always_inline int zend_cpu_supports_sse41() {
static inline int zend_cpu_supports_sse41() {
#if PHP_HAVE_BUILTIN_CPU_INIT
__builtin_cpu_init();
#endif
@@ -152,26 +152,15 @@ static zend_always_inline int zend_cpu_supports_sse41() {
}
ZEND_NO_SANITIZE_ADDRESS
static zend_always_inline int zend_cpu_supports_sse42() {
static inline int zend_cpu_supports_sse42() {
#if PHP_HAVE_BUILTIN_CPU_INIT
__builtin_cpu_init();
#endif
return __builtin_cpu_supports("sse4.2");
}
/* __builtin_cpu_supports has pclmul from gcc9 */
#if (!defined(__GNUC__) || (ZEND_GCC_VERSION >= 9000))
ZEND_NO_SANITIZE_ADDRESS
static zend_always_inline int zend_cpu_supports_pclmul() {
#if PHP_HAVE_BUILTIN_CPU_INIT
__builtin_cpu_init();
#endif
return __builtin_cpu_supports("pclmul");
}
#endif
ZEND_NO_SANITIZE_ADDRESS
static zend_always_inline int zend_cpu_supports_avx() {
static inline int zend_cpu_supports_avx() {
#if PHP_HAVE_BUILTIN_CPU_INIT
__builtin_cpu_init();
#endif
@@ -179,7 +168,7 @@ static zend_always_inline int zend_cpu_supports_avx() {
}
ZEND_NO_SANITIZE_ADDRESS
static zend_always_inline int zend_cpu_supports_avx2() {
static inline int zend_cpu_supports_avx2() {
#if PHP_HAVE_BUILTIN_CPU_INIT
__builtin_cpu_init();
#endif
@@ -187,38 +176,48 @@ static zend_always_inline int zend_cpu_supports_avx2() {
}
#else
static zend_always_inline int zend_cpu_supports_sse2() {
static inline int zend_cpu_supports_sse2() {
return zend_cpu_supports(ZEND_CPU_FEATURE_SSE2);
}
static zend_always_inline int zend_cpu_supports_sse3() {
static inline int zend_cpu_supports_sse3() {
return zend_cpu_supports(ZEND_CPU_FEATURE_SSE3);
}
static zend_always_inline int zend_cpu_supports_ssse3() {
static inline int zend_cpu_supports_ssse3() {
return zend_cpu_supports(ZEND_CPU_FEATURE_SSSE3);
}
static zend_always_inline int zend_cpu_supports_sse41() {
static inline int zend_cpu_supports_sse41() {
return zend_cpu_supports(ZEND_CPU_FEATURE_SSE41);
}
static zend_always_inline int zend_cpu_supports_sse42() {
static inline int zend_cpu_supports_sse42() {
return zend_cpu_supports(ZEND_CPU_FEATURE_SSE42);
}
static zend_always_inline int zend_cpu_supports_pclmul() {
return zend_cpu_supports(ZEND_CPU_FEATURE_PCLMULQDQ);
}
static zend_always_inline int zend_cpu_supports_avx() {
static inline int zend_cpu_supports_avx() {
return zend_cpu_supports(ZEND_CPU_FEATURE_AVX);
}
static zend_always_inline int zend_cpu_supports_avx2() {
static inline int zend_cpu_supports_avx2() {
return zend_cpu_supports(ZEND_CPU_FEATURE_AVX2);
}
#endif
/* __builtin_cpu_supports has pclmul from gcc9 */
#if PHP_HAVE_BUILTIN_CPU_SUPPORTS && (!defined(__GNUC__) || (ZEND_GCC_VERSION >= 9000))
ZEND_NO_SANITIZE_ADDRESS
static inline int zend_cpu_supports_pclmul() {
#if PHP_HAVE_BUILTIN_CPU_INIT
__builtin_cpu_init();
#endif
return __builtin_cpu_supports("pclmul");
}
#else
static inline int zend_cpu_supports_pclmul() {
return zend_cpu_supports(ZEND_CPU_FEATURE_PCLMULQDQ);
}
#endif
#endif
+6
View File
@@ -3262,6 +3262,7 @@ ZEND_API void ZEND_FASTCALL zend_ref_del_type_source(zend_property_info_source_l
zend_property_info_list *list = ZEND_PROPERTY_INFO_SOURCE_TO_LIST(source_list->list);
zend_property_info **ptr, **end;
ZEND_ASSERT(prop);
if (!ZEND_PROPERTY_INFO_SOURCE_IS_LIST(source_list->list)) {
ZEND_ASSERT(source_list->ptr == prop);
source_list->ptr = NULL;
@@ -4757,6 +4758,11 @@ static zend_always_inline zend_execute_data *_zend_vm_stack_push_call_frame(uint
} \
} while (0)
#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE
/* This callback disables optimization of "vm_stack_data" variable in VM */
void (*zend_touch_vm_stack_data)(void *vm_stack_data) = NULL;
#endif
#include "zend_vm_execute.h"
ZEND_API zend_result zend_set_user_opcode_handler(zend_uchar opcode, user_opcode_handler_t handler)
+2 -2
View File
@@ -1382,7 +1382,7 @@ static void zend_set_timeout_ex(zend_long seconds, bool reset_signals) /* {{{ */
t_r.it_value.tv_sec = seconds;
t_r.it_value.tv_usec = t_r.it_interval.tv_sec = t_r.it_interval.tv_usec = 0;
# ifdef __CYGWIN__
# if defined(__CYGWIN__) || defined(__PASE__)
setitimer(ITIMER_REAL, &t_r, NULL);
}
signo = SIGALRM;
@@ -1444,7 +1444,7 @@ void zend_unset_timeout(void) /* {{{ */
no_timeout.it_value.tv_sec = no_timeout.it_value.tv_usec = no_timeout.it_interval.tv_sec = no_timeout.it_interval.tv_usec = 0;
# ifdef __CYGWIN__
# if defined(__CYGWIN__) || defined(__PASE__)
setitimer(ITIMER_REAL, &no_timeout, NULL);
# else
setitimer(ITIMER_PROF, &no_timeout, NULL);
+2 -2
View File
@@ -55,8 +55,6 @@ void gc_reset(void);
size_t zend_gc_globals_size(void);
#endif
END_EXTERN_C()
#define GC_REMOVE_FROM_BUFFER(p) do { \
zend_refcounted *_p = (zend_refcounted*)(p); \
if (GC_TYPE_INFO(_p) & GC_INFO_MASK) { \
@@ -122,4 +120,6 @@ static zend_always_inline void zend_get_gc_buffer_use(
*n = gc_buffer->cur - gc_buffer->start;
}
END_EXTERN_C()
#endif /* ZEND_GC_H */
+10
View File
@@ -324,6 +324,16 @@ static HashTable *zend_generator_get_gc(zend_object *object, zval **table, int *
return NULL;
}
if (generator->flags & ZEND_GENERATOR_CURRENTLY_RUNNING) {
/* If the generator is currently running, we certainly won't be able to GC any values it
* holds on to. The execute_data state might be inconsistent during execution (e.g. because
* GC has been triggered in the middle of a variable reassignment), so we should not try
* to inspect it here. */
*table = NULL;
*n = 0;
return NULL;
}
op_array = &EX(func)->op_array;
zend_get_gc_buffer *gc_buffer = zend_get_gc_buffer_create();
+4
View File
@@ -323,6 +323,10 @@ static zend_bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce
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;
}
ZEND_TYPE_FOREACH(type, single_type) {
if (ZEND_TYPE_HAS_NAME(*single_type)
&& zend_string_equals_literal_ci(ZEND_TYPE_NAME(*single_type), "Traversable")) {
+1 -1
View File
@@ -1564,7 +1564,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<ST_IN_SCRIPTING>"?->" {
yy_push_state(ST_LOOKING_FOR_PROPERTY);
return T_NULLSAFE_OBJECT_OPERATOR;
RETURN_TOKEN(T_NULLSAFE_OBJECT_OPERATOR);
}
<ST_IN_SCRIPTING,ST_LOOKING_FOR_PROPERTY>{WHITESPACE}+ {
+27 -1
View File
@@ -44,11 +44,13 @@ zend_llist zend_observer_error_callbacks;
int zend_observer_fcall_op_array_extension = -1;
ZEND_TLS zend_arena *fcall_handlers_arena = NULL;
ZEND_TLS zend_execute_data *first_observed_frame = NULL;
ZEND_TLS zend_execute_data *current_observed_frame = NULL;
// Call during minit/startup ONLY
ZEND_API void zend_observer_fcall_register(zend_observer_fcall_init init) {
/* We don't want to get an extension handle unless an ext installs an observer */
if (!ZEND_OBSERVER_ENABLED) {
/* We don't want to get an extension handle unless an ext installs an observer */
zend_observer_fcall_op_array_extension =
zend_get_op_array_extension_handle("Zend Observer");
@@ -160,6 +162,11 @@ static void ZEND_FASTCALL _zend_observe_fcall_begin(zend_execute_data *execute_d
return;
}
if (first_observed_frame == NULL) {
first_observed_frame = execute_data;
}
current_observed_frame = execute_data;
end = fcall_data->end;
for (handlers = fcall_data->handlers; handlers != end; ++handlers) {
if (handlers->begin) {
@@ -208,6 +215,25 @@ ZEND_API void ZEND_FASTCALL zend_observer_fcall_end(
handlers->end(execute_data, return_value);
}
}
if (first_observed_frame == execute_data) {
first_observed_frame = NULL;
current_observed_frame = NULL;
} else {
current_observed_frame = execute_data->prev_execute_data;
}
}
ZEND_API void zend_observer_fcall_end_all(void)
{
zend_execute_data *ex = current_observed_frame;
while (ex != NULL) {
if (ex->func->type != ZEND_INTERNAL_FUNCTION) {
zend_observer_fcall_end(ex, NULL);
}
ex = ex->prev_execute_data;
}
current_observed_frame = NULL;
}
ZEND_API void zend_observer_error_register(zend_observer_error_cb cb)
+2
View File
@@ -70,6 +70,8 @@ ZEND_API void ZEND_FASTCALL zend_observer_fcall_end(
zend_execute_data *execute_data,
zval *return_value);
ZEND_API void zend_observer_fcall_end_all(void);
typedef void (*zend_observer_error_cb)(int type, const char *error_filename, uint32_t error_lineno, zend_string *message);
ZEND_API void zend_observer_error_register(zend_observer_error_cb callback);
+2 -1
View File
@@ -62,7 +62,8 @@ ZEND_API zend_signal_globals_t zend_signal_globals;
static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context);
static int zend_signal_register(int signo, void (*handler)(int, siginfo_t*, void*));
#ifdef __CYGWIN__
#if defined(__CYGWIN__) || defined(__PASE__)
/* Matches zend_excute_API.c; these platforms don't support ITIMER_PROF. */
#define TIMEOUT_SIG SIGALRM
#else
#define TIMEOUT_SIG SIGPROF
+28 -13
View File
@@ -3956,8 +3956,9 @@ ZEND_VM_HOT_HANDLER(130, ZEND_DO_UCALL, ANY, ANY, SPEC(RETVAL,OBSERVER))
call->prev_execute_data = execute_data;
execute_data = call;
i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC);
ZEND_OBSERVER_FCALL_BEGIN(execute_data);
LOAD_OPLINE_EX();
ZEND_OBSERVER_SAVE_OPLINE();
ZEND_OBSERVER_FCALL_BEGIN(execute_data);
ZEND_VM_ENTER_EX();
}
@@ -3981,8 +3982,9 @@ ZEND_VM_HOT_HANDLER(131, ZEND_DO_FCALL_BY_NAME, ANY, ANY, SPEC(RETVAL,OBSERVER))
call->prev_execute_data = execute_data;
execute_data = call;
i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC);
ZEND_OBSERVER_FCALL_BEGIN(execute_data);
LOAD_OPLINE_EX();
ZEND_OBSERVER_SAVE_OPLINE();
ZEND_OBSERVER_FCALL_BEGIN(execute_data);
ZEND_VM_ENTER_EX();
} else {
@@ -4075,13 +4077,15 @@ ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL,OBSERVER))
call->prev_execute_data = execute_data;
execute_data = call;
i_init_func_execute_data(&fbc->op_array, ret, 1 EXECUTE_DATA_CC);
ZEND_OBSERVER_FCALL_BEGIN(execute_data);
if (EXPECTED(zend_execute_ex == execute_ex)) {
LOAD_OPLINE_EX();
ZEND_OBSERVER_SAVE_OPLINE();
ZEND_OBSERVER_FCALL_BEGIN(execute_data);
ZEND_VM_ENTER_EX();
} else {
SAVE_OPLINE_EX();
ZEND_OBSERVER_FCALL_BEGIN(execute_data);
execute_data = EX(prev_execute_data);
LOAD_OPLINE();
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
@@ -4235,9 +4239,11 @@ ZEND_VM_INLINE_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY, SPEC(OBSERVER))
USE_OPLINE
zval *retval_ptr;
zval *return_value;
ZEND_OBSERVER_USE_RETVAL;
retval_ptr = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
return_value = EX(return_value);
ZEND_OBSERVER_SET_RETVAL();
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) {
SAVE_OPLINE();
retval_ptr = ZVAL_UNDEFINED_OP1();
@@ -4299,7 +4305,9 @@ ZEND_VM_INLINE_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY, SPEC(OBSERVER))
}
}
}
ZEND_OBSERVER_SAVE_OPLINE();
ZEND_OBSERVER_FCALL_END(execute_data, return_value);
ZEND_OBSERVER_FREE_RETVAL();
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
}
@@ -4307,9 +4315,13 @@ ZEND_VM_COLD_CONST_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY, SRC,
{
USE_OPLINE
zval *retval_ptr;
zval *return_value;
ZEND_OBSERVER_USE_RETVAL;
SAVE_OPLINE();
return_value = EX(return_value);
ZEND_OBSERVER_SET_RETVAL();
do {
if ((OP1_TYPE & (IS_CONST|IS_TMP_VAR)) ||
(OP1_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) {
@@ -4317,15 +4329,15 @@ ZEND_VM_COLD_CONST_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY, SRC,
zend_error(E_NOTICE, "Only variable references should be returned by reference");
retval_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
if (!EX(return_value)) {
if (!return_value) {
FREE_OP1();
} else {
if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
ZVAL_COPY_VALUE(return_value, retval_ptr);
break;
}
ZVAL_NEW_REF(EX(return_value), retval_ptr);
ZVAL_NEW_REF(return_value, retval_ptr);
if (OP1_TYPE == IS_CONST) {
Z_TRY_ADDREF_P(retval_ptr);
}
@@ -4339,8 +4351,8 @@ ZEND_VM_COLD_CONST_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY, SRC,
ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval));
if (opline->extended_value == ZEND_RETURNS_FUNCTION && !Z_ISREF_P(retval_ptr)) {
zend_error(E_NOTICE, "Only variable references should be returned by reference");
if (EX(return_value)) {
ZVAL_NEW_REF(EX(return_value), retval_ptr);
if (return_value) {
ZVAL_NEW_REF(return_value, retval_ptr);
} else {
FREE_OP1_VAR_PTR();
}
@@ -4348,19 +4360,20 @@ ZEND_VM_COLD_CONST_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY, SRC,
}
}
if (EX(return_value)) {
if (return_value) {
if (Z_ISREF_P(retval_ptr)) {
Z_ADDREF_P(retval_ptr);
} else {
ZVAL_MAKE_REF_EX(retval_ptr, 2);
}
ZVAL_REF(EX(return_value), Z_REF_P(retval_ptr));
ZVAL_REF(return_value, Z_REF_P(retval_ptr));
}
FREE_OP1_VAR_PTR();
} while (0);
ZEND_OBSERVER_FCALL_END(execute_data, EX(return_value));
ZEND_OBSERVER_FCALL_END(execute_data, return_value);
ZEND_OBSERVER_FREE_RETVAL();
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
}
@@ -7705,7 +7718,7 @@ ZEND_VM_HELPER(zend_dispatch_try_catch_finally_helper, ANY, ANY, uint32_t try_ca
/* Uncaught exception */
if (zend_observer_fcall_op_array_extension != -1) {
zend_observer_fcall_end(execute_data, EX(return_value));
zend_observer_fcall_end(execute_data, NULL);
}
cleanup_live_vars(execute_data, op_num, 0);
if (UNEXPECTED((EX_CALL_INFO() & ZEND_CALL_GENERATOR) != 0)) {
@@ -8511,12 +8524,14 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY, SPEC(OBSERVER))
}
execute_data = call;
i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC);
ZEND_OBSERVER_FCALL_BEGIN(execute_data);
if (EXPECTED(zend_execute_ex == execute_ex)) {
LOAD_OPLINE_EX();
ZEND_OBSERVER_SAVE_OPLINE();
ZEND_OBSERVER_FCALL_BEGIN(execute_data);
ZEND_VM_ENTER_EX();
} else {
SAVE_OPLINE_EX();
ZEND_OBSERVER_FCALL_BEGIN(execute_data);
execute_data = EX(prev_execute_data);
LOAD_OPLINE();
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
+139 -53
View File
@@ -1350,9 +1350,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_UCALL_SPEC_RETV
call->prev_execute_data = execute_data;
execute_data = call;
i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC);
LOAD_OPLINE_EX();
ZEND_VM_ENTER_EX();
}
@@ -1374,9 +1374,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_UCALL_SPEC_RETV
call->prev_execute_data = execute_data;
execute_data = call;
i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC);
LOAD_OPLINE_EX();
ZEND_VM_ENTER_EX();
}
@@ -1398,8 +1398,9 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_UCALL_SPEC_OBS
call->prev_execute_data = execute_data;
execute_data = call;
i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC);
zend_observer_fcall_begin(execute_data);
LOAD_OPLINE_EX();
SAVE_OPLINE();
zend_observer_fcall_begin(execute_data);
ZEND_VM_ENTER_EX();
}
@@ -1423,9 +1424,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_S
call->prev_execute_data = execute_data;
execute_data = call;
i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC);
LOAD_OPLINE_EX();
ZEND_VM_ENTER_EX();
} else {
zval retval;
@@ -1517,9 +1518,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_S
call->prev_execute_data = execute_data;
execute_data = call;
i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC);
LOAD_OPLINE_EX();
ZEND_VM_ENTER_EX();
} else {
zval retval;
@@ -1611,8 +1612,9 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_
call->prev_execute_data = execute_data;
execute_data = call;
i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC);
zend_observer_fcall_begin(execute_data);
LOAD_OPLINE_EX();
SAVE_OPLINE();
zend_observer_fcall_begin(execute_data);
ZEND_VM_ENTER_EX();
} else {
@@ -1708,9 +1710,12 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV
if (EXPECTED(zend_execute_ex == execute_ex)) {
LOAD_OPLINE_EX();
ZEND_VM_ENTER_EX();
} else {
SAVE_OPLINE_EX();
execute_data = EX(prev_execute_data);
LOAD_OPLINE();
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
@@ -1813,9 +1818,12 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV
if (EXPECTED(zend_execute_ex == execute_ex)) {
LOAD_OPLINE_EX();
ZEND_VM_ENTER_EX();
} else {
SAVE_OPLINE_EX();
execute_data = EX(prev_execute_data);
LOAD_OPLINE();
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
@@ -1915,13 +1923,15 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_OBS
call->prev_execute_data = execute_data;
execute_data = call;
i_init_func_execute_data(&fbc->op_array, ret, 1 EXECUTE_DATA_CC);
zend_observer_fcall_begin(execute_data);
if (EXPECTED(zend_execute_ex == execute_ex)) {
LOAD_OPLINE_EX();
SAVE_OPLINE();
zend_observer_fcall_begin(execute_data);
ZEND_VM_ENTER_EX();
} else {
SAVE_OPLINE_EX();
zend_observer_fcall_begin(execute_data);
execute_data = EX(prev_execute_data);
LOAD_OPLINE();
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
@@ -2895,7 +2905,7 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_dispatch_try
/* Uncaught exception */
if (zend_observer_fcall_op_array_extension != -1) {
zend_observer_fcall_end(execute_data, EX(return_value));
zend_observer_fcall_end(execute_data, NULL);
}
cleanup_live_vars(execute_data, op_num, 0);
if (UNEXPECTED((EX_CALL_INFO() & ZEND_CALL_GENERATOR) != 0)) {
@@ -3136,12 +3146,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(Z
}
execute_data = call;
i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC);
if (EXPECTED(zend_execute_ex == execute_ex)) {
LOAD_OPLINE_EX();
ZEND_VM_ENTER_EX();
} else {
SAVE_OPLINE_EX();
execute_data = EX(prev_execute_data);
LOAD_OPLINE();
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
@@ -3270,12 +3282,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_OBSERVER_
}
execute_data = call;
i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC);
zend_observer_fcall_begin(execute_data);
if (EXPECTED(zend_execute_ex == execute_ex)) {
LOAD_OPLINE_EX();
SAVE_OPLINE();
zend_observer_fcall_begin(execute_data);
ZEND_VM_ENTER_EX();
} else {
SAVE_OPLINE_EX();
zend_observer_fcall_begin(execute_data);
execute_data = EX(prev_execute_data);
LOAD_OPLINE();
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
@@ -4007,6 +4021,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_
retval_ptr = RT_CONSTANT(opline, opline->op1);
return_value = EX(return_value);
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) {
SAVE_OPLINE();
retval_ptr = ZVAL_UNDEFINED_OP1();
@@ -4069,6 +4084,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_
}
}
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
@@ -4077,9 +4094,11 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_OBSER
USE_OPLINE
zval *retval_ptr;
zval *return_value;
zval observer_retval;
retval_ptr = get_zval_ptr_undef(opline->op1_type, opline->op1, BP_VAR_R);
return_value = EX(return_value);
if (!return_value) { return_value = &observer_retval; };
if (opline->op1_type == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) {
SAVE_OPLINE();
retval_ptr = ZVAL_UNDEFINED_OP1();
@@ -4141,7 +4160,9 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_OBSER
}
}
}
SAVE_OPLINE();
zend_observer_fcall_end(execute_data, return_value);
if (return_value == &observer_retval) { zval_ptr_dtor_nogc(&observer_retval); };
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
@@ -4149,9 +4170,12 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPE
{
USE_OPLINE
zval *retval_ptr;
zval *return_value;
SAVE_OPLINE();
return_value = EX(return_value);
do {
if ((IS_CONST & (IS_CONST|IS_TMP_VAR)) ||
(IS_CONST == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) {
@@ -4159,15 +4183,15 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPE
zend_error(E_NOTICE, "Only variable references should be returned by reference");
retval_ptr = RT_CONSTANT(opline, opline->op1);
if (!EX(return_value)) {
if (!return_value) {
} else {
if (IS_CONST == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
ZVAL_COPY_VALUE(return_value, retval_ptr);
break;
}
ZVAL_NEW_REF(EX(return_value), retval_ptr);
ZVAL_NEW_REF(return_value, retval_ptr);
if (IS_CONST == IS_CONST) {
Z_TRY_ADDREF_P(retval_ptr);
}
@@ -4181,8 +4205,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPE
ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval));
if (opline->extended_value == ZEND_RETURNS_FUNCTION && !Z_ISREF_P(retval_ptr)) {
zend_error(E_NOTICE, "Only variable references should be returned by reference");
if (EX(return_value)) {
ZVAL_NEW_REF(EX(return_value), retval_ptr);
if (return_value) {
ZVAL_NEW_REF(return_value, retval_ptr);
} else {
}
@@ -4190,17 +4214,18 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPE
}
}
if (EX(return_value)) {
if (return_value) {
if (Z_ISREF_P(retval_ptr)) {
Z_ADDREF_P(retval_ptr);
} else {
ZVAL_MAKE_REF_EX(retval_ptr, 2);
}
ZVAL_REF(EX(return_value), Z_REF_P(retval_ptr));
ZVAL_REF(return_value, Z_REF_P(retval_ptr));
}
} while (0);
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
@@ -4208,9 +4233,13 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPE
{
USE_OPLINE
zval *retval_ptr;
zval *return_value;
zval observer_retval;
SAVE_OPLINE();
return_value = EX(return_value);
if (!return_value) { return_value = &observer_retval; };
do {
if ((opline->op1_type & (IS_CONST|IS_TMP_VAR)) ||
(opline->op1_type == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) {
@@ -4218,15 +4247,15 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPE
zend_error(E_NOTICE, "Only variable references should be returned by reference");
retval_ptr = get_zval_ptr(opline->op1_type, opline->op1, BP_VAR_R);
if (!EX(return_value)) {
if (!return_value) {
FREE_OP(opline->op1_type, opline->op1.var);
} else {
if (opline->op1_type == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
ZVAL_COPY_VALUE(return_value, retval_ptr);
break;
}
ZVAL_NEW_REF(EX(return_value), retval_ptr);
ZVAL_NEW_REF(return_value, retval_ptr);
if (opline->op1_type == IS_CONST) {
Z_TRY_ADDREF_P(retval_ptr);
}
@@ -4240,8 +4269,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPE
ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval));
if (opline->extended_value == ZEND_RETURNS_FUNCTION && !Z_ISREF_P(retval_ptr)) {
zend_error(E_NOTICE, "Only variable references should be returned by reference");
if (EX(return_value)) {
ZVAL_NEW_REF(EX(return_value), retval_ptr);
if (return_value) {
ZVAL_NEW_REF(return_value, retval_ptr);
} else {
if (opline->op1_type == IS_VAR) {zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));};
}
@@ -4249,19 +4278,20 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPE
}
}
if (EX(return_value)) {
if (return_value) {
if (Z_ISREF_P(retval_ptr)) {
Z_ADDREF_P(retval_ptr);
} else {
ZVAL_MAKE_REF_EX(retval_ptr, 2);
}
ZVAL_REF(EX(return_value), Z_REF_P(retval_ptr));
ZVAL_REF(return_value, Z_REF_P(retval_ptr));
}
if (opline->op1_type == IS_VAR) {zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));};
} while (0);
zend_observer_fcall_end(execute_data, EX(return_value));
zend_observer_fcall_end(execute_data, return_value);
if (return_value == &observer_retval) { zval_ptr_dtor_nogc(&observer_retval); };
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
@@ -18512,6 +18542,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HA
retval_ptr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC);
return_value = EX(return_value);
if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) {
SAVE_OPLINE();
retval_ptr = ZVAL_UNDEFINED_OP1();
@@ -18574,6 +18605,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HA
}
}
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
@@ -18581,9 +18614,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER
{
USE_OPLINE
zval *retval_ptr;
zval *return_value;
SAVE_OPLINE();
return_value = EX(return_value);
do {
if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR)) ||
(IS_TMP_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) {
@@ -18591,15 +18627,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER
zend_error(E_NOTICE, "Only variable references should be returned by reference");
retval_ptr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC);
if (!EX(return_value)) {
if (!return_value) {
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
} else {
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
ZVAL_COPY_VALUE(return_value, retval_ptr);
break;
}
ZVAL_NEW_REF(EX(return_value), retval_ptr);
ZVAL_NEW_REF(return_value, retval_ptr);
if (IS_TMP_VAR == IS_CONST) {
Z_TRY_ADDREF_P(retval_ptr);
}
@@ -18613,8 +18649,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER
ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval));
if (opline->extended_value == ZEND_RETURNS_FUNCTION && !Z_ISREF_P(retval_ptr)) {
zend_error(E_NOTICE, "Only variable references should be returned by reference");
if (EX(return_value)) {
ZVAL_NEW_REF(EX(return_value), retval_ptr);
if (return_value) {
ZVAL_NEW_REF(return_value, retval_ptr);
} else {
}
@@ -18622,17 +18658,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER
}
}
if (EX(return_value)) {
if (return_value) {
if (Z_ISREF_P(retval_ptr)) {
Z_ADDREF_P(retval_ptr);
} else {
ZVAL_MAKE_REF_EX(retval_ptr, 2);
}
ZVAL_REF(EX(return_value), Z_REF_P(retval_ptr));
ZVAL_REF(return_value, Z_REF_P(retval_ptr));
}
} while (0);
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
@@ -21077,6 +21114,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HA
retval_ptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC);
return_value = EX(return_value);
if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) {
SAVE_OPLINE();
retval_ptr = ZVAL_UNDEFINED_OP1();
@@ -21139,6 +21177,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HA
}
}
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
@@ -21146,9 +21186,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER
{
USE_OPLINE
zval *retval_ptr;
zval *return_value;
SAVE_OPLINE();
return_value = EX(return_value);
do {
if ((IS_VAR & (IS_CONST|IS_TMP_VAR)) ||
(IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) {
@@ -21156,15 +21199,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER
zend_error(E_NOTICE, "Only variable references should be returned by reference");
retval_ptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC);
if (!EX(return_value)) {
if (!return_value) {
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
} else {
if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
ZVAL_COPY_VALUE(return_value, retval_ptr);
break;
}
ZVAL_NEW_REF(EX(return_value), retval_ptr);
ZVAL_NEW_REF(return_value, retval_ptr);
if (IS_VAR == IS_CONST) {
Z_TRY_ADDREF_P(retval_ptr);
}
@@ -21178,8 +21221,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER
ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval));
if (opline->extended_value == ZEND_RETURNS_FUNCTION && !Z_ISREF_P(retval_ptr)) {
zend_error(E_NOTICE, "Only variable references should be returned by reference");
if (EX(return_value)) {
ZVAL_NEW_REF(EX(return_value), retval_ptr);
if (return_value) {
ZVAL_NEW_REF(return_value, retval_ptr);
} else {
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
}
@@ -21187,18 +21230,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER
}
}
if (EX(return_value)) {
if (return_value) {
if (Z_ISREF_P(retval_ptr)) {
Z_ADDREF_P(retval_ptr);
} else {
ZVAL_MAKE_REF_EX(retval_ptr, 2);
}
ZVAL_REF(EX(return_value), Z_REF_P(retval_ptr));
ZVAL_REF(return_value, Z_REF_P(retval_ptr));
}
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
} while (0);
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
@@ -37608,6 +37652,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HAN
retval_ptr = EX_VAR(opline->op1.var);
return_value = EX(return_value);
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) {
SAVE_OPLINE();
retval_ptr = ZVAL_UNDEFINED_OP1();
@@ -37670,6 +37715,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HAN
}
}
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
@@ -37677,9 +37724,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(
{
USE_OPLINE
zval *retval_ptr;
zval *return_value;
SAVE_OPLINE();
return_value = EX(return_value);
do {
if ((IS_CV & (IS_CONST|IS_TMP_VAR)) ||
(IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) {
@@ -37687,15 +37737,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(
zend_error(E_NOTICE, "Only variable references should be returned by reference");
retval_ptr = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
if (!EX(return_value)) {
if (!return_value) {
} else {
if (IS_CV == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
ZVAL_COPY_VALUE(return_value, retval_ptr);
break;
}
ZVAL_NEW_REF(EX(return_value), retval_ptr);
ZVAL_NEW_REF(return_value, retval_ptr);
if (IS_CV == IS_CONST) {
Z_TRY_ADDREF_P(retval_ptr);
}
@@ -37709,8 +37759,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(
ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval));
if (opline->extended_value == ZEND_RETURNS_FUNCTION && !Z_ISREF_P(retval_ptr)) {
zend_error(E_NOTICE, "Only variable references should be returned by reference");
if (EX(return_value)) {
ZVAL_NEW_REF(EX(return_value), retval_ptr);
if (return_value) {
ZVAL_NEW_REF(return_value, retval_ptr);
} else {
}
@@ -37718,17 +37768,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(
}
}
if (EX(return_value)) {
if (return_value) {
if (Z_ISREF_P(retval_ptr)) {
Z_ADDREF_P(retval_ptr);
} else {
ZVAL_MAKE_REF_EX(retval_ptr, 2);
}
ZVAL_REF(EX(return_value), Z_REF_P(retval_ptr));
ZVAL_REF(return_value, Z_REF_P(retval_ptr));
}
} while (0);
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
@@ -50775,15 +50826,34 @@ ZEND_API void execute_ex(zend_execute_data *ex)
{
DCL_OPLINE
#if defined(ZEND_VM_IP_GLOBAL_REG) || defined(ZEND_VM_IP_GLOBAL_REG)
struct {
#ifdef ZEND_VM_IP_GLOBAL_REG
const zend_op *orig_opline = opline;
const zend_op *orig_opline;
#endif
#ifdef ZEND_VM_FP_GLOBAL_REG
zend_execute_data *orig_execute_data = execute_data;
zend_execute_data *orig_execute_data;
#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE
char hybrid_jit_red_zone[ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE];
#endif
#endif
} vm_stack_data;
#endif
#ifdef ZEND_VM_IP_GLOBAL_REG
vm_stack_data.orig_opline = opline;
#endif
#ifdef ZEND_VM_FP_GLOBAL_REG
vm_stack_data.orig_execute_data = execute_data;
execute_data = ex;
#else
zend_execute_data *execute_data = ex;
#endif
#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE
memset(vm_stack_data.hybrid_jit_red_zone, 0, ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE);
if (zend_touch_vm_stack_data) {
zend_touch_vm_stack_data(&vm_stack_data);
}
#endif
#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)
if (UNEXPECTED(execute_data == NULL)) {
@@ -54674,6 +54744,7 @@ zend_leave_helper_SPEC_LABEL:
retval_ptr = RT_CONSTANT(opline, opline->op1);
return_value = EX(return_value);
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) {
SAVE_OPLINE();
retval_ptr = ZVAL_UNDEFINED_OP1();
@@ -54736,6 +54807,8 @@ zend_leave_helper_SPEC_LABEL:
}
}
goto zend_leave_helper_SPEC_LABEL;
}
@@ -54745,9 +54818,11 @@ zend_leave_helper_SPEC_LABEL:
USE_OPLINE
zval *retval_ptr;
zval *return_value;
zval observer_retval;
retval_ptr = get_zval_ptr_undef(opline->op1_type, opline->op1, BP_VAR_R);
return_value = EX(return_value);
if (!return_value) { return_value = &observer_retval; };
if (opline->op1_type == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) {
SAVE_OPLINE();
retval_ptr = ZVAL_UNDEFINED_OP1();
@@ -54809,7 +54884,9 @@ zend_leave_helper_SPEC_LABEL:
}
}
}
SAVE_OPLINE();
zend_observer_fcall_end(execute_data, return_value);
if (return_value == &observer_retval) { zval_ptr_dtor_nogc(&observer_retval); };
goto zend_leave_helper_SPEC_LABEL;
}
@@ -56282,6 +56359,7 @@ zend_leave_helper_SPEC_LABEL:
retval_ptr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC);
return_value = EX(return_value);
if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) {
SAVE_OPLINE();
retval_ptr = ZVAL_UNDEFINED_OP1();
@@ -56344,6 +56422,8 @@ zend_leave_helper_SPEC_LABEL:
}
}
goto zend_leave_helper_SPEC_LABEL;
}
@@ -56580,6 +56660,7 @@ zend_leave_helper_SPEC_LABEL:
retval_ptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC);
return_value = EX(return_value);
if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) {
SAVE_OPLINE();
retval_ptr = ZVAL_UNDEFINED_OP1();
@@ -56642,6 +56723,8 @@ zend_leave_helper_SPEC_LABEL:
}
}
goto zend_leave_helper_SPEC_LABEL;
}
@@ -57694,6 +57777,7 @@ zend_leave_helper_SPEC_LABEL:
retval_ptr = EX_VAR(opline->op1.var);
return_value = EX(return_value);
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) {
SAVE_OPLINE();
retval_ptr = ZVAL_UNDEFINED_OP1();
@@ -57756,6 +57840,8 @@ zend_leave_helper_SPEC_LABEL:
}
}
goto zend_leave_helper_SPEC_LABEL;
}
@@ -58721,10 +58807,10 @@ zend_leave_helper_SPEC_LABEL:
HYBRID_BREAK();
HYBRID_CASE(HYBRID_HALT):
#ifdef ZEND_VM_FP_GLOBAL_REG
execute_data = orig_execute_data;
execute_data = vm_stack_data.orig_execute_data;
#endif
#ifdef ZEND_VM_IP_GLOBAL_REG
opline = orig_opline;
opline = vm_stack_data.orig_opline;
#endif
return;
HYBRID_DEFAULT:
@@ -58733,9 +58819,9 @@ zend_leave_helper_SPEC_LABEL:
HYBRID_BREAK(); /* Never reached */
#else
#ifdef ZEND_VM_FP_GLOBAL_REG
execute_data = orig_execute_data;
execute_data = vm_stack_data.orig_execute_data;
# ifdef ZEND_VM_IP_GLOBAL_REG
opline = orig_opline;
opline = vm_stack_data.orig_opline;
# endif
return;
#else
@@ -58744,7 +58830,7 @@ zend_leave_helper_SPEC_LABEL:
ZEND_VM_LOOP_INTERRUPT_CHECK();
} else {
# ifdef ZEND_VM_IP_GLOBAL_REG
opline = orig_opline;
opline = vm_stack_data.orig_opline;
# endif
return;
}
+36 -7
View File
@@ -794,6 +794,10 @@ function gen_code($f, $spec, $kind, $code, $op1, $op2, $name, $extra_spec=null)
($extra_spec['ISSET'] == 0 ? "\\0" : "opline->extended_value")
: "\\0",
"/ZEND_OBSERVER_ENABLED/" => isset($extra_spec['OBSERVER']) && $extra_spec['OBSERVER'] == 1 ? "1" : "0",
"/ZEND_OBSERVER_USE_RETVAL/" => isset($extra_spec['OBSERVER']) && $extra_spec['OBSERVER'] == 1 ? "zval observer_retval" : "",
"/ZEND_OBSERVER_SET_RETVAL\(\)/" => isset($extra_spec['OBSERVER']) && $extra_spec['OBSERVER'] == 1 ? "if (!return_value) { return_value = &observer_retval; }" : "",
"/ZEND_OBSERVER_FREE_RETVAL\(\)/" => isset($extra_spec['OBSERVER']) && $extra_spec['OBSERVER'] == 1 ? "if (return_value == &observer_retval) { zval_ptr_dtor_nogc(&observer_retval); }" : "",
"/ZEND_OBSERVER_SAVE_OPLINE\(\)/" => isset($extra_spec['OBSERVER']) && $extra_spec['OBSERVER'] == 1 ? "SAVE_OPLINE()" : "",
"/ZEND_OBSERVER_FCALL_BEGIN\(\s*(.*)\s*\)/" => isset($extra_spec['OBSERVER']) ?
($extra_spec['OBSERVER'] == 0 ? "" : "zend_observer_fcall_begin(\\1)")
: "",
@@ -1776,10 +1780,10 @@ function gen_executor_code($f, $spec, $kind, $prolog, &$switch_labels = array())
case ZEND_VM_KIND_HYBRID:
out($f,"\t\t\tHYBRID_CASE(HYBRID_HALT):\n");
out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
out($f,"\t\t\t\texecute_data = orig_execute_data;\n");
out($f,"\t\t\t\texecute_data = vm_stack_data.orig_execute_data;\n");
out($f,"#endif\n");
out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
out($f,"\t\t\t\topline = orig_opline;\n");
out($f,"\t\t\t\topline = vm_stack_data.orig_opline;\n");
out($f,"#endif\n");
out($f,"\t\t\t\treturn;\n");
out($f,"\t\t\tHYBRID_DEFAULT:\n");
@@ -2061,15 +2065,34 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
out($f,$m[1]."zend_execute_data *execute_data = ex;\n");
out($f,"#endif\n");
} else {
out($f,"#if defined(ZEND_VM_IP_GLOBAL_REG) || defined(ZEND_VM_IP_GLOBAL_REG)\n");
out($f,$m[1]."struct {\n");
out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
out($f,$m[1]."const zend_op *orig_opline = opline;\n");
out($f,$m[1]."\tconst zend_op *orig_opline;\n");
out($f,"#endif\n");
out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
out($f,$m[1]."zend_execute_data *orig_execute_data = execute_data;\n");
out($f,$m[1]."\tzend_execute_data *orig_execute_data;\n");
out($f,"#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE\n");
out($f,$m[1]."\tchar hybrid_jit_red_zone[ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE];\n");
out($f,"#endif\n");
out($f,"#endif\n");
out($f,$m[1]."} vm_stack_data;\n");
out($f,"#endif\n");
out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
out($f,$m[1]."vm_stack_data.orig_opline = opline;\n");
out($f,"#endif\n");
out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
out($f,$m[1]."vm_stack_data.orig_execute_data = execute_data;\n");
out($f,$m[1]."execute_data = ex;\n");
out($f,"#else\n");
out($f,$m[1]."zend_execute_data *execute_data = ex;\n");
out($f,"#endif\n");
out($f,"#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE\n");
out($f,$m[1]."memset(vm_stack_data.hybrid_jit_red_zone, 0, ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE);\n");
out($f,$m[1]."if (zend_touch_vm_stack_data) {\n");
out($f,$m[1]."\tzend_touch_vm_stack_data(&vm_stack_data);\n");
out($f,$m[1]."}\n");
out($f,"#endif\n");
}
break;
case "INTERNAL_LABELS":
@@ -2155,9 +2178,9 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
}
out($f,
"#ifdef ZEND_VM_FP_GLOBAL_REG\n" .
$m[1]."execute_data = orig_execute_data;\n" .
$m[1]."execute_data = vm_stack_data.orig_execute_data;\n" .
"# ifdef ZEND_VM_IP_GLOBAL_REG\n" .
$m[1]."opline = orig_opline;\n" .
$m[1]."opline = vm_stack_data.orig_opline;\n" .
"# endif\n" .
$m[1]."return;\n" .
"#else\n" .
@@ -2166,7 +2189,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
$m[1]."\tZEND_VM_LOOP_INTERRUPT_CHECK();\n".
$m[1]."} else {\n" .
"# ifdef ZEND_VM_IP_GLOBAL_REG\n" .
$m[1]."\topline = orig_opline;\n" .
$m[1]."\topline = vm_stack_data.orig_opline;\n" .
"# endif\n".
$m[1]."\treturn;\n".
$m[1]."}\n".
@@ -2574,6 +2597,12 @@ function gen_vm($def, $skel) {
fputs($f, "#define ZEND_VM_KIND\t\t" . $GLOBALS["vm_kind_name"][ZEND_VM_KIND] . "\n");
}
fputs($f, "\n");
fputs($f, "#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) && !defined(__SANITIZE_ADDRESS__)\n");
fputs($f, "# if ((defined(i386) && !defined(__PIC__)) || defined(__x86_64__) || defined(_M_X64))\n");
fputs($f, "# define ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE 16\n");
fputs($f, "# endif\n");
fputs($f, "#endif\n");
fputs($f, "\n");
foreach($vm_op_flags as $name => $val) {
fprintf($f, "#define %-24s 0x%08x\n", $name, $val);
}
+6
View File
@@ -34,6 +34,12 @@
# define ZEND_VM_KIND ZEND_VM_KIND_CALL
#endif
#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) && !defined(__SANITIZE_ADDRESS__)
# if ((defined(i386) && !defined(__PIC__)) || defined(__x86_64__) || defined(_M_X64))
# define ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE 16
# endif
#endif
#define ZEND_VM_OP_SPEC 0x00000001
#define ZEND_VM_OP_CONST 0x00000002
#define ZEND_VM_OP_TMPVAR 0x00000004
+1
View File
@@ -102,6 +102,7 @@ jobs:
exit 1
fi
displayName: 'Test PHPUnit'
- script: |
php7.3 /usr/bin/composer create-project symfony/symfony-demo symfony_demo --no-progress
cd symfony_demo
export USE_ZEND_ALLOC=0
+4 -1
View File
@@ -32,10 +32,13 @@ jobs:
runTestsParameters: >-
${{ parameters.runTestsParameters }}
-d zend_extension=opcache.so
- script: bash <(curl -s https://codecov.io/bash)
displayName: 'Upload ${{ parameters.configurationName }} Test Coverage to Codecov.io'
condition: or(succeeded(), failed())
- script: |
make gcovr-xml
mv gcovr.xml coverage.xml
displayName: 'Generate ${{ parameters.configurationName }} Test Coverage'
displayName: 'Generate ${{ parameters.configurationName }} Test Coverage Cobertura XML Report'
condition: or(succeeded(), failed())
- task: PublishCodeCoverageResults@1
inputs:
+2 -2
View File
@@ -20,8 +20,8 @@ steps:
set -e
sudo groupadd -g 5000 vmail
sudo useradd -m -d /var/vmail -s /bin/false -u 5000 -g vmail vmail
sudo cp ext/imap/tests/dovecot.conf /etc/dovecot/dovecot.conf
sudo cp ext/imap/tests/dovecotpass /etc/dovecot/dovecotpass
sudo cp ext/imap/tests/setup/dovecot.conf /etc/dovecot/dovecot.conf
sudo cp ext/imap/tests/setup/dovecotpass /etc/dovecot/dovecotpass
sudo service dovecot restart
displayName: 'Configure IMAP'
+3 -3
View File
@@ -340,7 +340,7 @@ AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
10.[[012]]*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
10.*)
*)
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
esac
;;
@@ -1522,7 +1522,7 @@ darwin* | rhapsody*)
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
ifelse([$1], [],[
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -5800,7 +5800,7 @@ _LT_EOF
10.[[012]])
_LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
;;
10.*)
*)
_LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
;;
esac
+1 -1
View File
@@ -478,7 +478,7 @@ dnl Internal, don't use.
dnl
AC_DEFUN([_PHP_ADD_LIBRARY_SKELETON],[
case $1 in
c|c_r|pthread*[)] ;;
c|c_r[)] ;;
*[)] ifelse($3,,[
_PHP_X_ADD_LIBRARY($1,$2,$5)
],[
+14 -8
View File
@@ -17,7 +17,7 @@ dnl Basic autoconf initialization, generation of config.nice.
dnl ----------------------------------------------------------------------------
AC_PREREQ([2.68])
AC_INIT([PHP],[8.0.0RC4],[https://bugs.php.net],[php],[https://www.php.net])
AC_INIT([PHP],[8.0.1],[https://bugs.php.net],[php],[https://www.php.net])
AC_CONFIG_SRCDIR([main/php_version.h])
AC_CONFIG_AUX_DIR([build])
AC_PRESERVE_HELP_ORDER
@@ -797,6 +797,19 @@ if test "$PHP_DEBUG_ASSERTIONS" = "yes"; then
ZEND_DEBUG=yes
fi
AC_ARG_ENABLE([zts],
[AS_HELP_STRING([--enable-zts],
[Enable thread safety])],
[ZEND_ZTS=$enableval],
[ZEND_ZTS=no])
if test "$ZEND_ZTS" = "yes"; then
AC_DEFINE(ZTS, 1,[ ])
PHP_THREAD_SAFETY=yes
else
PHP_THREAD_SAFETY=no
fi
PHP_ARG_ENABLE([rtld-now],
[whether to dlopen extensions with RTLD_NOW instead of RTLD_LAZY],
[AS_HELP_STRING([--enable-rtld-now],
@@ -1136,13 +1149,6 @@ LIBZEND_BASIC_CHECKS
LIBZEND_DLSYM_CHECK
LIBZEND_OTHER_CHECKS
if test "$ZEND_ZTS" = "yes"; then
AC_DEFINE(ZTS,1,[ ])
PHP_THREAD_SAFETY=yes
else
PHP_THREAD_SAFETY=no
fi
INCLUDES="$INCLUDES -I\$(top_builddir)/TSRM"
INCLUDES="$INCLUDES -I\$(top_builddir)/Zend"
+1 -1
View File
@@ -70,7 +70,6 @@ bc_sqrt (bc_num *num, int scale)
/* Initialize the variables. */
rscale = MAX (scale, (*num)->n_scale);
bc_init_num(&guess);
bc_init_num(&guess1);
bc_init_num(&diff);
point5 = bc_new_num (1,1);
@@ -87,6 +86,7 @@ bc_sqrt (bc_num *num, int scale)
else
{
/* The number is greater than 1. Guess should start at 10^(exp/2). */
bc_init_num(&guess);
bc_int2num (&guess,10);
bc_int2num (&guess1,(*num)->n_len);
+2
View File
@@ -9,8 +9,10 @@ bcmath.scale=0
echo bcsqrt("9"),"\n";
echo bcsqrt("9.444", 2),"\n";
echo bcsqrt("1928372132132819737213", 5),"\n";
echo bcsqrt("0.5", 5), "\n";
?>
--EXPECT--
3
3.07
43913234134.28826
0.70710
+1 -1
View File
@@ -4,7 +4,7 @@
final class COMPersistHelper
{
public function __construct(?variant $variant) {}
public function __construct(?variant $variant = null) {}
public function GetCurFileName(): string|false {}
+3 -3
View File
@@ -1,8 +1,8 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: d04d007cac328014c6cc76a00cc291237965d56d */
* Stub hash: 2c2759e6c1894713439e3ee8da7f56810d00d8cf */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_COMPersistHelper___construct, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, variant, variant, 1)
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_COMPersistHelper___construct, 0, 0, 0)
ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, variant, variant, 1, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_COMPersistHelper_GetCurFileName, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
+93 -93
View File
@@ -34,7 +34,7 @@ foreach ($values as $t => $val) {
echo "$op:\n";
echo "\tvariant_$op($v, $op2)\n";
echo "\texception " . $e->getMessage();
printf("\tcode %08x\n\n", $e->getCode());
printf("\n\tcode %08x\n\n", $e->getCode());
}
}
}
@@ -74,63 +74,63 @@ xor: 46
--
add:
variant_add(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
cat: 42hello
sub:
variant_sub(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
mul:
variant_mul(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
and:
variant_and(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
div:
variant_div(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
eqv:
variant_eqv(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
idiv:
variant_idiv(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
imp:
variant_imp(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
mod:
variant_mod(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
or:
variant_or(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
pow:
variant_pow(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
xor:
variant_xor(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
--
@@ -141,19 +141,19 @@ mul: 0
and: 0
div:
variant_div(42, )
exception Division by zero.
exception Division by zero
code 80020012
eqv: -43
idiv:
variant_idiv(42, )
exception Division by zero.
exception Division by zero
code 80020012
imp: -43
mod:
variant_mod(42, )
exception Division by zero.
exception Division by zero
code 80020012
or: 42
@@ -190,63 +190,63 @@ xor: 0
--
add:
variant_add(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
cat: 3.5hello
sub:
variant_sub(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
mul:
variant_mul(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
and:
variant_and(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
div:
variant_div(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
eqv:
variant_eqv(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
idiv:
variant_idiv(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
imp:
variant_imp(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
mod:
variant_mod(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
or:
variant_or(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
pow:
variant_pow(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
xor:
variant_xor(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
--
@@ -257,19 +257,19 @@ mul: 0
and: 0
div:
variant_div(3.5, )
exception Division by zero.
exception Division by zero
code 80020012
eqv: -5
idiv:
variant_idiv(3.5, )
exception Division by zero.
exception Division by zero
code 80020012
imp: -5
mod:
variant_mod(3.5, )
exception Division by zero.
exception Division by zero
code 80020012
or: 4
@@ -278,125 +278,125 @@ xor: 4
--
add:
variant_add(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
cat: hello42
sub:
variant_sub(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
mul:
variant_mul(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
and:
variant_and(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
div:
variant_div(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
eqv:
variant_eqv(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
idiv:
variant_idiv(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
imp:
variant_imp(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
mod:
variant_mod(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
or:
variant_or(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
pow:
variant_pow(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
xor:
variant_xor(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
--
add:
variant_add(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
cat: hello3.5
sub:
variant_sub(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
mul:
variant_mul(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
and:
variant_and(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
div:
variant_div(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
eqv:
variant_eqv(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
idiv:
variant_idiv(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
imp:
variant_imp(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
mod:
variant_mod(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
or:
variant_or(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
pow:
variant_pow(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
xor:
variant_xor(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
--
@@ -404,119 +404,119 @@ add: hellohello
cat: hellohello
sub:
variant_sub(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
mul:
variant_mul(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
and:
variant_and(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
div:
variant_div(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
eqv:
variant_eqv(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
idiv:
variant_idiv(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
imp:
variant_imp(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
mod:
variant_mod(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
or:
variant_or(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
pow:
variant_pow(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
xor:
variant_xor(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
--
add:
variant_add(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
cat: helloFalse
sub:
variant_sub(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
mul:
variant_mul(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
and:
variant_and(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
div:
variant_div(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
eqv:
variant_eqv(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
idiv:
variant_idiv(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
imp:
variant_imp(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
mod:
variant_mod(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
or:
variant_or(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
pow:
variant_pow(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
xor:
variant_xor(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
--
@@ -550,63 +550,63 @@ xor: 4
--
add:
variant_add(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
cat: Falsehello
sub:
variant_sub(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
mul:
variant_mul(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
and:
variant_and(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
div:
variant_div(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
eqv:
variant_eqv(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
idiv:
variant_idiv(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
imp:
variant_imp(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
mod:
variant_mod(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
or:
variant_or(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
pow:
variant_pow(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
xor:
variant_xor(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
--
@@ -617,19 +617,19 @@ mul: 0
and: 0
div:
variant_div(0, )
exception Out of present range.
exception Out of present range
code 8002000a
eqv: -1
idiv:
variant_idiv(0, )
exception Division by zero.
exception Division by zero
code 80020012
imp: -1
mod:
variant_mod(0, )
exception Division by zero.
exception Division by zero
code 80020012
or: 0
+93 -93
View File
@@ -37,7 +37,7 @@ foreach ($values as $t => $val) {
echo "$op:\n";
echo "\tvariant_$op($v, $op2)\n";
echo "\texception " . $e->getMessage();
printf("\tcode %08x\n\n", $e->getCode());
printf("\n\tcode %08x\n\n", $e->getCode());
}
}
}
@@ -77,63 +77,63 @@ xor: 46
--
add:
variant_add(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
cat: 42hello
sub:
variant_sub(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
mul:
variant_mul(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
and:
variant_and(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
div:
variant_div(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
eqv:
variant_eqv(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
idiv:
variant_idiv(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
imp:
variant_imp(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
mod:
variant_mod(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
or:
variant_or(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
pow:
variant_pow(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
xor:
variant_xor(42, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
--
@@ -144,19 +144,19 @@ mul: 0
and: 0
div:
variant_div(42, )
exception Division by zero.
exception Division by zero
code 80020012
eqv: -43
idiv:
variant_idiv(42, )
exception Division by zero.
exception Division by zero
code 80020012
imp: -43
mod:
variant_mod(42, )
exception Division by zero.
exception Division by zero
code 80020012
or: 42
@@ -193,63 +193,63 @@ xor: 0
--
add:
variant_add(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
cat: 3.5hello
sub:
variant_sub(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
mul:
variant_mul(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
and:
variant_and(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
div:
variant_div(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
eqv:
variant_eqv(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
idiv:
variant_idiv(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
imp:
variant_imp(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
mod:
variant_mod(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
or:
variant_or(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
pow:
variant_pow(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
xor:
variant_xor(3.5, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
--
@@ -260,19 +260,19 @@ mul: 0
and: 0
div:
variant_div(3.5, )
exception Division by zero.
exception Division by zero
code 80020012
eqv: -5
idiv:
variant_idiv(3.5, )
exception Division by zero.
exception Division by zero
code 80020012
imp: -5
mod:
variant_mod(3.5, )
exception Division by zero.
exception Division by zero
code 80020012
or: 4
@@ -281,125 +281,125 @@ xor: 4
--
add:
variant_add(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
cat: hello42
sub:
variant_sub(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
mul:
variant_mul(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
and:
variant_and(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
div:
variant_div(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
eqv:
variant_eqv(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
idiv:
variant_idiv(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
imp:
variant_imp(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
mod:
variant_mod(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
or:
variant_or(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
pow:
variant_pow(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
xor:
variant_xor(hello, 42)
exception Type mismatch.
exception Type mismatch
code 80020005
--
add:
variant_add(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
cat: hello3.5
sub:
variant_sub(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
mul:
variant_mul(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
and:
variant_and(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
div:
variant_div(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
eqv:
variant_eqv(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
idiv:
variant_idiv(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
imp:
variant_imp(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
mod:
variant_mod(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
or:
variant_or(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
pow:
variant_pow(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
xor:
variant_xor(hello, 3.5)
exception Type mismatch.
exception Type mismatch
code 80020005
--
@@ -407,119 +407,119 @@ add: hellohello
cat: hellohello
sub:
variant_sub(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
mul:
variant_mul(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
and:
variant_and(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
div:
variant_div(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
eqv:
variant_eqv(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
idiv:
variant_idiv(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
imp:
variant_imp(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
mod:
variant_mod(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
or:
variant_or(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
pow:
variant_pow(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
xor:
variant_xor(hello, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
--
add:
variant_add(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
cat: helloFalse
sub:
variant_sub(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
mul:
variant_mul(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
and:
variant_and(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
div:
variant_div(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
eqv:
variant_eqv(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
idiv:
variant_idiv(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
imp:
variant_imp(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
mod:
variant_mod(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
or:
variant_or(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
pow:
variant_pow(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
xor:
variant_xor(hello, )
exception Type mismatch.
exception Type mismatch
code 80020005
--
@@ -553,63 +553,63 @@ xor: 4
--
add:
variant_add(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
cat: Falsehello
sub:
variant_sub(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
mul:
variant_mul(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
and:
variant_and(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
div:
variant_div(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
eqv:
variant_eqv(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
idiv:
variant_idiv(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
imp:
variant_imp(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
mod:
variant_mod(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
or:
variant_or(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
pow:
variant_pow(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
xor:
variant_xor(0, hello)
exception Type mismatch.
exception Type mismatch
code 80020005
--
@@ -620,19 +620,19 @@ mul: 0
and: 0
div:
variant_div(0, )
exception Out of present range.
exception Out of present range
code 8002000a
eqv: -1
idiv:
variant_idiv(0, )
exception Division by zero.
exception Division by zero
code 80020012
imp: -1
mod:
variant_mod(0, )
exception Division by zero.
exception Division by zero
code 80020012
or: 0
+1 -1
View File
@@ -28,7 +28,7 @@ if (PHP_CURL != "no") {
) {
EXTENSION("curl", "interface.c multi.c share.c curl_file.c");
AC_DEFINE('HAVE_CURL', 1, 'Have cURL library');
ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB");
ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB /D PHP_CURL_EXPORTS=1");
PHP_INSTALL_HEADERS("ext/curl", "php_curl.h");
// TODO: check for curl_version_info
} else {
+1 -1
View File
@@ -48,7 +48,7 @@ function curl_multi_errno(CurlMultiHandle $multi_handle): int {}
/** @param int $still_running */
function curl_multi_exec(CurlMultiHandle $multi_handle, &$still_running): int {}
function curl_multi_getcontent(CurlHandle $multi_handle): ?string {}
function curl_multi_getcontent(CurlHandle $handle): ?string {}
/** @param int $queued_messages */
function curl_multi_info_read(CurlMultiHandle $multi_handle, &$queued_messages = null): array|false {}
+2 -2
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: afeae538b49eb43a661e5b491da79c17d10c6bfe */
* Stub hash: f1d616c644ad366405816cde0384f6f391773ebf */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_close, 0, 1, IS_VOID, 0)
ZEND_ARG_OBJ_INFO(0, handle, CurlHandle, 0)
@@ -74,7 +74,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_multi_exec, 0, 2, IS_LONG,
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_multi_getcontent, 0, 1, IS_STRING, 1)
ZEND_ARG_OBJ_INFO(0, multi_handle, CurlHandle, 0)
ZEND_ARG_OBJ_INFO(0, handle, CurlHandle, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_curl_multi_info_read, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
+3 -1
View File
@@ -104,6 +104,8 @@ typedef struct {
zend_bool in_callback;
uint32_t* clone;
zval postfields;
/* CurlShareHandle object set using CURLOPT_SHARE. */
struct _php_curlsh *share;
zend_object std;
} php_curl;
@@ -124,7 +126,7 @@ typedef struct {
zend_object std;
} php_curlm;
typedef struct {
typedef struct _php_curlsh {
CURLSH *share;
struct {
int no;
+10
View File
@@ -2832,6 +2832,12 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue, bool i
if (Z_TYPE_P(zvalue) == IS_OBJECT && Z_OBJCE_P(zvalue) == curl_share_ce) {
php_curlsh *sh = Z_CURL_SHARE_P(zvalue);
curl_easy_setopt(ch->cp, CURLOPT_SHARE, sh->share);
if (ch->share) {
OBJ_RELEASE(&ch->share->std);
}
GC_ADDREF(&sh->std);
ch->share = sh;
}
}
break;
@@ -3373,6 +3379,10 @@ static void curl_free_obj(zend_object *object)
efree(ch->handlers);
zval_ptr_dtor(&ch->postfields);
if (ch->share) {
OBJ_RELEASE(&ch->share->std);
}
zend_object_std_dtor(&ch->std);
}
/* }}} */
+5 -1
View File
@@ -21,7 +21,11 @@
#include "php.h"
#ifdef PHP_WIN32
# define PHP_CURL_API __declspec(dllexport)
# ifdef PHP_CURL_EXPORTS
# define PHP_CURL_API __declspec(dllexport)
# else
# define PHP_CURL_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) && __GNUC__ >= 4
# define PHP_CURL_API __attribute__ ((visibility("default")))
#else
+29
View File
@@ -0,0 +1,29 @@
--TEST--
Basic curl_share test
--FILE--
<?php
$sh = curl_share_init();
$ch1 = curl_init();
curl_setopt($ch1, CURLOPT_URL, 'file://' . __DIR__ . '/curl_testdata1.txt');
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch1, CURLOPT_SHARE, $sh);
$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_URL, 'file://' . __DIR__ . '/curl_testdata2.txt');
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch2, CURLOPT_SHARE, $sh);
// Make sure nothing bad handles if the share handle is unset early.
unset($sh);
var_dump(curl_exec($ch1));
var_dump(curl_exec($ch2));
?>
--EXPECT--
string(6) "CURL1
"
string(6) "CURL2
"
+1 -1
View File
@@ -1,4 +1,4 @@
VERSION=5.37
VERSION=5.39
if [[ ! -d libmagic.orig ]]; then
mkdir libmagic.orig
wget -O - ftp://ftp.astron.com/pub/file/file-$VERSION.tar.gz \
+57 -50
View File
@@ -1,6 +1,6 @@
diff -ur libmagic.orig/apprentice.c libmagic/apprentice.c
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
--- libmagic.orig/apprentice.c 2020-05-09 20:57:15.000000000 +0200
+++ libmagic/apprentice.c 2020-08-29 19:56:29.638061530 +0200
+++ libmagic/apprentice.c 2020-11-07 14:41:13.543842900 +0100
@@ -29,6 +29,8 @@
* apprentice - make one pass through /etc/magic, learning its secrets.
*/
@@ -927,9 +927,9 @@ diff -ur libmagic.orig/apprentice.c libmagic/apprentice.c
m->str_range = swap4(m->str_range);
m->str_flags = swap4(m->str_flags);
}
diff -ur libmagic.orig/ascmagic.c libmagic/ascmagic.c
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
--- libmagic.orig/ascmagic.c 2020-06-15 02:01:01.000000000 +0200
+++ libmagic/ascmagic.c 2020-08-29 02:05:56.212049441 +0200
+++ libmagic/ascmagic.c 2020-11-07 14:41:13.543842900 +0100
@@ -50,7 +50,7 @@
#define ISSPC(x) ((x) == ' ' || (x) == '\t' || (x) == '\r' || (x) == '\n' \
|| (x) == 0x85 || (x) == '\f')
@@ -993,9 +993,9 @@ diff -ur libmagic.orig/ascmagic.c libmagic/ascmagic.c
{
size_t i;
unsigned char *end = buf + len;
diff -ur libmagic.orig/buffer.c libmagic/buffer.c
diff -u libmagic.orig/buffer.c libmagic/buffer.c
--- libmagic.orig/buffer.c 2020-02-16 16:52:49.000000000 +0100
+++ libmagic/buffer.c 2020-08-29 02:05:56.212049441 +0200
+++ libmagic/buffer.c 2020-11-07 14:41:13.543842900 +0100
@@ -31,19 +31,23 @@
#endif /* lint */
@@ -1049,9 +1049,9 @@ diff -ur libmagic.orig/buffer.c libmagic/buffer.c
b->ebuf = NULL;
goto out;
}
diff -ur libmagic.orig/cdf.c libmagic/cdf.c
diff -u libmagic.orig/cdf.c libmagic/cdf.c
--- libmagic.orig/cdf.c 2019-09-30 17:42:50.000000000 +0200
+++ libmagic/cdf.c 2020-08-29 02:05:56.212049441 +0200
+++ libmagic/cdf.c 2020-11-07 14:41:13.559464400 +0100
@@ -43,7 +43,17 @@
#include <err.h>
#endif
@@ -1284,9 +1284,9 @@ diff -ur libmagic.orig/cdf.c libmagic/cdf.c
}
#endif
diff -ur libmagic.orig/cdf.h libmagic/cdf.h
diff -u libmagic.orig/cdf.h libmagic/cdf.h
--- libmagic.orig/cdf.h 2019-09-30 17:42:50.000000000 +0200
+++ libmagic/cdf.h 2020-07-04 12:40:36.663619335 +0200
+++ libmagic/cdf.h 2020-10-09 14:15:33.483358900 +0200
@@ -35,10 +35,10 @@
#ifndef _H_CDF_
#define _H_CDF_
@@ -1301,9 +1301,9 @@ diff -ur libmagic.orig/cdf.h libmagic/cdf.h
#endif
#ifdef __DJGPP__
#define timespec timeval
diff -ur libmagic.orig/cdf_time.c libmagic/cdf_time.c
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
--- libmagic.orig/cdf_time.c 2019-03-12 21:43:05.000000000 +0100
+++ libmagic/cdf_time.c 2020-07-04 12:40:36.667619309 +0200
+++ libmagic/cdf_time.c 2020-10-09 14:15:33.484360000 +0200
@@ -23,6 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
@@ -1330,9 +1330,9 @@ diff -ur libmagic.orig/cdf_time.c libmagic/cdf_time.c
if (ptr != NULL)
return buf;
(void)snprintf(buf, 26, "*Bad* %#16.16" INT64_T_FORMAT "x\n",
diff -ur libmagic.orig/compress.c libmagic/compress.c
diff -u libmagic.orig/compress.c libmagic/compress.c
--- libmagic.orig/compress.c 2020-05-31 02:11:06.000000000 +0200
+++ libmagic/compress.c 2020-08-29 02:05:56.212049441 +0200
+++ libmagic/compress.c 2020-11-07 14:41:13.559464400 +0100
@@ -51,7 +51,7 @@
#ifndef HAVE_SIG_T
typedef void (*sig_t)(int);
@@ -1467,9 +1467,9 @@ diff -ur libmagic.orig/compress.c libmagic/compress.c
}
#endif
+#endif
diff -ur libmagic.orig/der.c libmagic/der.c
diff -u libmagic.orig/der.c libmagic/der.c
--- libmagic.orig/der.c 2020-06-15 02:01:01.000000000 +0200
+++ libmagic/der.c 2020-08-29 11:56:12.303522747 +0200
+++ libmagic/der.c 2020-11-07 14:41:13.559464400 +0100
@@ -54,7 +54,9 @@
#include "magic.h"
#include "der.h"
@@ -1480,9 +1480,9 @@ diff -ur libmagic.orig/der.c libmagic/der.c
#include <sys/stat.h>
#include <err.h>
#endif
diff -ur libmagic.orig/elfclass.h libmagic/elfclass.h
diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
--- libmagic.orig/elfclass.h 2019-02-20 02:30:19.000000000 +0100
+++ libmagic/elfclass.h 2020-07-04 12:40:36.667619309 +0200
+++ libmagic/elfclass.h 2020-10-09 14:15:33.488358700 +0200
@@ -41,7 +41,7 @@
return toomany(ms, "program headers", phnum);
flags |= FLAGS_IS_CORE;
@@ -1510,9 +1510,9 @@ diff -ur libmagic.orig/elfclass.h libmagic/elfclass.h
CAST(size_t, elf_getu16(swap, elfhdr.e_shentsize)),
fsize, elf_getu16(swap, elfhdr.e_machine),
CAST(int, elf_getu16(swap, elfhdr.e_shstrndx)),
diff -ur libmagic.orig/encoding.c libmagic/encoding.c
diff -u libmagic.orig/encoding.c libmagic/encoding.c
--- libmagic.orig/encoding.c 2019-06-10 23:34:41.000000000 +0200
+++ libmagic/encoding.c 2020-08-29 02:05:56.212049441 +0200
+++ libmagic/encoding.c 2020-11-07 14:41:13.559464400 +0100
@@ -43,14 +43,14 @@
#include <stdlib.h>
@@ -1700,9 +1700,9 @@ diff -ur libmagic.orig/encoding.c libmagic/encoding.c
if (ubf[*ulen - 1] == 0xfffe)
return 0;
diff -ur libmagic.orig/file.h libmagic/file.h
diff -u libmagic.orig/file.h libmagic/file.h
--- libmagic.orig/file.h 2020-06-15 02:01:01.000000000 +0200
+++ libmagic/file.h 2020-09-02 17:35:51.709611515 +0200
+++ libmagic/file.h 2020-11-24 13:44:41.506472900 +0100
@@ -33,17 +33,13 @@
#ifndef __file_h__
#define __file_h__
@@ -1725,7 +1725,7 @@ diff -ur libmagic.orig/file.h libmagic/file.h
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
@@ -79,10 +75,11 @@
@@ -79,23 +75,26 @@
#include <stdio.h> /* Include that here, to make sure __P gets defined */
#include <errno.h>
#include <fcntl.h> /* For open and flags */
@@ -1740,7 +1740,14 @@ diff -ur libmagic.orig/file.h libmagic/file.h
#include <sys/param.h>
#endif
/* Do this here and now, because struct stat gets re-defined on solaris */
@@ -95,7 +92,7 @@
#include <sys/stat.h>
#include <stdarg.h>
+#define abort() zend_error_noreturn(E_ERROR, "fatal libmagic error")
+
#define ENABLE_CONDITIONALS
#ifndef MAGIC
#define MAGIC "/etc/magic"
#endif
@@ -1749,7 +1756,7 @@ diff -ur libmagic.orig/file.h libmagic/file.h
#define PATHSEP ';'
#else
#define PATHSEP ':'
@@ -129,12 +126,6 @@
@@ -129,12 +128,6 @@
#endif
#endif
@@ -1762,7 +1769,7 @@ diff -ur libmagic.orig/file.h libmagic/file.h
#ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
@@ -161,10 +152,10 @@
@@ -161,10 +154,10 @@
struct buffer {
int fd;
@@ -1775,7 +1782,7 @@ diff -ur libmagic.orig/file.h libmagic/file.h
void *ebuf;
size_t elen;
};
@@ -258,7 +249,7 @@
@@ -258,7 +251,7 @@
#define FILE_OFFSET 50
#define FILE_NAMES_SIZE 51 /* size of array to contain all names */
@@ -1784,7 +1791,7 @@ diff -ur libmagic.orig/file.h libmagic/file.h
((t) == FILE_STRING || \
(t) == FILE_PSTRING || \
(t) == FILE_BESTRING16 || \
@@ -464,21 +455,17 @@
@@ -464,21 +457,17 @@
};
/* Type for Unicode characters */
@@ -1810,7 +1817,7 @@ diff -ur libmagic.orig/file.h libmagic/file.h
protected int file_separator(struct magic_set *);
protected char *file_copystr(char *, size_t, size_t, const char *);
protected int file_checkfmt(char *, size_t, const char *);
@@ -486,48 +473,42 @@
@@ -486,48 +475,42 @@
protected int file_print_guid(char *, size_t, const uint64_t *);
protected int file_parse_guid(const char *, uint64_t *);
protected int file_replace(struct magic_set *, const char *, const char *);
@@ -1867,7 +1874,7 @@ diff -ur libmagic.orig/file.h libmagic/file.h
size_t *);
protected size_t file_pstring_length_size(struct magic_set *,
const struct magic *);
@@ -539,34 +520,12 @@
@@ -539,34 +522,12 @@
size_t);
#endif /* __EMX__ */
@@ -1904,7 +1911,7 @@ diff -ur libmagic.orig/file.h libmagic/file.h
typedef struct {
char *buf;
@@ -582,23 +541,10 @@
@@ -582,23 +543,10 @@
extern const size_t file_nnames;
#endif
@@ -1930,7 +1937,7 @@ diff -ur libmagic.orig/file.h libmagic/file.h
size_t strlcat(char *, const char *, size_t);
#endif
#ifndef HAVE_STRCASESTR
@@ -614,39 +560,6 @@
@@ -614,39 +562,6 @@
#ifndef HAVE_ASCTIME_R
char *asctime_r(const struct tm *, char *);
#endif
@@ -1970,7 +1977,7 @@ diff -ur libmagic.orig/file.h libmagic/file.h
#if defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H) && !defined(QUICK)
#define QUICK
@@ -676,4 +589,16 @@
@@ -676,4 +591,16 @@
#define __RCSID(a)
#endif
@@ -1987,9 +1994,9 @@ diff -ur libmagic.orig/file.h libmagic/file.h
+#endif
+
#endif /* __file_h__ */
diff -ur libmagic.orig/fsmagic.c libmagic/fsmagic.c
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
--- libmagic.orig/fsmagic.c 2019-07-16 15:30:32.000000000 +0200
+++ libmagic/fsmagic.c 2020-08-29 02:05:56.212049441 +0200
+++ libmagic/fsmagic.c 2020-11-07 14:41:13.559464400 +0100
@@ -66,26 +66,10 @@
# define minor(dev) ((dev) & 0xff)
#endif
@@ -2280,9 +2287,9 @@ diff -ur libmagic.orig/fsmagic.c libmagic/fsmagic.c
#ifdef S_IFSOCK
#ifndef __COHERENT__
case S_IFSOCK:
diff -ur libmagic.orig/funcs.c libmagic/funcs.c
diff -u libmagic.orig/funcs.c libmagic/funcs.c
--- libmagic.orig/funcs.c 2020-02-20 16:50:20.000000000 +0100
+++ libmagic/funcs.c 2020-08-29 11:56:12.303522747 +0200
+++ libmagic/funcs.c 2020-11-07 14:41:13.559464400 +0100
@@ -48,6 +48,13 @@
#define SIZE_MAX ((size_t)~0)
#endif
@@ -2655,9 +2662,9 @@ diff -ur libmagic.orig/funcs.c libmagic/funcs.c
return rbuf;
}
diff -ur libmagic.orig/magic.c libmagic/magic.c
diff -u libmagic.orig/magic.c libmagic/magic.c
--- libmagic.orig/magic.c 2020-06-15 02:01:01.000000000 +0200
+++ libmagic/magic.c 2020-08-29 11:56:12.303522747 +0200
+++ libmagic/magic.c 2020-11-07 14:41:13.559464400 +0100
@@ -25,11 +25,6 @@
* SUCH DAMAGE.
*/
@@ -3131,9 +3138,9 @@ diff -ur libmagic.orig/magic.c libmagic/magic.c
return NULL;
}
return file_getbuffer(ms);
diff -ur libmagic.orig/magic.h libmagic/magic.h
--- libmagic.orig/magic.h 2020-06-29 01:13:35.424557511 +0200
+++ libmagic/magic.h 2020-08-29 02:05:56.212049441 +0200
diff -u libmagic.orig/magic.h libmagic/magic.h
--- libmagic.orig/magic.h 2020-11-24 13:45:15.355600300 +0100
+++ libmagic/magic.h 2020-11-07 14:41:13.559464400 +0100
@@ -126,6 +126,7 @@
const char *magic_getpath(const char *, int);
@@ -3142,9 +3149,9 @@ diff -ur libmagic.orig/magic.h libmagic/magic.h
const char *magic_descriptor(magic_t, int);
const char *magic_buffer(magic_t, const void *, size_t);
diff -ur libmagic.orig/print.c libmagic/print.c
diff -u libmagic.orig/print.c libmagic/print.c
--- libmagic.orig/print.c 2020-05-09 20:57:15.000000000 +0200
+++ libmagic/print.c 2020-08-29 11:56:12.303522747 +0200
+++ libmagic/print.c 2020-11-07 14:41:13.559464400 +0100
@@ -28,6 +28,7 @@
/*
* print.c - debugging printout routines
@@ -3207,9 +3214,9 @@ diff -ur libmagic.orig/print.c libmagic/print.c
if (pp == NULL)
goto out;
diff -ur libmagic.orig/readcdf.c libmagic/readcdf.c
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
--- libmagic.orig/readcdf.c 2019-09-30 17:42:50.000000000 +0200
+++ libmagic/readcdf.c 2020-08-29 02:05:56.212049441 +0200
+++ libmagic/readcdf.c 2020-11-07 14:41:13.559464400 +0100
@@ -31,7 +31,11 @@
#include <assert.h>
@@ -3331,9 +3338,9 @@ diff -ur libmagic.orig/readcdf.c libmagic/readcdf.c
out0:
/* If we handled it already, return */
if (i != -1)
diff -ur libmagic.orig/softmagic.c libmagic/softmagic.c
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
--- libmagic.orig/softmagic.c 2020-06-15 02:01:01.000000000 +0200
+++ libmagic/softmagic.c 2020-09-02 20:04:00.794667114 +0200
+++ libmagic/softmagic.c 2020-11-07 14:41:13.559464400 +0100
@@ -43,6 +43,10 @@
#include <time.h>
#include "der.h"
@@ -3682,9 +3689,9 @@ diff -ur libmagic.orig/softmagic.c libmagic/softmagic.c
break;
}
case FILE_INDIRECT:
diff -ur libmagic.orig/strcasestr.c libmagic/strcasestr.c
diff -u libmagic.orig/strcasestr.c libmagic/strcasestr.c
--- libmagic.orig/strcasestr.c 2014-09-11 17:05:33.000000000 +0200
+++ libmagic/strcasestr.c 2020-07-04 12:40:36.675619260 +0200
+++ libmagic/strcasestr.c 2020-10-09 14:15:33.499288400 +0200
@@ -39,6 +39,8 @@
#include "file.h"
+2
View File
@@ -86,6 +86,8 @@
#include <sys/stat.h>
#include <stdarg.h>
#define abort() zend_error_noreturn(E_ERROR, "fatal libmagic error")
#define ENABLE_CONDITIONALS
#ifndef MAGIC
+50
View File
@@ -0,0 +1,50 @@
0 string 1
>1 regex \^[0-9:,\ ]*-->[0-9:,\ ]* SubRip File
!:mime text/x-srt
0 lelong 0xc3cbc6c5 RISC OS Chunk data
>12 string OBJ_ \b, AOF object
>12 string LIB_ \b, ALF library
0 name mach-o \b [
>0 use mach-o-cpu \b
>(8.L) indirect 8 \b:
>0 belong x \b]
0 belong 0xcafed00d JAR compressed with pack200,
>5 byte x version %d.
>4 byte x \b%d
!:mime application/x-java-pack200
# Objective-C
0 regex \^#import Objective-C source text
!:strength + 25
!:mime text/x-objective-c
0 string \x20\x20\x20\x20\x20\x20\x20\x20-:\x20\x20\x20\ 0:Source:
>&0 search/128 \x20\x20\x20\x20\x20\x20\x20\x20-:\x20\x20\x20\ 0:Graph:
>>&0 search/128 \x20\x20\x20\x20\x20\x20\x20\x20-:\x20\x20\x20\ 0:Data: GCOV coverage report
0 name certinfo
>0 der seq
>>&0 der set
>>>&0 der seq
>>>>&0 der obj_id3=550406
>>>>&0 der prt_str=x \b, countryName=%s
>>&0 der set
>>>&0 der seq
>>>>&0 der obj_id3=550408
>>>>&0 der utf8_str=x \b, stateOrProvinceName=%s
>>&0 der set
>>>&0 der seq
>>>>&0 der obj_id3=55040a
>>>>&0 der utf8_str=x \b, organizationName=%s
>>&0 der set
>>>&0 der seq
>>>>&0 der obj_id3=550403
>>>>&0 der utf8_str=x \b, commonName=%s
>>&0 der seq
0 search/1 FONT ASCII vfont text
0 short 0436 Berkeley vfont data
0 short 017001 byte-swapped Berkeley vfont data
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #77961 (finfo_open crafted magic parsing SIGABRT)
--SKIPIF--
<?php
if (!extension_loaded('fileinfo')) die('skip fileinfo extension not available');
?>
--FILE--
<?php
finfo_open(FILEINFO_NONE, __DIR__ . '/bug77961.magic');
?>
--EXPECTF--
Warning: finfo_open(): Expected numeric type got `indirect' in %s on line %d
Fatal error: fatal libmagic error in %s on line %d
+3 -2
View File
@@ -1483,8 +1483,9 @@ PHP_FUNCTION(imagecreatefromstring)
}
if (ZSTR_LEN(data) < sizeof(sig)) {
zend_argument_value_error(1, "cannot be empty");
RETURN_THROWS();
/* Handle this the same way as an unknown image type. */
php_error_docref(NULL, E_WARNING, "Data is not in a recognized format");
RETURN_FALSE;
}
memcpy(sig, ZSTR_VAL(data), sizeof(sig));
+3 -2
View File
@@ -62,6 +62,7 @@ $im = imagecreatefromstring(' asdf jklp foo');
--EXPECTF--
createfromstring truecolor png: ok
createfromstring palette png: ok
imagecreatefromstring(): Argument #1 ($data) cannot be empty
Warning: imagecreatefromstring(): Data is not in a recognized format in %screatefromstring.php on line %d
Warning: imagecreatefromstring(): Data is not in a recognized format in %s on line %d
Warning: imagecreatefromstring(): Data is not in a recognized format in %s on line %d
+53 -88
View File
@@ -152,6 +152,28 @@ static int le_imap;
RETURN_FALSE; \
} \
#define PHP_IMAP_CHECK_MSGNO_MAYBE_UID_PRE_FLAG_CHECKS(msgindex, arg_pos) \
if (msgindex < 1) { \
zend_argument_value_error(arg_pos, "must be greater than 0"); \
RETURN_THROWS(); \
} \
#define PHP_IMAP_CHECK_MSGNO_MAYBE_UID_POST_FLAG_CHECKS(msgindex, arg_pos, func_flags, uid_flag) \
if (func_flags & uid_flag) { \
/* This should be cached; if it causes an extra RTT to the IMAP server, */ \
/* then that's the price we pay for making sure we don't crash. */ \
unsigned int msg_no_from_uid = mail_msgno(imap_le_struct->imap_stream, msgindex); \
if (msg_no_from_uid == 0) { \
php_error_docref(NULL, E_WARNING, "UID does not exist"); \
RETURN_FALSE; \
} \
} else { \
if (((unsigned) msgindex) > imap_le_struct->imap_stream->nmsgs) { \
php_error_docref(NULL, E_WARNING, "Bad message number"); \
RETURN_FALSE; \
} \
} \
/* {{{ mail_close_it */
static void mail_close_it(zend_resource *rsrc)
{
@@ -1258,7 +1280,6 @@ PHP_FUNCTION(imap_body)
zval *streamind;
zend_long msgno, flags = 0;
pils *imap_le_struct;
unsigned long msgindex;
char *body;
unsigned long body_len = 0;
@@ -1270,32 +1291,15 @@ PHP_FUNCTION(imap_body)
RETURN_THROWS();
}
if (msgno < 1) {
zend_argument_value_error(2, "must be greater than 0");
RETURN_THROWS();
}
PHP_IMAP_CHECK_MSGNO_MAYBE_UID_PRE_FLAG_CHECKS(msgno, 2);
if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
zend_argument_value_error(3, "must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL");
RETURN_THROWS();
}
if (flags && (flags & FT_UID)) {
/* This should be cached; if it causes an extra RTT to the
IMAP server, then that's the price we pay for making
sure we don't crash. */
msgindex = mail_msgno(imap_le_struct->imap_stream, msgno);
if (msgindex == 0) {
php_error_docref(NULL, E_WARNING, "UID does not exist");
RETURN_FALSE;
}
} else {
msgindex = (unsigned long) msgno;
}
PHP_IMAP_CHECK_MSGNO_MAYBE_UID_POST_FLAG_CHECKS(msgno, 2, flags, FT_UID);
PHP_IMAP_CHECK_MSGNO(msgindex, 2);
/* TODO Shouldn't this pass msgindex??? */
body = mail_fetchtext_full (imap_le_struct->imap_stream, msgno, &body_len, flags);
if (body_len == 0) {
RETVAL_EMPTY_STRING();
@@ -1305,6 +1309,7 @@ PHP_FUNCTION(imap_body)
}
/* }}} */
/* TODO UID Tests */
/* {{{ Copy specified message to a mailbox */
PHP_FUNCTION(imap_mail_copy)
{
@@ -1334,6 +1339,7 @@ PHP_FUNCTION(imap_mail_copy)
}
/* }}} */
/* TODO UID Tests */
/* {{{ Move specified message to a mailbox */
PHP_FUNCTION(imap_mail_move)
{
@@ -1605,13 +1611,15 @@ PHP_FUNCTION(imap_delete)
RETURN_THROWS();
}
// TODO Check sequence validity?
if (flags && ((flags & ~FT_UID) != 0)) {
zend_argument_value_error(3, "must be FT_UID or 0");
RETURN_THROWS();
}
mail_setflag_full(imap_le_struct->imap_stream, ZSTR_VAL(sequence), "\\DELETED", flags);
RETVAL_TRUE;
RETURN_TRUE;
}
/* }}} */
@@ -1882,7 +1890,6 @@ PHP_FUNCTION(imap_fetchstructure)
zend_long msgno, flags = 0;
pils *imap_le_struct;
BODY *body;
int msgindex;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|l", &streamind, &msgno, &flags) == FAILURE) {
RETURN_THROWS();
@@ -1892,34 +1899,18 @@ PHP_FUNCTION(imap_fetchstructure)
RETURN_THROWS();
}
if (msgno < 1) {
zend_argument_value_error(2, "must be greater than 0");
RETURN_THROWS();
}
PHP_IMAP_CHECK_MSGNO_MAYBE_UID_PRE_FLAG_CHECKS(msgno, 2);
if (flags && ((flags & ~FT_UID) != 0)) {
zend_argument_value_error(3, "must be FT_UID or 0");
RETURN_THROWS();
}
PHP_IMAP_CHECK_MSGNO_MAYBE_UID_POST_FLAG_CHECKS(msgno, 2, flags, FT_UID);
object_init(return_value);
if (flags & FT_UID) {
/* This should be cached; if it causes an extra RTT to the
IMAP server, then that's the price we pay for making
sure we don't crash. */
msgindex = mail_msgno(imap_le_struct->imap_stream, msgno);
if (msgindex == 0) {
php_error_docref(NULL, E_WARNING, "UID does not exist");
RETURN_FALSE;
}
} else {
msgindex = msgno;
}
PHP_IMAP_CHECK_MSGNO(msgindex, 2);
/* TODO Shouldn't this pass msgindex??? */
mail_fetchstructure_full(imap_le_struct->imap_stream, msgno, &body , (ZEND_NUM_ARGS() == 3 ? flags : NIL));
mail_fetchstructure_full(imap_le_struct->imap_stream, msgno, &body , flags);
if (!body) {
php_error_docref(NULL, E_WARNING, "No body information available");
@@ -1948,20 +1939,14 @@ PHP_FUNCTION(imap_fetchbody)
RETURN_THROWS();
}
if (msgno < 1) {
zend_argument_value_error(2, "must be greater than 0");
RETURN_THROWS();
}
PHP_IMAP_CHECK_MSGNO_MAYBE_UID_PRE_FLAG_CHECKS(msgno, 2);
if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
zend_argument_value_error(4, "must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL");
RETURN_THROWS();
}
if (!(flags & FT_UID)) {
/* only perform the check if the msgno is a message number and not a UID */
PHP_IMAP_CHECK_MSGNO(msgno, 2);
}
PHP_IMAP_CHECK_MSGNO_MAYBE_UID_POST_FLAG_CHECKS(msgno, 2, flags, FT_UID);
body = mail_fetchbody_full(imap_le_struct->imap_stream, msgno, ZSTR_VAL(sec), &len, flags);
@@ -1989,24 +1974,18 @@ PHP_FUNCTION(imap_fetchmime)
RETURN_THROWS();
}
if (msgno < 1) {
zend_argument_value_error(2, "must be greater than 0");
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_THROWS();
}
PHP_IMAP_CHECK_MSGNO_MAYBE_UID_PRE_FLAG_CHECKS(msgno, 2);
if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
zend_argument_value_error(4, "must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL");
RETURN_THROWS();
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_THROWS();
}
if (!(flags & FT_UID)) {
/* only perform the check if the msgno is a message number and not a UID */
PHP_IMAP_CHECK_MSGNO(msgno, 2);
}
PHP_IMAP_CHECK_MSGNO_MAYBE_UID_POST_FLAG_CHECKS(msgno, 2, flags, FT_UID);
body = mail_fetch_mime(imap_le_struct->imap_stream, msgno, ZSTR_VAL(sec), &len, flags);
@@ -2037,17 +2016,14 @@ PHP_FUNCTION(imap_savebody)
RETURN_THROWS();
}
PHP_IMAP_CHECK_MSGNO(msgno, 3);
PHP_IMAP_CHECK_MSGNO_MAYBE_UID_PRE_FLAG_CHECKS(msgno, 3)
if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
zend_argument_value_error(5, "must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL");
RETURN_THROWS();
}
// TODO Drop this?
if (!imap_le_struct) {
RETURN_FALSE;
}
PHP_IMAP_CHECK_MSGNO_MAYBE_UID_POST_FLAG_CHECKS(msgno, 3, flags, FT_UID);
switch (Z_TYPE_P(out))
{
@@ -2771,9 +2747,8 @@ PHP_FUNCTION(imap_sort)
PHP_FUNCTION(imap_fetchheader)
{
zval *streamind;
zend_long msgno, flags = 0L;
zend_long msgno, flags = 0;
pils *imap_le_struct;
int msgindex;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|l", &streamind, &msgno, &flags) == FAILURE) {
RETURN_THROWS();
@@ -2783,30 +2758,16 @@ PHP_FUNCTION(imap_fetchheader)
RETURN_THROWS();
}
// TODO Check for msgno < 1 now or wait later for PHP_IMAP_CHECK_MSGNO check?
PHP_IMAP_CHECK_MSGNO_MAYBE_UID_PRE_FLAG_CHECKS(msgno, 2);
if (flags && ((flags & ~(FT_UID|FT_INTERNAL|FT_PREFETCHTEXT)) != 0)) {
zend_argument_value_error(3, "must be a bitmask of FT_UID, FT_PREFETCHTEXT, and FT_INTERNAL");
RETURN_THROWS();
}
if (flags & FT_UID) {
/* This should be cached; if it causes an extra RTT to the
IMAP server, then that's the price we pay for making sure
we don't crash. */
msgindex = mail_msgno(imap_le_struct->imap_stream, msgno);
if (msgindex == 0) {
php_error_docref(NULL, E_WARNING, "UID does not exist");
RETURN_FALSE;
}
} else {
msgindex = msgno;
}
PHP_IMAP_CHECK_MSGNO_MAYBE_UID_POST_FLAG_CHECKS(msgno, 2, flags, FT_UID);
PHP_IMAP_CHECK_MSGNO(msgindex, 2);
/* TODO Check shouldn't this pass msgindex???? */
RETVAL_STRING(mail_fetchheader_full(imap_le_struct->imap_stream, msgno, NIL, NIL, (ZEND_NUM_ARGS() == 3 ? flags : NIL)));
RETVAL_STRING(mail_fetchheader_full(imap_le_struct->imap_stream, msgno, NIL, NIL, flags));
}
/* }}} */
@@ -2835,10 +2796,10 @@ PHP_FUNCTION(imap_uid)
PHP_FUNCTION(imap_msgno)
{
zval *streamind;
zend_long msgno;
zend_long msg_uid;
pils *imap_le_struct;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &streamind, &msgno) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &streamind, &msg_uid) == FAILURE) {
RETURN_THROWS();
}
@@ -2846,9 +2807,13 @@ PHP_FUNCTION(imap_msgno)
RETURN_THROWS();
}
PHP_IMAP_CHECK_MSGNO(msgno, 2);
/* Do NOT use the PHP_IMAP_CHECK_MSGNO() macro as UID cannot be checked for their upper bound. */
if (msg_uid < 1) {
zend_argument_value_error(2, "must be greater than 0");
RETURN_THROWS();
}
RETURN_LONG(mail_msgno(imap_le_struct->imap_stream, msgno));
RETURN_LONG(mail_msgno(imap_le_struct->imap_stream, msg_uid));
}
/* }}} */
-1
View File
@@ -1 +0,0 @@
imap
+3 -3
View File
@@ -11,14 +11,14 @@ hMailServer on Windows. The tests are intended to be mailserver agnostic.
## Set-up tests on Ubuntu (checked on Ubuntu 18.04 (Bionic))
The necessary packages can be installed using the following command;
`apt-get install libc-client-dev libkrb5-dev dovecot-core dovecot-pop3d dovecot-imapd`
`apt-get install libc-client-dev libkrb5-dev dovecot-core dovecot-pop3d dovecot-imapd sendmail`
The build of PHP will need to be compiled with the following flags:
```
--with-imap --with-kerberos --with-imap-ssl
```
Then run the set-up script `ext/imap/tests/setup.sh` which will add the `vmail`
Then run the set-up script `ext/imap/tests/setup/setup.sh` which will add the `vmail`
group and user which is used by Dovecot for the mailbox. It will also copy the
`ext/imap/tests/dovecot.conf` and `ext/imap/tests/dovecotpass` to the correct
`ext/imap/tests/setup/dovecot.conf` and `ext/imap/tests/setup/dovecotpass` to the correct
location for Dovecot and restarts it for the new configuration to be enabled.
+1 -3
View File
@@ -2,9 +2,7 @@
Bug #31142 test #2 (imap_mail_compose() generates incorrect output)
--SKIPIF--
<?php
if (!extension_loaded("imap")) {
die("skip imap extension not available");
}
extension_loaded('imap') or die('skip imap extension not available in this build');
?>
--FILE--
<?php
+1 -3
View File
@@ -2,9 +2,7 @@
Bug #32589 (crash inside imap_mail_compose() function)
--SKIPIF--
<?php
if (!extension_loaded("imap")) {
die("skip imap extension not available");
}
extension_loaded('imap') or die('skip imap extension not available in this build');
?>
--FILE--
<?php
+27 -29
View File
@@ -2,45 +2,43 @@
Bug #35669 (imap_mail_compose() crashes with multipart-multiboundary-email)
--SKIPIF--
<?php
if (!extension_loaded("imap")) {
die("skip imap extension not available");
}
extension_loaded('imap') or die('skip imap extension not available in this build');
?>
--FILE--
<?php
$envelope["from"] = 'Santa <somewhere@northpole.gov>';
$envelope["to"] = 'The bad smurf <bad@smurf.com>';
$envelope['date'] = 'Wed, 04 Jan 2006 19:24:43 -0500';
$envelope["from"] = 'Santa <somewhere@northpole.gov>';
$envelope["to"] = 'The bad smurf <bad@smurf.com>';
$envelope['date'] = 'Wed, 04 Jan 2006 19:24:43 -0500';
$multipart["type"] = TYPEMULTIPART;
$multipart["subtype"] = "MIXED";
$body[] = $multipart; //add multipart stuff
$multipart["type"] = TYPEMULTIPART;
$multipart["subtype"] = "MIXED";
$body[] = $multipart; //add multipart stuff
$textpart["type"] = TYPEMULTIPART;
$textpart["subtype"] = "ALTERNATIVE";
$body[] = $textpart; //add body part
$textpart["type"] = TYPEMULTIPART;
$textpart["subtype"] = "ALTERNATIVE";
$body[] = $textpart; //add body part
$plain["type"] = TYPETEXT;
$plain["subtype"] = "PLAIN";
$plain["charset"] = "iso-8859-1";
$plain["encoding"] = ENCQUOTEDPRINTABLE;
$plain["description"] = "Plaintype part of message";
$plain['disposition'] = "inline";
$plain["contents.data"] = 'See mom, it will crash';
$plain["type"] = TYPETEXT;
$plain["subtype"] = "PLAIN";
$plain["charset"] = "iso-8859-1";
$plain["encoding"] = ENCQUOTEDPRINTABLE;
$plain["description"] = "Plaintype part of message";
$plain['disposition'] = "inline";
$plain["contents.data"] = 'See mom, it will crash';
$body[] = $plain; //next add plain text part
$body[] = $plain; //next add plain text part
$html["type"] = TYPETEXT;
$html["subtype"] = "HTML";
$html["charset"] = "iso-8859-1";
$html["encoding"] = ENCQUOTEDPRINTABLE;
$html["description"] = "HTML part of message";
$html['disposition'] = "inline";
$html["contents.data"] = 'See mom, it will <b>crash</b>';
$html["type"] = TYPETEXT;
$html["subtype"] = "HTML";
$html["charset"] = "iso-8859-1";
$html["encoding"] = ENCQUOTEDPRINTABLE;
$html["description"] = "HTML part of message";
$html['disposition'] = "inline";
$html["contents.data"] = 'See mom, it will <b>crash</b>';
$body[] = $html;
$body[] = $html;
echo imap_mail_compose($envelope, $body);
echo imap_mail_compose($envelope, $body);
?>
--EXPECTF--
Date: Wed, 04 Jan 2006 19:24:43 -0500
+4 -9
View File
@@ -2,19 +2,14 @@
Bug #44098 (imap_utf8() returns only capital letters)
--SKIPIF--
<?php
if (!extension_loaded("imap")) {
die("skip imap extension not available");
}
extension_loaded('imap') or die('skip imap extension not available in this build');
?>
--FILE--
<?php
$exp = 'Luzon®14 dot CoM';
$res = imap_utf8('=?iso-8859-1?b?THV6b26uMTQ=?= dot CoM');
if ($res != $exp) {
echo "failed: got <$res>, expected <exp>\n";
} else {
echo "ok";
}
var_dump($res);
?>
--EXPECT--
ok
string(17) "Luzon®14 dot CoM"
+1 -3
View File
@@ -2,9 +2,7 @@
Bug #45705 test #1 (imap rfc822_parse_adrlist() modifies passed address parameter)
--SKIPIF--
<?php
if (!extension_loaded("imap")) {
die("skip imap extension not available");
}
extension_loaded('imap') or die('skip imap extension not available in this build');
?>
--FILE--
<?php
+1 -3
View File
@@ -2,9 +2,7 @@
Bug #45705 test #2 (imap rfc822_parse_adrlist() modifies passed address parameter)
--SKIPIF--
<?php
if (!extension_loaded("imap")) {
die("skip imap extension not available");
}
extension_loaded('imap') or die('skip imap extension not available in this build');
?>
--FILE--
<?php
+1 -3
View File
@@ -2,9 +2,7 @@
Bug #53377 (imap_mime_header_decode() doesn't ignore \t during long MIME header unfolding)
--SKIPIF--
<?php
if (!extension_loaded("imap")) {
die("skip imap extension not available");
}
extension_loaded('imap') or die('skip imap extension not available in this build');
?>
--FILE--
<?php
+8 -5
View File
@@ -4,11 +4,11 @@ imap_open() DISABLE_AUTHENTICATOR ignores array param
<?php
extension_loaded('imap') or die('skip imap extension not available in this build');
require_once(__DIR__.'/imap_include.inc');
require_once(__DIR__. '/setup/imap_include.inc');
$in = @imap_open($default_mailbox, $username, $password, OP_HALFOPEN, 1);
$in = @imap_open(IMAP_SERVER_DEBUG, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD, OP_HALFOPEN, 1);
if (!$in) {
die("skip could not connect to mailbox $default_mailbox");
die("skip could not connect to mailbox " . IMAP_SERVER_DEBUG);
}
$kerberos = false;
if (is_array($errors = imap_errors())) {
@@ -22,16 +22,19 @@ if (!$kerberos) {
die("skip need a GSSAPI/Kerberos aware server");
}
?>
--CONFLICTS--
defaultmailbox
--FILE--
<?php
// TODO Test Kerberos on CI
$tests = array(
'Array' => array('DISABLE_AUTHENTICATOR' => array('GSSAPI','NTLM')),
'String' => array('DISABLE_AUTHENTICATOR' => 'GSSAPI'),
);
require_once(__DIR__.'/imap_include.inc');
require_once(__DIR__. '/setup/imap_include.inc');
foreach ($tests as $name => $testparams) {
echo "Test for $name\n";
$in = imap_open($default_mailbox, $username, $password, OP_HALFOPEN, 1, $testparams);
$in = imap_open(IMAP_SERVER_DEBUG, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD, OP_HALFOPEN, 1, $testparams);
if ($in) {
if (is_array($errors = imap_errors())) {
foreach ($errors as $err) {
+6 -5
View File
@@ -2,22 +2,23 @@
Bug #64076 (imap_sort() does not return FALSE on failure)
--SKIPIF--
<?php
require_once __DIR__ . '/skipif.inc';
require_once __DIR__ . '/setup/skipif.inc';
?>
--FILE--
<?php
require_once __DIR__ . '/imap_include.inc';
$stream = setup_test_mailbox('', 2);
require_once __DIR__ . '/setup/imap_include.inc';
$stream = setup_test_mailbox('bug64076', 2);
imap_errors(); // clear error stack
var_dump(imap_sort($stream, SORTFROM, 0, 0, 'UNSUPPORTED SEARCH CRITERIUM'));
var_dump(imap_errors() !== false);
?>
--CLEAN--
<?php
require_once __DIR__ . '/clean.inc';
$mailbox_suffix = 'bug64076';
require_once(__DIR__ . '/setup/clean.inc');
?>
--EXPECT--
Create a temporary mailbox and add 2 msgs
.. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created
New mailbox created
bool(false)
bool(true)
+3 -3
View File
@@ -6,8 +6,8 @@ if (!extension_loaded('imap')) die('skip imap extension not available');
?>
--FILE--
<?php
imap_mail('1', 1, NULL);
@imap_mail('1', 1, NULL);
echo 'done'
?>
--EXPECTF--
Warning: imap_mail(): No message string in mail command in %s on line %d
%S
%Adone
+5 -5
View File
@@ -1,11 +1,11 @@
--TEST--
--TEST--
Bug #77153 (imap_open allows to run arbitrary shell commands via mailbox parameter)
--SKIPIF--
<?php
if (!extension_loaded("imap")) {
die("skip imap extension not available");
}
extension_loaded('imap') or die('skip imap extension not available in this build');
?>
--CONFLICTS--
defaultmailbox
--FILE--
<?php
$payload = "echo 'BUG'> " . __DIR__ . '/__bug';
@@ -21,4 +21,4 @@ bool(false)
--CLEAN--
<?php
if(file_exists(__DIR__ . '/__bug')) unlink(__DIR__ . '/__bug');
?>
?>
+6 -1
View File
@@ -14,8 +14,13 @@ $body = [[
'type.parameters' => ['param'],
'disposition' => ['disp'],
]];
imap_mail_compose($envelope, $body);
var_dump(imap_mail_compose($envelope, $body));
echo "done\n";
?>
--EXPECT--
string(67) "MIME-Version: 1.0
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
"
done
+17 -4
View File
@@ -2,12 +2,25 @@
Bug #80226 (imap_sort() leaks sortpgm memory)
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
require_once(__DIR__.'/imap_include.inc');
$stream = imap_open($default_mailbox, $username, $password);
imap_sort($stream, SORTFROM, 0);
require_once(__DIR__.'/setup/imap_include.inc');
echo "Create a new mailbox for test\n";
$stream = setup_test_mailbox("bug80226", 0);
var_dump(imap_sort($stream, SORTFROM, 0));
?>
--CLEAN--
<?php
$mailbox_suffix = 'bug80226';
require_once(__DIR__ . '/setup/clean.inc');
?>
--EXPECT--
Create a new mailbox for test
Create a temporary mailbox and add 0 msgs
New mailbox created
array(0) {
}
+64
View File
@@ -0,0 +1,64 @@
--TEST--
Bug #80438: imap_msgno() incorrectly warns and return false on valid UIDs in PHP 8.0.0
--SKIPIF--
<?php
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
require_once __DIR__.'/setup/imap_include.inc';
// create a new mailbox and add 10 new messages to it
$mail_box = setup_test_mailbox_for_uid_tests('bug80438');
$message_number_array = imap_search($mail_box, 'ALL', SE_UID);
var_dump($message_number_array);
foreach ($message_number_array as $message_unique_id)
{
echo 'Unique ID: ';
var_dump($message_unique_id);
echo 'Ordered message number: ';
var_dump(imap_msgno($mail_box, $message_unique_id));
}
imap_close($mail_box);
?>
--CLEAN--
<?php
$mailbox_suffix = 'bug80438';
require_once __DIR__.'/setup/clean.inc';
?>
--EXPECT--
Create a temporary mailbox and add 10 msgs
New mailbox created
Delete 4 messages for Unique ID generation
array(6) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(7)
[3]=>
int(8)
[4]=>
int(9)
[5]=>
int(10)
}
Unique ID: int(1)
Ordered message number: int(1)
Unique ID: int(2)
Ordered message number: int(2)
Unique ID: int(7)
Ordered message number: int(3)
Unique ID: int(8)
Ordered message number: int(4)
Unique ID: int(9)
Ordered message number: int(5)
Unique ID: int(10)
Ordered message number: int(6)
-25
View File
@@ -1,25 +0,0 @@
<?php
include_once(dirname(__FILE__) . '/imap_include.inc');
$imap_stream = imap_open($default_mailbox, $username, $password);
// delete all msgs in default mailbox, i.e INBOX
$check = imap_check($imap_stream);
for ($i = 1; $i <= $check->Nmsgs; $i++) {
imap_delete($imap_stream, $i);
}
$mailboxes = imap_getmailboxes($imap_stream, $server, '*');
foreach($mailboxes as $value) {
// Only delete mailboxes with our prefix
if (preg_match('/\{.*?\}INBOX\.(.+)/', $value->name, $match) == 1) {
if (strlen($match[1]) >= strlen($mailbox_prefix)
&& substr_compare($match[1], $mailbox_prefix, 0, strlen($mailbox_prefix)) == 0) {
imap_deletemailbox($imap_stream, $value->name);
}
}
}
imap_close($imap_stream, CL_EXPUNGE);
?>
+8 -10
View File
@@ -2,22 +2,19 @@
Test imap_append() function : basic functionality
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
require_once(__DIR__. '/setup/skipif.inc');
?>
--FILE--
<?php
echo "*** Testing imap_append() : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
require_once(__DIR__. '/setup/imap_include.inc');
echo "Create a new mailbox for test\n";
$imap_stream = setup_test_mailbox("", 0);
if (!is_resource($imap_stream)) {
exit("TEST FAILED: Unable to create test mailbox\n");
}
$imap_stream = setup_test_mailbox("imapappendbaisc", 0);
$mb_details = imap_mailboxmsginfo($imap_stream);
echo "Add a couple of msgs to new mailbox " . $mb_details->Mailbox . "\n";
echo "Add a couple of msgs to the new mailbox\n";
var_dump(imap_append($imap_stream, $mb_details->Mailbox
, "From: webmaster@something.com\r\n"
. "To: info@something.com\r\n"
@@ -44,14 +41,15 @@ imap_close($imap_stream);
?>
--CLEAN--
<?php
require_once('clean.inc');
$mailbox_suffix = 'imapappendbaisc';
require_once(__DIR__ . '/setup/clean.inc');
?>
--EXPECTF--
*** Testing imap_append() : basic functionality ***
Create a new mailbox for test
Create a temporary mailbox and add 0 msgs
.. mailbox '%s' created
Add a couple of msgs to new mailbox {%s}INBOX.%s
New mailbox created
Add a couple of msgs to the new mailbox
bool(true)
bool(true)
Msg Count after append : 2
-39
View File
@@ -1,39 +0,0 @@
--TEST--
imap_body() ValueError
--CREDITS--
Paul Sohier
#phptestfest utrecht
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
?>
--FILE--
<?php
require_once(__DIR__.'/imap_include.inc');
$stream_id = imap_open($default_mailbox, $username, $password) or
die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
try {
imap_body($stream_id,-1);
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
try {
imap_body($stream_id,1,-1);
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
//Access not existing
var_dump(imap_body($stream_id, 255, FT_UID));
imap_close($stream_id);
?>
--EXPECTF--
imap_body(): Argument #2 ($message_num) must be greater than 0
imap_body(): Argument #3 ($flags) must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL
Warning: imap_body(): UID does not exist in %s on line %d
bool(false)
+8 -10
View File
@@ -2,19 +2,16 @@
Test imap_body() function : basic functionality
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
echo "*** Testing imap_body() : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
require_once(__DIR__.'/setup/imap_include.inc');
echo "Create a new mailbox for test\n";
$imap_stream = setup_test_mailbox("", 1);
if (!is_resource($imap_stream)) {
exit("TEST FAILED: Unable to create test mailbox\n");
}
$imap_stream = setup_test_mailbox("imapbodybasic", 1);
$check = imap_check($imap_stream);
echo "Msg Count in new mailbox: ". $check->Nmsgs . "\n";
@@ -29,15 +26,16 @@ imap_close($imap_stream);
?>
--CLEAN--
<?php
require_once('clean.inc');
$mailbox_suffix = 'imapbodybasic';
require_once __DIR__.'/setup/clean.inc';
?>
--EXPECTF--
*** Testing imap_body() : basic functionality ***
Create a new mailbox for test
Create a temporary mailbox and add 1 msgs
.. mailbox '%s' created
New mailbox created
Msg Count in new mailbox: 1
string(%d) "1: this is a test message, please ignore
"
newline%r\R?%r"
string(%d) "1: this is a test message, please ignore
"
newline%r\R?%r"
+50
View File
@@ -0,0 +1,50 @@
--TEST--
imap_body() errors: ValueError and Warnings
--CREDITS--
Paul Sohier
#phptestfest utrecht
--SKIPIF--
<?php
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
require_once(__DIR__.'/setup/imap_include.inc');
$imap_mail_box = setup_test_mailbox("imapbodyerror", 0);
try {
imap_body($imap_mail_box, -1);
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
try {
imap_body($imap_mail_box, 1, -1);
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
// Access not existing
var_dump(imap_body($imap_mail_box, 255));
var_dump(imap_body($imap_mail_box, 255, FT_UID));
imap_close($imap_mail_box);
?>
--CLEAN--
<?php
$mailbox_suffix = 'imapbodyerror';
require_once(__DIR__ . '/setup/clean.inc');
?>
--EXPECTF--
Create a temporary mailbox and add 0 msgs
New mailbox created
imap_body(): Argument #2 ($message_num) must be greater than 0
imap_body(): Argument #3 ($flags) must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL
Warning: imap_body(): Bad message number in %s on line %d
bool(false)
Warning: imap_body(): UID does not exist in %s on line %d
bool(false)
+28
View File
@@ -0,0 +1,28 @@
--TEST--
imap_body() passing a unique ID
--SKIPIF--
<?php
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
require_once(__DIR__.'/setup/imap_include.inc');
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapbodyuid", $msg_no, $uid);
var_dump(imap_body($imap_mail_box, $uid, FT_UID) === imap_body($imap_mail_box, $msg_no));
imap_close($imap_mail_box);
?>
--CLEAN--
<?php
$mailbox_suffix = 'imapbodyuid';
require_once(__DIR__ . '/setup/clean.inc');
?>
--EXPECT--
Create a temporary mailbox and add 10 msgs
New mailbox created
Delete 4 messages for Unique ID generation
bool(true)
+27 -42
View File
@@ -2,47 +2,43 @@
Test imap_bodystruct() function : basic functionality
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
echo "*** Testing string imap_bodystruct : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
require_once(__DIR__.'/setup/imap_include.inc');
echo "Create a new mailbox for test and add a multipart msgs\n";
$imap_stream = setup_test_mailbox("", 1, $mailbox, "multipart");
if (!is_resource($imap_stream)) {
exit("TEST FAILED: Unable to create test mailbox\n");
}
$imap_stream = setup_test_mailbox("imapbodystructbasic", 1, $mailbox, "multipart");
echo "\nGet and validate structure of body part 1\n";
$m = imap_bodystruct($imap_stream, 1, "1");
$mandatoryFields = array(
'ifsubtype',
'ifdescription',
'ifid',
'ifdisposition',
'ifdparameters',
'ifparameters',
);
$mandatoryFields = [
'ifsubtype',
'ifdescription',
'ifid',
'ifdisposition',
'ifdparameters',
'ifparameters',
];
foreach($mandatoryFields as $mf)
{
if(isValid($m->$mf))
{
echo "$mf is 0 or 1\n";
}
else
{
echo "$mf FAIL\n";
}
function isValid($param) {
return ($param == 0) || ($param == 1);
}
if(is_array($m->parameters))
{
echo "parameters is an array\n";
foreach($mandatoryFields as $mf) {
if (isValid($m->$mf)) {
echo "$mf is 0 or 1\n";
} else {
echo "$mf FAIL\n";
}
}
if(is_array($m->parameters)) {
echo "parameters is an array\n";
}
echo "\nTry to get part 4!\n";
@@ -50,28 +46,17 @@ var_dump(imap_bodystruct($imap_stream, 1, "4"));
imap_close($imap_stream);
function isValid($param)
{
if(($param == 0) || ($param == 1))
{
$result=true;
}
else
{
$result=false;
}
return $result;
}
?>
--CLEAN--
<?php
require_once('clean.inc');
$mailbox_suffix = 'imapbodystructbasic';
require_once(__DIR__ . '/setup/clean.inc');
?>
--EXPECTF--
--EXPECT--
*** Testing string imap_bodystruct : basic functionality ***
Create a new mailbox for test and add a multipart msgs
Create a temporary mailbox and add 1 msgs
.. mailbox '{%s}%s' created
New mailbox created
Get and validate structure of body part 1
ifsubtype is 0 or 1
@@ -2,19 +2,16 @@
Test imap_clearflag_full() function : basic functionality
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
echo "*** Testing imap_clearflag_full() : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
require_once(__DIR__.'/setup/imap_include.inc');
echo "Create a new mailbox for test\n";
$imap_stream = setup_test_mailbox("", 10);
if (!is_resource($imap_stream)) {
exit("TEST FAILED: Unable to create test mailbox\n");
}
$imap_stream = setup_test_mailbox("imapclearflagfullbasic", 10);
$check = imap_check($imap_stream);
echo "Initial msg count in new_mailbox : ". $check->Nmsgs . "\n";
@@ -44,13 +41,14 @@ imap_close($imap_stream);
?>
--CLEAN--
<?php
require_once('clean.inc');
$mailbox_suffix = 'imapclearflagfullbasic';
require_once(__DIR__ . '/setup/clean.inc');
?>
--EXPECTF--
--EXPECT--
*** Testing imap_clearflag_full() : basic functionality ***
Create a new mailbox for test
Create a temporary mailbox and add 10 msgs
.. mailbox '{%s}%s' created
New mailbox created
Initial msg count in new_mailbox : 10
Set some flags
bool(true)
@@ -0,0 +1,90 @@
--TEST--
imap_clearflag_full() passing a unique ID
--SKIPIF--
<?php
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
require_once(__DIR__.'/setup/imap_include.inc');
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapclearflagfulluid");
/* This works on the assumption that UID message 3 to 6 inclusive are deleted. */
imap_setflag_full($imap_mail_box, '2,8,9', '\Answered', ST_UID);
imap_setflag_full($imap_mail_box, '7,10', '\Deleted', ST_UID);
imap_setflag_full($imap_mail_box, '7:9', '\Flagged', ST_UID);
// Testing individual entry
imap_clearflag_full($imap_mail_box, '10', '\Deleted', ST_UID);
// Testing multiple entries entry
imap_clearflag_full($imap_mail_box, '2,9', '\Answered', ST_UID);
// Testing entry range
imap_clearflag_full($imap_mail_box, '7:8', '\Flagged', ST_UID);
echo 'ALL: ';
var_dump(imap_search($imap_mail_box, 'ALL'));
echo 'ALL (with UID correspondance): ';
var_dump(imap_search($imap_mail_box, 'ALL', SE_UID));
echo 'ANSWERED: ';
var_dump(imap_search($imap_mail_box, 'ANSWERED'));
echo 'DELETED: ';
var_dump(imap_search($imap_mail_box, 'DELETED'));
echo 'FLAGGED: ';
var_dump(imap_search($imap_mail_box, 'FLAGGED'));
imap_close($imap_mail_box);
?>
--CLEAN--
<?php
$mailbox_suffix = 'imapclearflagfulluid';
require_once(__DIR__ . '/setup/clean.inc');
?>
--EXPECT--
Create a temporary mailbox and add 10 msgs
New mailbox created
Delete 4 messages for Unique ID generation
ALL: array(6) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
[4]=>
int(5)
[5]=>
int(6)
}
ALL (with UID correspondance): array(6) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(7)
[3]=>
int(8)
[4]=>
int(9)
[5]=>
int(10)
}
ANSWERED: array(1) {
[0]=>
int(4)
}
DELETED: array(1) {
[0]=>
int(3)
}
FLAGGED: array(1) {
[0]=>
int(5)
}
+8 -7
View File
@@ -2,17 +2,17 @@
Test imap_close() function : basic functionality
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
echo "*** Testing imap_close() : basic functionality ***\n";
// include file for required variables in imap_open()
require_once(__DIR__.'/imap_include.inc');
require_once(__DIR__.'/setup/imap_include.inc');
// Initialize required variables
$stream_id = setup_test_mailbox('', 3, $mailbox); // set up temp mailbox with 3 messages
$stream_id = setup_test_mailbox('imapclosebasic', 3, $mailbox); // set up temp mailbox with 3 messages
$options = CL_EXPUNGE;
// mark messages in inbox for deletion
@@ -25,7 +25,7 @@ echo "\n-- Call to imap_close() with all possible arguments --\n";
var_dump( imap_close($stream_id, $options) );
// check that CL_EXPUNGE worked
$stream_id = imap_open($mailbox, $username, $password);
$stream_id = imap_open($mailbox, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD);
echo "There are now " . imap_num_msg($stream_id) . " msgs in mailbox '$mailbox'\n";
// Calling imap_close() with mandatory arguments
@@ -34,16 +34,17 @@ var_dump( imap_close($stream_id) );
?>
--CLEAN--
<?php
require_once(__DIR__.'/clean.inc');
$mailbox_suffix = 'imapclosebasic';
require_once(__DIR__.'/setup/clean.inc');
?>
--EXPECTF--
*** Testing imap_close() : basic functionality ***
Create a temporary mailbox and add 3 msgs
.. mailbox '%sINBOX.phpttest' created
New mailbox created
-- Call to imap_close() with all possible arguments --
bool(true)
There are now 0 msgs in mailbox '%sINBOX.phpttest'
There are now 0 msgs in mailbox '%sINBOX.phpttestimapclosebasic'
-- Call to imap_close() with mandatory arguments --
bool(true)
+9 -8
View File
@@ -2,7 +2,7 @@
Test imap_close() function : usage variations - different ints as $flags arg
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
@@ -13,11 +13,11 @@ require_once(__DIR__.'/skipif.inc');
echo "*** Testing imap_close() : usage variations ***\n";
require_once(__DIR__.'/imap_include.inc');
require_once(__DIR__.'/setup/imap_include.inc');
$inputs = array (0, 3.2768e4, -32768, PHP_INT_MAX, -PHP_INT_MAX);
$stream_id = setup_test_mailbox('', 3, $mailbox); // set up temp mailbox with 3 messages
$stream_id = setup_test_mailbox('imapclosevar4', 3, $mailbox); // set up temp mailbox with 3 messages
// loop through each element of $inputs to check the behavior of imap_close()
$iterator = 1;
@@ -40,7 +40,7 @@ foreach($inputs as $input) {
imap_close($stream_id, CL_EXPUNGE);
} else {
// if imap_close was successful test whether CL_EXPUNGE was set by doing a message count
$imap_stream = imap_open($mailbox, $username, $password);
$imap_stream = imap_open($mailbox, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD);
$num_msg = imap_num_msg($imap_stream);
if ($num_msg != 0) {
echo "CL_EXPUNGE was not set, $num_msg msgs in mailbox\n";
@@ -53,19 +53,20 @@ foreach($inputs as $input) {
$iterator++;
// get $stream_id for next iteration
$stream_id = imap_open($mailbox, $username, $password);
$stream_id = imap_open($mailbox, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD);
populate_mailbox($stream_id, $mailbox, 3);
};
?>
--CLEAN--
<?php
require_once(__DIR__.'/clean.inc');
$mailbox_suffix = 'imapclosevar4';
require_once(__DIR__.'/setup/clean.inc');
?>
--EXPECTF--
--EXPECT--
*** Testing imap_close() : usage variations ***
Create a temporary mailbox and add 3 msgs
.. mailbox '{%s}%s' created
New mailbox created
-- Iteration 1 --
bool(true)
+11 -5
View File
@@ -2,22 +2,21 @@
Test imap_createmailbox() function : basic functionality
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
require_once __DIR__.'/setup/skipif.inc';
?>
--FILE--
<?php
echo "*** Testing imap_createmailbox() : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
require_once __DIR__.'/setup/imap_include.inc';
$imap_stream = imap_open($default_mailbox, $username, $password) or
die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
$imap_stream = setup_test_mailbox("imapcreatemailboxbasic", 0);
$newname = "phpnewbox";
echo "Newname will be '$newname'\n";
$newbox = imap_utf7_encode($server.$newname);
$newbox = imap_utf7_encode(IMAP_SERVER.$newname);
if (imap_createmailbox($imap_stream, $newbox)) {
echo "Add a couple of msgs to '$newname' mailbox\n";
@@ -48,9 +47,16 @@ if (imap_createmailbox($imap_stream, $newbox)) {
imap_close($imap_stream);
?>
--CLEAN--
<?php
$mailbox_suffix = 'imapcreatemailboxbasic';
require_once __DIR__ . '/setup/clean.inc';
?>
--EXPECTF--
*** Testing imap_createmailbox() : basic functionality ***
Create a temporary mailbox and add 0 msgs
New mailbox created
Newname will be 'phpnewbox'
Add a couple of msgs to 'phpnewbox' mailbox
Your new mailbox 'phpnewbox' has the following status:
+51
View File
@@ -0,0 +1,51 @@
--TEST--
imap_delete() passing a unique ID
--SKIPIF--
<?php
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
require_once(__DIR__.'/setup/imap_include.inc');
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapdeleteuid", $msg_no, $uid);
imap_delete($imap_mail_box, $uid, FT_UID);
var_dump(imap_search($imap_mail_box, 'DELETED', SE_UID));
imap_expunge($imap_mail_box);
echo 'After expunging: ';
var_dump(imap_search($imap_mail_box, 'DELETED', SE_UID));
var_dump(imap_search($imap_mail_box, 'ALL', SE_UID));
imap_close($imap_mail_box);
?>
--CLEAN--
<?php
$mailbox_suffix = 'imapdeleteuid';
require_once(__DIR__ . '/setup/clean.inc');
?>
--EXPECT--
Create a temporary mailbox and add 10 msgs
New mailbox created
Delete 4 messages for Unique ID generation
array(1) {
[0]=>
int(9)
}
After expunging: bool(false)
array(5) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(7)
[3]=>
int(8)
[4]=>
int(10)
}
+3 -3
View File
@@ -2,16 +2,16 @@
Test imap_errors() function : invalid password
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
require_once __DIR__.'/setup/skipif.inc';
?>
--FILE--
<?php
echo "*** Testing imap_errors() : invalid password ***\n";
require_once(__DIR__.'/imap_include.inc');
require_once __DIR__.'/setup/imap_include.inc';
$password = "bogus"; // invalid password to use in this test
echo "Issue opening with invalid password, 1 retry\n";
$mbox = imap_open($default_mailbox, $username, $password, OP_READONLY, 1);
$mbox = imap_open(IMAP_DEFAULT_MAILBOX, IMAP_MAILBOX_USERNAME, $password, OP_READONLY, 1);
echo "List any errors\n";
var_dump(imap_errors());
@@ -2,16 +2,16 @@
Test imap_fetch_overview() function : basic functionality
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
echo "*** Testing imap_fetch_overview() : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
require_once __DIR__.'/setup/imap_include.inc';
// create a new mailbox and add two new messages to it
$stream_id = setup_test_mailbox('', 2, $mailbox, 'notSimple');
$stream_id = setup_test_mailbox('imapfetchoverviewbasic', 2, $mailbox, false);
// get UID for new message
$msg_no = imap_uid($stream_id, 1);
@@ -40,12 +40,13 @@ imap_close($stream_id);
?>
--CLEAN--
<?php
require_once(__DIR__.'/clean.inc');
$mailbox_suffix = 'imapfetchoverviewbasic';
require_once __DIR__.'/setup/clean.inc';
?>
--EXPECTF--
*** Testing imap_fetch_overview() : basic functionality ***
Create a temporary mailbox and add 2 msgs
.. mailbox '{%s}%s' created
New mailbox created
-- All possible arguments --
@@ -0,0 +1,29 @@
--TEST--
imap_fetch_overview() passing a unique ID
--SKIPIF--
<?php
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
require_once(__DIR__.'/setup/imap_include.inc');
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapfetchoverviewuid", $msg_no, $uid);
// Usage of == because comparing objects
var_dump(imap_fetch_overview($imap_mail_box, $uid, FT_UID) == imap_fetch_overview($imap_mail_box, $msg_no));
imap_close($imap_mail_box);
?>
--CLEAN--
<?php
$mailbox_suffix = 'imapfetchoverviewuid';
require_once(__DIR__ . '/setup/clean.inc');
?>
--EXPECT--
Create a temporary mailbox and add 10 msgs
New mailbox created
Delete 4 messages for Unique ID generation
bool(true)
@@ -2,7 +2,7 @@
Test imap_fetch_overview() function : usage variations - FT_UID option
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
@@ -14,19 +14,20 @@ require_once(__DIR__.'/skipif.inc');
echo "*** Testing imap_fetch_overview() : usage variations ***\n";
require_once(__DIR__.'/imap_include.inc');
require_once __DIR__.'/setup/imap_include.inc';
// Initialise required variables
$stream_id = setup_test_mailbox('', 1); // set up temporary mailbox with one simple message
$stream_id = setup_test_mailbox('imapfetchoverviewvar3', 1); // set up temporary mailbox with one simple message
$msg_no = 1;
$msg_uid = imap_uid($stream_id, $msg_no);
$flags = array ('1',
true,
1.000000000000001,
0.00001e5,
245
);
$flags = [
'1',
true,
1.000000000000001,
0.00001e5,
245,
];
imap_check($stream_id);
foreach($flags as $option) {
@@ -45,12 +46,13 @@ foreach($flags as $option) {
?>
--CLEAN--
<?php
require_once(__DIR__.'/clean.inc');
$mailbox_suffix = 'imapfetchoverviewvar3';
require_once(__DIR__.'/setup/clean.inc');
?>
--EXPECTF--
--EXPECT--
*** Testing imap_fetch_overview() : usage variations ***
Create a temporary mailbox and add 1 msgs
.. mailbox '{%s}%s' created
New mailbox created
Testing with option value:string(1) "1"
imap_fetch_overview() returns an object
@@ -2,7 +2,7 @@
Test imap_fetch_overview() function : usage variations - $msg_no argument
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
@@ -12,25 +12,31 @@ require_once(__DIR__.'/skipif.inc');
*/
echo "*** Testing imap_fetch_overview() : usage variations ***\n";
require_once(__DIR__.'/imap_include.inc');
require_once __DIR__.'/setup/imap_include.inc';
$stream_id = setup_test_mailbox('', 3, $mailbox, 'notSimple'); // set up temp mailbox with 3 msgs
$stream_id = setup_test_mailbox('imapfetchoverviewvar5', 3, $mailbox, false); // set up temp mailbox with 3 msgs
$sequences = array (0, 4, '4', // out of range
'2', '1,3', '1, 2',
'1:3'); // pass uid without setting FT_UID option
$sequences = [
0,
4, // out of range
'4', // out of range
'2',
'1,3',
'1, 2',
'1:3', // pass uid without setting FT_UID option
];
foreach($sequences as $msg_no) {
foreach ($sequences as $msg_no) {
echo "\n-- \$msg_no is $msg_no --\n";
$overview = imap_fetch_overview($stream_id, $msg_no);
$overview = imap_fetch_overview($stream_id, $msg_no);
if (!$overview) {
echo imap_last_error() . "\n";
} else {
} else {
foreach($overview as $ov) {
echo "\n";
displayOverviewFields($ov);
}
}
}
}
// clear error stack
@@ -38,12 +44,13 @@ imap_errors();
?>
--CLEAN--
<?php
require_once(__DIR__.'/clean.inc');
$mailbox_suffix = 'imapfetchoverviewvar5';
require_once(__DIR__.'/setup/clean.inc');
?>
--EXPECTF--
*** Testing imap_fetch_overview() : usage variations ***
Create a temporary mailbox and add 3 msgs
.. mailbox '{%s}%s' created
New mailbox created
-- $msg_no is 0 --
Sequence out of range
@@ -2,7 +2,7 @@
Test imap_fetch_overview() function : usage variations - multipart message
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
@@ -12,9 +12,9 @@ require_once(__DIR__.'/skipif.inc');
echo "*** Testing imap_fetch_overview() : usage variations ***\n";
require_once(__DIR__.'/imap_include.inc');
require_once __DIR__.'/setup/imap_include.inc';
$stream_id = setup_test_mailbox('', 0, $mailbox); // setup temp mailbox
$stream_id = setup_test_mailbox('imapfetchoverviewvar6', 0, $mailbox); // setup temp mailbox
create_multipart_message($stream_id, $mailbox);
// refresh msg numbers
@@ -37,7 +37,7 @@ displayOverviewFields($a[0]);
function create_multipart_message($imap_stream, $mailbox) {
global $users, $domain;
$envelope["from"]= "foo@anywhere.com";
$envelope["to"] = "$users[0]@$domain";
$envelope["to"] = IMAP_USERS[0] . '@' . IMAP_MAIL_DOMAIN;
$envelope["subject"] = "Test msg 1";
$part1["type"] = TYPEMULTIPART;
@@ -82,12 +82,13 @@ function create_multipart_message($imap_stream, $mailbox) {
?>
--CLEAN--
<?php
require_once(__DIR__.'/clean.inc');
$mailbox_suffix = 'imapfetchoverviewvar6';
require_once(__DIR__.'/setup/clean.inc');
?>
--EXPECTF--
*** Testing imap_fetch_overview() : usage variations ***
Create a temporary mailbox and add 0 msgs
.. mailbox '{%s}%s' created
New mailbox created
--> Object #1
size is %d
+6 -5
View File
@@ -2,7 +2,7 @@
Test imap_fetchbody() function : basic functionality
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
@@ -12,12 +12,12 @@ require_once(__DIR__.'/skipif.inc');
*/
echo "*** Testing imap_fetchbody() : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
require_once(__DIR__.'/setup/imap_include.inc');
// Initialise all required variables
// set up mailbox with one message
$stream_id = setup_test_mailbox('', 1, $mailbox, 'notSimple');
$stream_id = setup_test_mailbox('imapfetchbodybasic', 1, $mailbox, false);
$msg_no = 1;
$section = '2';
@@ -57,12 +57,13 @@ var_dump( $overview[0]->seen );
?>
--CLEAN--
<?php
require_once(__DIR__.'/clean.inc');
$mailbox_suffix = 'imapfetchbodybasic';
require_once(__DIR__.'/setup/clean.inc');
?>
--EXPECTF--
*** Testing imap_fetchbody() : basic functionality ***
Create a temporary mailbox and add 1 msgs
.. mailbox '{%s}%s' created
New mailbox created
-- All possible arguments --
-- Option is FT_UID --
+49
View File
@@ -0,0 +1,49 @@
--TEST--
imap_fetchbody() errors: ValueError and Warnings
--SKIPIF--
<?php
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
require_once(__DIR__.'/setup/imap_include.inc');
$imap_mail_box = setup_test_mailbox("imapfetchbodyerrors", 0);
$section = '';
try {
imap_fetchbody($imap_mail_box, -1, $section);
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
try {
imap_fetchbody($imap_mail_box, 1, $section, -1);
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
// Access not existing
var_dump(imap_fetchbody($imap_mail_box, 255, $section));
var_dump(imap_fetchbody($imap_mail_box, 255, $section, FT_UID));
imap_close($imap_mail_box);
?>
--CLEAN--
<?php
$mailbox_suffix = 'imapfetchbodyerrors';
require_once(__DIR__ . '/setup/clean.inc');
?>
--EXPECTF--
Create a temporary mailbox and add 0 msgs
New mailbox created
imap_fetchbody(): Argument #2 ($message_num) must be greater than 0
imap_fetchbody(): Argument #4 ($flags) must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL
Warning: imap_fetchbody(): Bad message number in %s on line %d
bool(false)
Warning: imap_fetchbody(): UID does not exist in %s on line %d
bool(false)
+29
View File
@@ -0,0 +1,29 @@
--TEST--
imap_fetchbody() passing a unique ID
--SKIPIF--
<?php
require_once(__DIR__.'/setup/skipif.inc');
?>
--FILE--
<?php
require_once(__DIR__.'/setup/imap_include.inc');
$imap_mail_box = setup_test_mailbox_for_uid_tests("imapfetchbodyuid", $msg_no, $uid);
$section = '2';
var_dump(imap_fetchbody($imap_mail_box, $uid, $section, FT_UID) === imap_fetchbody($imap_mail_box, $msg_no, $section));
imap_close($imap_mail_box);
?>
--CLEAN--
<?php
$mailbox_suffix = 'imapfetchbodyuid';
require_once(__DIR__ . '/setup/clean.inc');
?>
--EXPECT--
Create a temporary mailbox and add 10 msgs
New mailbox created
Delete 4 messages for Unique ID generation
bool(true)
Loaded 100 of 407 files, more files were not shown because too many files have changed in this diff. Show more