mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 10:10:50 +00:00
Compare commits
263
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94d96b3c97 | ||
|
|
701e423288 | ||
|
|
b7f837381e | ||
|
|
b4b4a75afc | ||
|
|
83e42955a3 | ||
|
|
de78786566 | ||
|
|
c2fbab392c | ||
|
|
a53d67ceac | ||
|
|
305500a3b1 | ||
|
|
c0a1c2c5ee | ||
|
|
40d9e3ab86 | ||
|
|
724e241c9d | ||
|
|
b6d043aae2 | ||
|
|
54248b18fe | ||
|
|
1e6c7e776c | ||
|
|
2e974c8c81 | ||
|
|
15d9c42070 | ||
|
|
10c9d615de | ||
|
|
b3377028dc | ||
|
|
66e390707c | ||
|
|
a12e7affd7 | ||
|
|
d254078020 | ||
|
|
a221e17b41 | ||
|
|
b0e858da8b | ||
|
|
ccb7f1c7d8 | ||
|
|
7a89157f8c | ||
|
|
81f012a164 | ||
|
|
e4e88bd7e3 | ||
|
|
ad8eb116d8 | ||
|
|
d6b4b82a38 | ||
|
|
4e51059d52 | ||
|
|
43741a3f26 | ||
|
|
c927c831e6 | ||
|
|
54a63d91b8 | ||
|
|
9e3ba775b7 | ||
|
|
a5527577e7 | ||
|
|
15b51a215a | ||
|
|
dde5572937 | ||
|
|
288581fade | ||
|
|
d63aedd173 | ||
|
|
e450621f5e | ||
|
|
9b678bc4d5 | ||
|
|
4922049213 | ||
|
|
26c7b9402d | ||
|
|
c95680d4b7 | ||
|
|
f3d5877845 | ||
|
|
e9f9e9f863 | ||
|
|
106e7e4bca | ||
|
|
fcfa7fd06b | ||
|
|
ef342b0730 | ||
|
|
a073b0218c | ||
|
|
b9ea8d6b96 | ||
|
|
fb69c7752d | ||
|
|
8d268e8443 | ||
|
|
186b766368 | ||
|
|
23193e89e4 | ||
|
|
71b5f1446e | ||
|
|
44b234a9bc | ||
|
|
18517e7a63 | ||
|
|
9c0712d2cd | ||
|
|
311a77d08e | ||
|
|
2df09b9b64 | ||
|
|
bfa69d27bc | ||
|
|
713ef8511b | ||
|
|
fb4bc0f9e5 | ||
|
|
20e75329f2 | ||
|
|
d6ae0f010e | ||
|
|
65f5573bc8 | ||
|
|
c3734f9ae1 | ||
|
|
bd72e4aa44 | ||
|
|
bd093ad861 | ||
|
|
db34491a62 | ||
|
|
2d467abc46 | ||
|
|
7971602574 | ||
|
|
9dc42b4114 | ||
|
|
a83cc03c13 | ||
|
|
b52db133df | ||
|
|
8588ae7215 | ||
|
|
77325c4448 | ||
|
|
426fe2f20c | ||
|
|
e45cc31c41 | ||
|
|
724ee93ce6 | ||
|
|
8f8e6f95af | ||
|
|
1a1eeee716 | ||
|
|
0f6c41c6f8 | ||
|
|
0697a64f7e | ||
|
|
98cccd304a | ||
|
|
5d5c1cea5f | ||
|
|
261faa62da | ||
|
|
53f7bddbeb | ||
|
|
8d2a1c8966 | ||
|
|
d386ed1e6b | ||
|
|
7bc7a80445 | ||
|
|
72cd5793be | ||
|
|
9dda22bd1e | ||
|
|
f2833ca1be | ||
|
|
d6fcaf5da4 | ||
|
|
a89aaf6c38 | ||
|
|
7a61984a2b | ||
|
|
5aaffc8095 | ||
|
|
83cf4aa13a | ||
|
|
c283f53b24 | ||
|
|
44475e70e2 | ||
|
|
1674c96c0b | ||
|
|
8ad2b59e12 | ||
|
|
f06afc434a | ||
|
|
5dfec886d6 | ||
|
|
648cda6c9f | ||
|
|
4959c60524 | ||
|
|
31eafedf2e | ||
|
|
f1d11c118d | ||
|
|
841b00f641 | ||
|
|
5f36d0497f | ||
|
|
57463cf78b | ||
|
|
32cd5a1bc8 | ||
|
|
ecee3f1209 | ||
|
|
0076b47326 | ||
|
|
a55402d07c | ||
|
|
24a19cc232 | ||
|
|
a0baa09b99 | ||
|
|
4643c0aac5 | ||
|
|
ed9532cff0 | ||
|
|
666833b238 | ||
|
|
5e15c9c41f | ||
|
|
d5a82e2c4e | ||
|
|
15073d8e1d | ||
|
|
fdb05b92bf | ||
|
|
e77ac88a44 | ||
|
|
44ccccdfb8 | ||
|
|
5b3809e942 | ||
|
|
0ce9b5f755 | ||
|
|
a505fc627e | ||
|
|
a87d620543 | ||
|
|
b855907f54 | ||
|
|
685708160e | ||
|
|
08919578ca | ||
|
|
3430d856ac | ||
|
|
e5aae35855 | ||
|
|
4f3cf983dc | ||
|
|
4e30ab33d8 | ||
|
|
8b281e5b6b | ||
|
|
8e25cf26af | ||
|
|
bcefbf8602 | ||
|
|
07c5efbd76 | ||
|
|
4a10037cb4 | ||
|
|
2772f7c3ad | ||
|
|
f35b194029 | ||
|
|
4a7ebb6d83 | ||
|
|
f4e1768e21 | ||
|
|
0f579fd7c8 | ||
|
|
48ff654fb9 | ||
|
|
c61390cfb4 | ||
|
|
5240f8391f | ||
|
|
a9c44d1b5a | ||
|
|
49e1ed1941 | ||
|
|
3697648be5 | ||
|
|
6132389d1c | ||
|
|
ea372e7463 | ||
|
|
c65f0c7aca | ||
|
|
306555e11d | ||
|
|
217f247bb5 | ||
|
|
2fb12be84c | ||
|
|
f5b93626a6 | ||
|
|
518eb0ca2b | ||
|
|
233f507fe6 | ||
|
|
e3e6e1e59b | ||
|
|
367f8452c4 | ||
|
|
e3e67b721f | ||
|
|
308050e94b | ||
|
|
97d192b444 | ||
|
|
373fd61a51 | ||
|
|
7a3f25e370 | ||
|
|
e074e029ee | ||
|
|
4633e70ab1 | ||
|
|
37f96d990c | ||
|
|
cb399d0410 | ||
|
|
7fc2a3e15e | ||
|
|
cdd5ec7a3c | ||
|
|
70f59b3416 | ||
|
|
706241f82d | ||
|
|
fc26ad9b12 | ||
|
|
ae6e56fb98 | ||
|
|
d016434ad3 | ||
|
|
bf244757ee | ||
|
|
e589609b4c | ||
|
|
39f95f5614 | ||
|
|
337031abbd | ||
|
|
deb8b8190e | ||
|
|
5f9c82d514 | ||
|
|
b91bf22333 | ||
|
|
fa713ec17b | ||
|
|
03f8bccaf5 | ||
|
|
912cb8b8b5 | ||
|
|
4bbb98c24f | ||
|
|
68d5878097 | ||
|
|
807775b641 | ||
|
|
ce18899b44 | ||
|
|
337d2af6ca | ||
|
|
586ccfdfd5 | ||
|
|
4cf3da7383 | ||
|
|
9b1c02c2df | ||
|
|
221345a013 | ||
|
|
40ebfd6730 | ||
|
|
0dac69c059 | ||
|
|
ed949a1973 | ||
|
|
860f46e2f5 | ||
|
|
fa67864c13 | ||
|
|
c0d1dbcb43 | ||
|
|
c8df28d276 | ||
|
|
c7343510e4 | ||
|
|
881e43a03c | ||
|
|
2e27bb8682 | ||
|
|
c2b1182879 | ||
|
|
3c44e9c080 | ||
|
|
85c6e9b469 | ||
|
|
069f9cbaa5 | ||
|
|
46b9e0c874 | ||
|
|
06c4a501fd | ||
|
|
bbc0dd402a | ||
|
|
99a8ec6e24 | ||
|
|
feed041fc8 | ||
|
|
9841e8e411 | ||
|
|
fd75589b1f | ||
|
|
0a9b688bee | ||
|
|
e364af91b5 | ||
|
|
1523733bc4 | ||
|
|
f4a600be04 | ||
|
|
79a606bd95 | ||
|
|
1727d96d0e | ||
|
|
58d41b8c4f | ||
|
|
9cfb5261e4 | ||
|
|
df7417d127 | ||
|
|
0425a6697a | ||
|
|
3fb1b0862c | ||
|
|
c351768e4f | ||
|
|
78773890f6 | ||
|
|
e3c63de05b | ||
|
|
eb6d496a93 | ||
|
|
edf5c1901f | ||
|
|
bd321df479 | ||
|
|
64dc79f906 | ||
|
|
7bbed18086 | ||
|
|
f5be0e5110 | ||
|
|
a08a2b48b4 | ||
|
|
34dd032e4e | ||
|
|
2875d0f920 | ||
|
|
3d2819e491 | ||
|
|
d033d5c07a | ||
|
|
9acebe14df | ||
|
|
03e7854381 | ||
|
|
d776c31a34 | ||
|
|
eda7492604 | ||
|
|
2d2d42b268 | ||
|
|
de359c00b4 | ||
|
|
a0de82ad75 | ||
|
|
800cf5a20f | ||
|
|
b4a2a9662b | ||
|
|
11c4821ba9 | ||
|
|
855d8fa68f | ||
|
|
1aff51d421 | ||
|
|
9b627c6c27 | ||
|
|
c1f8dd4a33 | ||
|
|
822e1660c7 |
No files matched your search
@@ -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
|
||||
|
||||
@@ -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! >>>
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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===
|
||||
@@ -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
@@ -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===
|
||||
@@ -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
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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
@@ -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);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -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
@@ -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
|
||||
@@ -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)
|
||||
|
||||
@@ -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
@@ -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 */
|
||||
@@ -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();
|
||||
|
||||
@@ -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")) {
|
||||
|
||||
@@ -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
@@ -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)
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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'
|
||||
|
||||
Vendored
+3
-3
@@ -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
@@ -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
@@ -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"
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
final class COMPersistHelper
|
||||
{
|
||||
public function __construct(?variant $variant) {}
|
||||
public function __construct(?variant $variant = null) {}
|
||||
|
||||
public function GetCurFileName(): string|false {}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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 {
|
||||
|
||||
@@ -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 {}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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,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
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
@@ -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));
|
||||
|
||||
@@ -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
@@ -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 +0,0 @@
|
||||
imap
|
||||
@@ -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.
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
@@ -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
|
||||
@@ -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');
|
||||
?>
|
||||
?>
|
||||
@@ -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
|
||||
@@ -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) {
|
||||
}
|
||||
@@ -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)
|
||||
@@ -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);
|
||||
?>
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
@@ -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"
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
}
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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 --
|
||||
|
||||
@@ -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)
|
||||
@@ -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
Reference in new issue
Block a user