mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-08 17:50:50 +00:00
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acfdeccb2e | ||
|
|
8a7251c3b4 | ||
|
|
2c24590d6e | ||
|
|
919e91f841 | ||
|
|
a33d05b147 | ||
|
|
0c77b4307d | ||
|
|
54bccd7345 | ||
|
|
69155120e6 | ||
|
|
e2b5f18896 | ||
|
|
a8ceab8cda |
No files matched your search
@@ -11,7 +11,9 @@ end
|
||||
|
||||
define ____executor_globals
|
||||
if basic_functions_module.zts
|
||||
set $tsrm_ls = _tsrm_ls_cache
|
||||
if !$tsrm_ls
|
||||
set $tsrm_ls = ts_resource_ex(0, 0)
|
||||
end
|
||||
set $eg = ((zend_executor_globals*) (*((void ***) $tsrm_ls))[executor_globals_id-1])
|
||||
set $cg = ((zend_compiler_globals*) (*((void ***) $tsrm_ls))[compiler_globals_id-1])
|
||||
set $eg_ptr = $eg
|
||||
@@ -350,8 +352,7 @@ define ____print_ht
|
||||
end
|
||||
printf "[%d] ", $i
|
||||
if $p->key
|
||||
____print_str $p->key->val $p->key->len
|
||||
printf " => "
|
||||
printf "%s => ", $p->key->val
|
||||
else
|
||||
printf "%d => ", $p->h
|
||||
end
|
||||
|
||||
+1
-6
@@ -70,13 +70,10 @@ jobs:
|
||||
include:
|
||||
- env: ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
|
||||
arch: amd64
|
||||
if: type = cron
|
||||
- env: ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
|
||||
arch: amd64
|
||||
if: type = cron
|
||||
- env: ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 ARM64=1
|
||||
arch: arm64
|
||||
if: type = cron
|
||||
|
||||
before_script:
|
||||
- ccache --version
|
||||
@@ -92,9 +89,7 @@ before_script:
|
||||
|
||||
# Run PHPs run-tests.php
|
||||
script:
|
||||
# ARM64 CI reports nproc=32, which is excessive.
|
||||
- if [ -z "$ARM64" ]; then export JOBS=$(nproc); else export JOBS=16; fi
|
||||
- ./sapi/cli/php run-tests.php -P -d extension=`pwd`/modules/zend_test.so $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d opcache.protect_memory=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --show-slow 1000 --set-timeout 120 -j$JOBS
|
||||
- ./sapi/cli/php run-tests.php -P -d extension=`pwd`/modules/zend_test.so $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d opcache.protect_memory=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --show-slow 1000 --set-timeout 120 -j$(nproc)
|
||||
- sapi/cli/php -d extension_dir=`pwd`/modules -r 'dl("zend_test");'
|
||||
|
||||
after_success:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--------------------------------------------------------------------
|
||||
The PHP License, version 3.01
|
||||
Copyright (c) 1999 - 2021 The PHP Group. All rights reserved.
|
||||
Copyright (c) 1999 - 2019 The PHP Group. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -1,671 +1,11 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
29 Apr 2021, PHP 7.4.18
|
||||
|
||||
- Core:
|
||||
. Fixed bug #80781 (Error handler that throws ErrorException infinite loop).
|
||||
(Nikita)
|
||||
. Fixed bug #75776 (Flushing streams with compression filter is broken). (cmb)
|
||||
|
||||
- Dba:
|
||||
. Fixed bug #80817 (dba_popen() may cause segfault during RSHUTDOWN). (cmb)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #66783 (UAF when appending DOMDocument to element). (cmb)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #80024 (Duplication of info about inherited socket after pool
|
||||
removing). (Jakub Zelenka)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #80880 (SSL_read on shutdown, ftp/proc_open). (cmb, Jakub
|
||||
Zelenka)
|
||||
|
||||
- Imap:
|
||||
. Fixed bug #80710 (imap_mail_compose() header injection). (cmb, Stas)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #80763 (msgfmt_format() does not accept DateTime references).
|
||||
(cmb)
|
||||
|
||||
- LibXML:
|
||||
. Fixed bug #51903 (simplexml_load_file() doesn't use HTTP headers). (cmb)
|
||||
. Fixed bug #73533 (Invalid memory access in php_libxml_xmlCheckUTF8). (cmb)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #80713 (SegFault when disabling ATTR_EMULATE_PREPARES and
|
||||
MySQL 8.0). (Nikita)
|
||||
. Fixed bug #80837 (Calling stmt_store_result after fetch doesn't throw an
|
||||
error). (Kamil Tekiela)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #80805 (create simple class and get error in opcache.so). (Nikita)
|
||||
. Fixed bug #80950 (Variables become null in if statements). (Nikita)
|
||||
|
||||
- Pcntl:
|
||||
. Fixed bug #79812 (Potential integer overflow in pcntl_exec()). (cmb)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #80866 (preg_split ignores limit flag when pattern with \K has
|
||||
0-width fullstring match). (Kamil Tekiela)
|
||||
|
||||
- PDO_ODBC:
|
||||
. Fixed bug #80783 (PDO ODBC truncates BLOB records at every 256th byte).
|
||||
(cmb)
|
||||
|
||||
- PDO_pgsql:
|
||||
. Fixed bug #80892 (PDO::PARAM_INT is treated the same as PDO::PARAM_STR).
|
||||
(Matteo)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #80757 (Exit code is 0 when could not open file). (Felipe)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #80774 (session_name() problem with backslash). (cmb)
|
||||
. Fixed bug #80889 (Cannot set save handler when save_handler is invalid).
|
||||
(cmb)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #69668 (SOAP special XML characters in namespace URIs not
|
||||
encoded). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #78719 (http wrapper silently ignores long Location headers).
|
||||
(cmb)
|
||||
. Fixed bug #80771 (phpinfo(INFO_CREDITS) displays nothing in CLI). (cmb)
|
||||
. Fixed bug #80838 (HTTP wrapper waits for HTTP 1 response after HTTP 101).
|
||||
(manuelm)
|
||||
. Fixed bug #80915 (Taking a reference to $_SERVER hides its values from
|
||||
phpinfo()). (Rowan Tommins)
|
||||
|
||||
04 Mar 2021, php 7.4.16
|
||||
|
||||
- Core:
|
||||
. Fixed #80706 (mail(): Headers after Bcc headers may be ignored). (cmb)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #78680 (mysqlnd's mysql_clear_password does not transmit
|
||||
null-terminated password). (Daniel Black)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #74779 (x() and y() truncating floats to integers). (cmb)
|
||||
|
||||
- OPcache:
|
||||
. Fixed bug #80682 (opcache doesn't honour pcre.jit option). (Remi)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #80747 (Providing RSA key size < 512 generates key that crash
|
||||
PHP). (Nikita)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #75850 (Unclear error message wrt. __halt_compiler() w/o
|
||||
semicolon) (cmb)
|
||||
. Fixed bug #70091 (Phar does not mark UTF-8 filenames in ZIP archives). (cmb)
|
||||
. Fixed bug #53467 (Phar cannot compress large archives). (cmb, lserni)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug#80719 (Iterating after failed ArrayObject::setIteratorClass()
|
||||
causes Segmentation fault). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #80654 (file_get_contents() maxlen fails above (2**31)-1 bytes).
|
||||
(cmb)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #80648 (Fix for bug 79296 should be based on runtime version).
|
||||
(cmb, Remi)
|
||||
|
||||
04 Feb 2021, PHP 7.4.15
|
||||
|
||||
- Core:
|
||||
. Fixed bug #80523 (bogus parse error on >4GB source code). (Nikita)
|
||||
. Fixed bug #80384 (filter buffers entire read until file closed). (Adam
|
||||
Seitz, cmb)
|
||||
|
||||
- Curl:
|
||||
. Fixed bug #80595 (Resetting POSTFIELDS to empty array breaks request). (cmb)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #80376 (last day of the month causes runway cpu usage. (Derick)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #67983 (mysqlnd with MYSQLI_OPT_INT_AND_FLOAT_NATIVE fails to
|
||||
interpret bit columns). (Nikita)
|
||||
. Fixed bug #64638 (Fetching resultsets from stored procedure with cursor
|
||||
fails). (Nikita)
|
||||
. Fixed bug #72862 (segfault using prepared statements on stored procedures
|
||||
that use a cursor). (Nikita)
|
||||
. Fixed bug #77935 (Crash in mysqlnd_fetch_stmt_row_cursor when calling an SP
|
||||
with a cursor). (Nikita)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #77565 (Incorrect locator detection in ZIP-based phars). (cmb)
|
||||
. Fixed bug #69279 (Compressed ZIP Phar extractTo() creates garbage files).
|
||||
(cmb)
|
||||
|
||||
07 Jan 2021, PHP 7.4.14
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74558 (Can't rebind closure returned by Closure::fromCallable()).
|
||||
(cmb)
|
||||
. 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 #80362 (Running dtrace scripts can cause php to crash).
|
||||
(al at coralnet dot name)
|
||||
. Fixed bug #80393 (Build of PHP extension fails due to configuration gap
|
||||
with libtool). (kir dot morozov at gmail dot com)
|
||||
. Fixed bug #80402 (configure filtering out -lpthread). (Nikita)
|
||||
. Fixed bug #77069 (stream filter loses final block of data). (cmb)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #77961 (finfo_open crafted magic parsing SIGABRT). (cmb)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #69625 (FPM returns 200 status on request without
|
||||
SCRIPT_FILENAME env). (Jakub Zelenka)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #80425 (MessageFormatAdapter::getArgTypeList redefined). (Nikita)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #80368 (OpenSSL extension fails to build against LibreSSL due to
|
||||
lack of OCB support). (Nikita)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #73809 (Phar Zip parse crash - mmap fail). (cmb)
|
||||
. Fixed bug #75102 (`PharData` says invalid checksum for valid tar). (cmb)
|
||||
. Fixed bug #77322 (PharData::addEmptyDir('/') Possible integer overflow).
|
||||
(cmb)
|
||||
|
||||
- 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 #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)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #77423 (FILTER_VALIDATE_URL accepts URLs with invalid userinfo).
|
||||
(CVE-2020-7071) (cmb)
|
||||
. Fixed bug #80366 (Return Value of zend_fstat() not Checked). (sagpant, cmb)
|
||||
. Fixed bug #80411 (References to null-serialized object break serialize()).
|
||||
(Nikita)
|
||||
|
||||
- Tidy:
|
||||
. Fixed bug #77594 (ob_tidyhandler is never reset). (cmb)
|
||||
|
||||
- Zlib:
|
||||
. Fixed #48725 (Support for flushing in zlib stream). (cmb)
|
||||
|
||||
26 Nov 2020, PHP 7.4.13
|
||||
|
||||
- Core:
|
||||
. Fixed bug #80280 (ADD_EXTENSION_DEP() fails for ext/standard and ext/date).
|
||||
(cmb)
|
||||
. Fixed bug #80258 (Windows Deduplication Enabled, randon permission errors).
|
||||
(cmb)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #62474 (com_event_sink crashes on certain arguments). (cmb)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #80268 (loadHTML() truncates at NUL bytes). (cmb)
|
||||
|
||||
- FFI:
|
||||
. Fixed bug #79177 (FFI doesn't handle well PHP exceptions within callback).
|
||||
(cmb, Dmitry, Nikita)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #64076 (imap_sort() does not return FALSE on failure). (cmb)
|
||||
. 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)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #79375 (mysqli_store_result does not report error from lock wait
|
||||
timeout). (Kamil Tekiela, Nikita)
|
||||
. Fixed bug #76525 (mysqli::commit does not throw if MYSQLI_REPORT_ERROR
|
||||
enabled and mysqlnd used). (Kamil Tekiela)
|
||||
. Fixed bug #72413 (mysqlnd segfault (fetch_row second parameter
|
||||
typemismatch)). (Kamil Tekiela)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #44618 (Fetching may rely on uninitialized data). (cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #79643 (PHP with Opcache crashes when a file with specific name
|
||||
is included). (twosee)
|
||||
. Fixed run-time binding of preloaded dynamically declared function. (Dmitry)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #79983 (openssl_encrypt / openssl_decrypt fail with OCB mode).
|
||||
(Nikita)
|
||||
|
||||
- PDO MySQL:
|
||||
. Fixed bug #66528 (No PDOException or errorCode if database becomes
|
||||
unavailable before PDO::commit). (Nikita)
|
||||
. Fixed bug #65825 (PDOStatement::fetch() does not throw exception on broken
|
||||
server connection). (Nikita)
|
||||
|
||||
- SNMP:
|
||||
. Fixed bug #70461 (disable md5 code when it is not supported in net-snmp).
|
||||
(Alexander Bergmann, cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #80266 (parse_url silently drops port number 0). (cmb, Nikita)
|
||||
|
||||
29 Oct 2020, PHP 7.4.12
|
||||
|
||||
- Core:
|
||||
. Fixed bug #80061 (Copying large files may have suboptimal performance).
|
||||
(cmb)
|
||||
. Fixed bug #79423 (copy command is limited to size of file it can copy).
|
||||
(cmb)
|
||||
. Fixed bug #80126 (Covariant return types failing compilation). (Nikita)
|
||||
. Fixed bug #80186 (Segfault when iterating over FFI object). (Nikita)
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #80185 (jdtounix() fails after 2037). (cmb)
|
||||
|
||||
- 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)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #80115 (mysqlnd.debug doesn't recognize absolute paths with
|
||||
slashes). (cmb)
|
||||
. Fixed bug #80107 (mysqli_query() fails for ~16 MB long query when
|
||||
compression is enabled). (Nikita)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #78470 (odbc_specialcolumns() no longer accepts $nullable). (cmb)
|
||||
. Fixed bug #80147 (BINARY strings may not be properly zero-terminated).
|
||||
(cmb)
|
||||
. Fixed bug #80150 (Failure to fetch error message). (cmb)
|
||||
. Fixed bug #80152 (odbc_execute() moves internal pointer of $params). (cmb)
|
||||
. Fixed bug #46050 (odbc_next_result corrupts prepared resource). (cmb)
|
||||
|
||||
- OPcache:
|
||||
. Fixed bug #80083 (Optimizer pass 6 removes variables used for ibm_db2 data
|
||||
binding). (Nikita)
|
||||
. Fixed bug #80194 (Assertion failure during block assembly of unreachable
|
||||
free with leading nop). (Nikita)
|
||||
|
||||
- PCRE:
|
||||
. Updated to PCRE 10.35. (cmb)
|
||||
. Fixed bug #80118 (Erroneous whitespace match with JIT only). (cmb)
|
||||
|
||||
- PDO_ODBC:
|
||||
. Fixed bug #67465 (NULL Pointer dereference in odbc_handle_preparer). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #80114 (parse_url does not accept URLs with port 0). (cmb, twosee)
|
||||
. Fixed bug #76943 (Inconsistent stream_wrapper_restore() errors). (cmb)
|
||||
. Fixed bug #76735 (Incorrect message in fopen on invalid mode). (cmb)
|
||||
|
||||
- Tidy:
|
||||
. Fixed bug #77040 (tidyNode::isHtml() is completely broken). (cmb)
|
||||
|
||||
01 Oct 2020, PHP 7.4.11
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79979 (passing value to by-ref param via CUFA crashes). (cmb,
|
||||
Nikita)
|
||||
. Fixed bug #80037 (Typed property must not be accessed before initialization
|
||||
when __get() declared). (Nikita)
|
||||
. Fixed bug #80048 (Bug #69100 has not been fixed for Windows). (cmb)
|
||||
. Fixed bug #80049 (Memleak when coercing integers to string via variadic
|
||||
argument). (Nikita)
|
||||
. Fixed bug #79699 (PHP parses encoded cookie names so malicious `__Host-`
|
||||
cookies can be sent). (CVE-2020-7070) (Stas)
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #80007 (Potential type confusion in unixtojd() parameter parsing).
|
||||
(Andy Postnikov)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #64130 (COM obj parameters passed by reference are not updated).
|
||||
(cmb)
|
||||
|
||||
- OPcache:
|
||||
. Fixed bug #80002 (calc free space for new interned string is wrong).
|
||||
(t-matsuno)
|
||||
. Fixed bug #80046 (FREE for SWITCH_STRING optimized away). (Nikita)
|
||||
. Fixed bug #79825 (opcache.file_cache causes SIGSEGV when custom opcode
|
||||
handlers changed). (SammyK)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #79601 (Wrong ciphertext/tag in AES-CCM encryption for a 12
|
||||
bytes IV). (CVE-2020-7069) (Jakub Zelenka)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #80027 (Terrible performance using $query->fetch on queries with
|
||||
many bind parameters). (Matteo)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #47021 (SoapClient stumbles over WSDL delivered with
|
||||
"Transfer-Encoding: chunked"). (Matteo)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79986 (str_ireplace bug with diacritics characters). (cmb)
|
||||
. Fixed bug #80077 (getmxrr test bug). (Rainer Jung)
|
||||
. Fixed bug #72941 (Modifying bucket->data by-ref has no effect any longer).
|
||||
(cmb)
|
||||
. Fixed bug #80067 (Omitting the port in bindto setting errors). (cmb)
|
||||
|
||||
03 Sep 2020, PHP 7.4.10
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79884 (PHP_CONFIG_FILE_PATH is meaningless). (cmb)
|
||||
. Fixed bug #77932 (File extensions are case-sensitive). (cmb)
|
||||
. Fixed bug #79806 (realpath() erroneously resolves link to link). (cmb)
|
||||
. Fixed bug #79895 (PHP_CHECK_GCC_ARG does not allow flags with equal sign).
|
||||
(Santiago M. Mola)
|
||||
. Fixed bug #79919 (Stack use-after-scope in define()). (cmb)
|
||||
. Fixed bug #79934 (CRLF-only line in heredoc causes parsing error).
|
||||
(Pieter van den Ham)
|
||||
. Fixed bug #79947 (Memory leak on invalid offset type in compound
|
||||
assignment). (Nikita)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #48585 (com_load_typelib holds reference, fails on second call).
|
||||
(cmb)
|
||||
|
||||
- Exif:
|
||||
. Fixed bug #75785 (Many errors from exif_read_data).
|
||||
(Níckolas Daniel da Silva)
|
||||
|
||||
- Gettext:
|
||||
. Fixed bug #70574 (Tests fail due to relying on Linux fallback behavior for
|
||||
gettext()). (Florian Engelhardt)
|
||||
|
||||
- LDAP:
|
||||
. Fixed memory leaks. (ptomulik)
|
||||
|
||||
- OPcache:
|
||||
. Fixed bug #73060 (php failed with error after temp folder cleaned up).
|
||||
(cmb)
|
||||
. Fixed bug #79917 (File cache segfault with a static variable in inherited
|
||||
method). (Nikita)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #64705 (errorInfo property of PDOException is null when
|
||||
PDO::__construct() fails). (Ahmed Abdou)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #79724 (Return type does not match in ext/session/mod_mm.c).
|
||||
(Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79930 (array_merge_recursive() crashes when called with array
|
||||
with single reference). (Nikita)
|
||||
. Fixed bug #79944 (getmxrr always returns true on Alpine linux). (Nikita)
|
||||
. Fixed bug #79951 (Memory leak in str_replace of empty string). (Nikita)
|
||||
|
||||
- XML:
|
||||
. Fixed bug #79922 (Crash after multiple calls to xml_parser_free()). (cmb)
|
||||
|
||||
06 Aug 2020, PHP 7.4.9
|
||||
|
||||
- Apache:
|
||||
. Fixed bug #79030 (Upgrade apache2handler's php_apache_sapi_get_request_time
|
||||
to return usec). (Herbert256)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #63208 (BSTR to PHP string conversion not binary safe). (cmb)
|
||||
. Fixed bug #63527 (DCOM does not work with Username, Password parameter).
|
||||
(cmb)
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79877 (getimagesize function silently truncates after a null
|
||||
byte) (cmb)
|
||||
. Fixed bug #79740 (serialize() and unserialize() methods can not be called
|
||||
statically). (Nikita)
|
||||
. Fixed bug #79783 (Segfault in php_str_replace_common). (Nikita)
|
||||
. Fixed bug #79778 (Assertion failure if dumping closure with unresolved
|
||||
static variable). (Nikita)
|
||||
. Fixed bug #79779 (Assertion failure when assigning property of string
|
||||
offset by reference). (Nikita)
|
||||
. Fixed bug #79792 (HT iterators not removed if empty array is destroyed).
|
||||
(Nikita)
|
||||
. Fixed bug #78598 (Changing array during undef index RW error segfaults).
|
||||
(Nikita)
|
||||
. Fixed bug #79784 (Use after free if changing array during undef var during
|
||||
array write fetch). (Nikita)
|
||||
. Fixed bug #79793 (Use after free if string used in undefined index warning
|
||||
is changed). (Nikita)
|
||||
. Fixed bug #79862 (Public non-static property in child should take priority
|
||||
over private static). (Nikita)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #79756 (finfo_file crash (FILEINFO_MIME)). (cmb)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #55857 (ftp_size on large files). (cmb)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #79787 (mb_strimwidth does not trim string). (XXiang)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #79881 (Memory leak in openssl_pkey_get_public()). (Nikita)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #79797 (Use of freed hash key in the phar_parse_zipfile
|
||||
function). (CVE-2020-7068) (cmb)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #79487 (::getStaticProperties() ignores property modifications).
|
||||
(cmb, Nikita)
|
||||
. Fixed bug #69804 (::getStaticPropertyValue() throws on protected props).
|
||||
(cmb, Nikita)
|
||||
. Fixed bug #79820 (Use after free when type duplicated into
|
||||
ReflectionProperty gets resolved). (Christopher Broadbent)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #70362 (Can't copy() large 'data://' with open_basedir). (cmb)
|
||||
. Fixed bug #78008 (dns_check_record() always return true on Alpine).
|
||||
(Andy Postnikov)
|
||||
. Fixed bug #79839 (array_walk() does not respect property types). (Nikita)
|
||||
|
||||
09 Jul 2020, PHP 7.4.8
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79595 (zend_init_fpu() alters FPU precision). (cmb, Nikita)
|
||||
. Fixed bug #79650 (php-win.exe 100% cpu lockup). (cmb)
|
||||
. Fixed bug #79668 (get_defined_functions(true) may miss functions). (cmb,
|
||||
Nikita)
|
||||
. Fixed bug #79683 (Fake reflection scope affects __toString()). (Nikita)
|
||||
. Fixed possibly unsupported timercmp() usage. (cmb)
|
||||
|
||||
- Exif:
|
||||
. Fixed bug #79687 (Sony picture - PHP Warning - Make, Model, MakerNotes).
|
||||
(cmb)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #79681 (mime_content_type/finfo returning incorrect mimetype).
|
||||
(cmb)
|
||||
|
||||
- Filter:
|
||||
. Fixed bug #73527 (Invalid memory access in php_filter_strip). (cmb)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #79676 (imagescale adds black border with IMG_BICUBIC). (cmb)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #62890 (default_socket_timeout=-1 causes connection to timeout).
|
||||
(cmb)
|
||||
|
||||
- PDO SQLite:
|
||||
. Fixed bug #79664 (PDOStatement::getColumnMeta fails on empty result set).
|
||||
(cmb)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #73926 (phpdbg will not accept input on restart execution). (cmb)
|
||||
. Fixed bug #73927 (phpdbg fails with windows error prompt at "watch array").
|
||||
(cmb)
|
||||
. Fixed several mostly Windows related phpdbg bugs. (cmb)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #79710 (Reproducible segfault in error_handler during GC
|
||||
involved an SplFileObject). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #74267 (segfault with streams and invalid data). (cmb)
|
||||
. Fixed bug #79579 (ZTS build of PHP 7.3.17 doesn't handle ERANGE for
|
||||
posix_getgrgid and others). (Böszörményi Zoltán)
|
||||
|
||||
11 Jun 2020, PHP 7.4.7
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79599 (coredump in set_error_handler). (Laruence)
|
||||
. Fixed bug #79566 (Private SHM is not private on Windows). (cmb)
|
||||
. Fixed bug #79489 (.user.ini does not inherit). (cmb)
|
||||
. Fixed bug #79600 (Regression in 7.4.6 when yielding an array based
|
||||
generator). (Nikita)
|
||||
. Fixed bug #79657 ("yield from" hangs when invalid value encountered).
|
||||
(Nikita)
|
||||
|
||||
- FFI:
|
||||
. Fixed bug #79571 (FFI: var_dumping unions may segfault). (cmb)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #79615 (Wrong GIF header written in GD GIFEncode). (sageptr, cmb)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #79596 (MySQL FLOAT truncates to int some locales). (cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #79588 (Boolean opcache settings ignore on/off values). (cmb)
|
||||
. Fixed bug #79548 (Preloading segfault with inherited method using static
|
||||
variable). (Nikita)
|
||||
. Fixed bug #79603 (RTD collision with opcache). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79561 (dns_get_record() fails with DNS_ALL). (cmb)
|
||||
|
||||
14 May 2020, PHP 7.4.6
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79536 (zend_clear_exception prevent exception's destructor to be
|
||||
called). (Laruence)
|
||||
. Fixed bug #78434 (Generator yields no items after valid() call). (Nikita)
|
||||
. Fixed bug #79477 (casting object into array creates references). (Nikita)
|
||||
. Fixed bug #79514 (Memory leaks while including unexistent file). (cmb,
|
||||
Nikita)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #78221 (DOMNode::normalize() doesn't remove empty text nodes).
|
||||
(cmb)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #79336 (ext/exif/tests/bug79046.phpt fails on Big endian arch).
|
||||
(Nikita)
|
||||
|
||||
- FCGI:
|
||||
. Fixed bug #79491 (Search for .user.ini extends up to root dir). (cmb)
|
||||
|
||||
- MBString:
|
||||
. Fixed bug #79441 (Segfault in mb_chr() if internal encoding is unsupported).
|
||||
(Girgias)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #79497 (stream_socket_client() throws an unknown error sometimes
|
||||
with <1s timeout). (Joe Cai)
|
||||
|
||||
- PCRE:
|
||||
. Upgraded to PCRE2 10.34. (cmb)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #79503 (Memory leak on duplicate metadata). (cmb)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #79528 (Different object of the same xml between 7.4.5 and
|
||||
7.4.4). (cmb)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #69264 (__debugInfo() ignored while extending SPL classes). (cmb)
|
||||
. Fixed bug #67369 (ArrayObject serialization drops the iterator class).
|
||||
(Alex Dowad)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79468 (SIGSEGV when closing stream handle with a stream filter
|
||||
appended). (dinosaur)
|
||||
. Fixed bug #79447 (Serializing uninitialized typed properties with __sleep
|
||||
should not throw). (nicolas-grekas)
|
||||
|
||||
16 Apr 2020, PHP 7.4.5
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79364 (When copy empty array, next key is unspecified). (cmb)
|
||||
. Fixed bug #78210 (Invalid pointer address). (cmb, Nikita)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #79199 (curl_copy_handle() memory leak). (cmb)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #79396 (DateTime hour incorrect during DST jump forward). (Nate
|
||||
Brunette)
|
||||
. Fixed bug #74940 (DateTimeZone loose comparison always true). (cmb)
|
||||
|
||||
- FPM:
|
||||
. Implement request #77062 (Allow numeric [UG]ID in FPM listen.{owner,group})
|
||||
(Andre Nathan)
|
||||
|
||||
- Iconv:
|
||||
. Fixed bug #79200 (Some iconv functions cut Windows-1258). (cmb)
|
||||
|
||||
- OPcache:
|
||||
. Fixed bug #79412 (Opcache chokes and uses 100% CPU on specific script).
|
||||
(Dmitry)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #79413 (session_create_id() fails for active sessions). (cmb)
|
||||
|
||||
- Shmop:
|
||||
. Fixed bug #79427 (Integer Overflow in shmop_open()). (cmb)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #61597 (SXE properties may lack attributes and content). (cmb)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #79357 (SOAP request segfaults when any request parameter is
|
||||
missing). (Nikita)
|
||||
|
||||
- Spl:
|
||||
. Fixed bug #75673 (SplStack::unserialize() behavior). (cmb)
|
||||
. Fixed bug #79393 (Null coalescing operator failing with SplFixedArray).
|
||||
(cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79330 (shell_exec() silently truncates after a null byte). (stas)
|
||||
. Fixed bug #79465 (OOB Read in urldecode()). (CVE-2020-7067) (stas)
|
||||
. Fixed bug #79410 (system() swallows last chunk if it is exactly 4095 bytes
|
||||
without newline). (Christian Schneider)
|
||||
|
||||
- Zip:
|
||||
. Fixed Bug #79296 (ZipArchive::open fails on empty file). (Remi)
|
||||
. Fixed bug #79424 (php_zip_glob uses gl_pathc after call to globfree).
|
||||
(Max Rees)
|
||||
|
||||
19 Mar 2020, PHP 7.4.4
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79329 (get_headers() silently truncates after a null byte)
|
||||
(CVE-2020-7066) (cmb)
|
||||
. Fixed bug #79244 (php crashes during parsing INI file). (Laruence)
|
||||
. Fixed bug #63206 (restore_error_handler does not restore previous errors
|
||||
mask). (Mark Plomer)
|
||||
@@ -697,12 +37,12 @@ PHP NEWS
|
||||
(cmb)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #79282 (Use-of-uninitialized-value in exif). (CVE-2020-7064)
|
||||
. Fixed bug #79282 (Use-of-uninitialized-value in exif) (CVE-2020-7064)
|
||||
(Nikita)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #79283 (Segfault in libmagic patch contains a buffer
|
||||
overflow). (cmb)
|
||||
overflow) (cmb)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #77653 (operator displayed instead of the real error message).
|
||||
@@ -710,8 +50,8 @@ PHP NEWS
|
||||
. Fixed bug #79014 (PHP-FPM & Primary script unknown). (Jakub Zelenka)
|
||||
|
||||
- MBstring:
|
||||
. Fixed bug #79371 (mb_strtolower (UTF-32LE): stack-buffer-overflow at
|
||||
php_unicode_tolower_full). (CVE-2020-7065) (cmb)
|
||||
. Fixed bug #79371 (mb_strtolower (UTF-32LE): stack-buffer-overflow at
|
||||
php_unicode_tolower_full) (CVE-2020-7065) (cmb)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #64032 (mysqli reports different client_version). (cmb)
|
||||
@@ -742,8 +82,6 @@ PHP NEWS
|
||||
. Fixed bug #79294 (::columnType() may fail after SQLite3Stmt::reset()). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79329 (get_headers() silently truncates after a null byte).
|
||||
(CVE-2020-7066) (cmb)
|
||||
. Fixed bug #79254 (getenv() w/o arguments not showing changes). (cmb)
|
||||
. Fixed bug #79265 (Improper injection of Host header when using fopen for
|
||||
http requests). (Miguel Xavier Penha Neto)
|
||||
|
||||
+7
-9
@@ -615,16 +615,14 @@ TSRM_API int shmget(key_t key, size_t size, int flags)
|
||||
{/*{{{*/
|
||||
shm_pair *shm;
|
||||
char shm_segment[26], shm_info[29];
|
||||
HANDLE shm_handle = NULL, info_handle = NULL;
|
||||
HANDLE shm_handle, info_handle;
|
||||
BOOL created = FALSE;
|
||||
|
||||
if (key != IPC_PRIVATE) {
|
||||
snprintf(shm_segment, sizeof(shm_segment), "TSRM_SHM_SEGMENT:%d", key);
|
||||
snprintf(shm_info, sizeof(shm_info), "TSRM_SHM_DESCRIPTOR:%d", key);
|
||||
snprintf(shm_segment, sizeof(shm_segment), "TSRM_SHM_SEGMENT:%d", key);
|
||||
snprintf(shm_info, sizeof(shm_info), "TSRM_SHM_DESCRIPTOR:%d", key);
|
||||
|
||||
shm_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_segment);
|
||||
info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info);
|
||||
}
|
||||
shm_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_segment);
|
||||
info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info);
|
||||
|
||||
if (!shm_handle && !info_handle) {
|
||||
if (flags & IPC_CREAT) {
|
||||
@@ -635,8 +633,8 @@ TSRM_API int shmget(key_t key, size_t size, int flags)
|
||||
DWORD high = 0;
|
||||
DWORD low = size;
|
||||
#endif
|
||||
shm_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, high, low, key == IPC_PRIVATE ? NULL : shm_segment);
|
||||
info_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(shm->descriptor), key == IPC_PRIVATE ? NULL : shm_info);
|
||||
shm_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, high, low, shm_segment);
|
||||
info_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(shm->descriptor), shm_info);
|
||||
created = TRUE;
|
||||
}
|
||||
if (!shm_handle || !info_handle) {
|
||||
|
||||
@@ -125,11 +125,6 @@ DOM:
|
||||
After: ReflectionMethod::getClosure($object = null)
|
||||
The new signature is also (LSP) compatible with older PHP versions.
|
||||
|
||||
- SAPI:
|
||||
. Starting with 7.4.11, incoming cookie names are not url-decoded. This was never
|
||||
required by the standard, outgoing cookie names aren't encoded and this leads
|
||||
to security issues (CVE-2020-7070).
|
||||
|
||||
- SPL:
|
||||
. Calling get_object_vars() on an ArrayObject instance will now always return
|
||||
the properties of the ArrayObject itself (or a subclass). Previously it
|
||||
|
||||
+4
-4
@@ -164,16 +164,16 @@ int main()
|
||||
double d = (double) LONG_MIN * LONG_MIN + 2e9;
|
||||
|
||||
if ((long) d == 2e9 && (long) -d == -2e9) {
|
||||
return 0;
|
||||
exit(0);
|
||||
}
|
||||
} else if (sizeof(long) == 8) {
|
||||
double correct = 18e18 - ((double) LONG_MIN * -2); /* Subtract ULONG_MAX + 1 */
|
||||
|
||||
if ((long) 18e18 == correct) { /* On 64-bit, only check between LONG_MAX and ULONG_MAX */
|
||||
return 0;
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
exit(1);
|
||||
}
|
||||
]])], [
|
||||
AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])
|
||||
@@ -284,7 +284,7 @@ int main()
|
||||
fprintf(fp, "%d %d\n", ZEND_MM_ALIGNMENT, zeros);
|
||||
fclose(fp);
|
||||
|
||||
return 0;
|
||||
exit(0);
|
||||
}
|
||||
]])], [
|
||||
LIBZEND_MM_ALIGN=`cat conftest.zend | cut -d ' ' -f 1`
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Array addition should not add INDIRECT elements
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$x = 1;
|
||||
$ary = ['y' => 1];
|
||||
$ary += $GLOBALS;
|
||||
var_dump($ary['x']);
|
||||
$x = 2;
|
||||
var_dump($ary['x']);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(1)
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Add $GLOBALS to itself
|
||||
--FILE--
|
||||
<?php
|
||||
$GLOBALS += $GLOBALS;
|
||||
$x = $GLOBALS + $GLOBALS;
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
HT iterator should be destroyed if array becomes empty during array_splice
|
||||
--FILE--
|
||||
<?php
|
||||
$a=[4];
|
||||
$i = 0;
|
||||
foreach ($a as &$r) {
|
||||
var_dump($r);
|
||||
$a = array_splice($a, 0);
|
||||
if (++$i == 2) break;
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
int(4)
|
||||
int(4)
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Assign concat of array and empty string
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = [0];
|
||||
$a .= '';
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Array to string conversion in %s on line %d
|
||||
string(5) "Array"
|
||||
@@ -20,7 +20,12 @@ function test() {
|
||||
test();
|
||||
echo "bug\n";
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception: ops 1 in %sbug53511.php:4
|
||||
Fatal error: Uncaught Exception: ops 2 in %sbug53511.php:11
|
||||
Stack trace:
|
||||
#0 %sbug53511.php(17): test()
|
||||
#1 {main}
|
||||
|
||||
Next Exception: ops 1 in %sbug53511.php:4
|
||||
Stack trace:
|
||||
#0 %sbug53511.php(12): Foo->__destruct()
|
||||
#1 %sbug53511.php(17): test()
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace N2 {
|
||||
echo $a->hello(), PHP_EOL;
|
||||
echo $a->foo(), PHP_EOL;
|
||||
try {
|
||||
} catch(namespace\Foo $e)
|
||||
} catch(namespace \Foo $e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63816: implementation child interface and after parent cause fatal error
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface RootInterface
|
||||
{
|
||||
function foo();
|
||||
}
|
||||
|
||||
interface FirstChildInterface extends RootInterface
|
||||
{
|
||||
function foo();
|
||||
}
|
||||
|
||||
interface SecondChildInterface extends RootInterface
|
||||
{
|
||||
function foo();
|
||||
}
|
||||
|
||||
class A implements FirstChildInterface, SecondChildInterface
|
||||
{
|
||||
function foo()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
class B implements RootInterface, FirstChildInterface
|
||||
{
|
||||
function foo()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
class C implements FirstChildInterface, RootInterface
|
||||
{
|
||||
function foo()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -7,4 +7,4 @@ $x = (new ReflectionFunction("substr"))->getClosure();
|
||||
$x->call(new a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot rebind scope of closure created from function in %s on line %d
|
||||
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
|
||||
@@ -14,5 +14,5 @@ var_dump($a);
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
["b"]=>
|
||||
int(2)
|
||||
int(1)
|
||||
}
|
||||
@@ -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 from method in %s on line %d
|
||||
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
|
||||
NULL
|
||||
@@ -15,6 +15,6 @@ var_dump(parse_ini_file($ini_file));
|
||||
unlink(__DIR__ . "/bug70748.ini");
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: syntax error, unexpected end of file, expecting '}' in %sbug70748.ini on line %d
|
||||
Warning: syntax error, unexpected $end, expecting '}' in %sbug70748.ini on line %d
|
||||
in %sbug70748.php on line %d
|
||||
bool(false)
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78598: Changing array during undef index RW error segfaults
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$my_var = null;
|
||||
set_error_handler(function() use(&$my_var) {
|
||||
$my_var = 0;
|
||||
});
|
||||
|
||||
$my_var[0] .= "xyz";
|
||||
var_dump($my_var);
|
||||
|
||||
$my_var = null;
|
||||
$my_var[0][0][0] .= "xyz";
|
||||
var_dump($my_var);
|
||||
|
||||
$my_var = null;
|
||||
$my_var["foo"] .= "xyz";
|
||||
var_dump($my_var);
|
||||
|
||||
$my_var = null;
|
||||
$my_var["foo"]["bar"]["baz"] .= "xyz";
|
||||
var_dump($my_var);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
||||
int(0)
|
||||
int(0)
|
||||
int(0)
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79364 (When copy empty array, next key is unspecified)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = [1, 2];
|
||||
unset($a[1], $a[0]);
|
||||
$b = $a;
|
||||
|
||||
$a[] = 3;
|
||||
$b[] = 4;
|
||||
|
||||
var_dump($a, $b);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(4)
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79477: casting object into array creates references
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public $prop = 'default value';
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$obj->{1} = null;
|
||||
|
||||
$arr = (array) $obj;
|
||||
$arr['prop'] = 'new value';
|
||||
|
||||
echo $obj->prop, "\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
default value
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79514 (Memory leaks while including unexistent file)
|
||||
--FILE--
|
||||
<?php
|
||||
$mem1 = memory_get_usage(true);
|
||||
for ($i = 0; $i < 100000; $i++) {
|
||||
@include __DIR__ . '/bug79514.doesnotexist';
|
||||
}
|
||||
$mem2 = memory_get_usage(true);
|
||||
var_dump($mem2 - $mem1 < 100000);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79599 (coredump in set_error_handler)
|
||||
--FILE--
|
||||
<?php
|
||||
set_error_handler(function($code, $message){
|
||||
throw new \Exception($message);
|
||||
});
|
||||
function test1(){
|
||||
$a[] = $b;
|
||||
}
|
||||
function test2(){
|
||||
$a[$c] = $b;
|
||||
}
|
||||
try{
|
||||
test1();
|
||||
}catch(\Exception $e){
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
try{
|
||||
test2();
|
||||
}catch(\Exception $e){
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
string(21) "Undefined variable: b"
|
||||
string(21) "Undefined variable: b"
|
||||
@@ -1,42 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79657: "yield from" hangs when invalid value encountered
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function throwException(): iterable
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
function loop(): iterable
|
||||
{
|
||||
$callbacks = [
|
||||
function () {
|
||||
yield 'first';
|
||||
},
|
||||
function () {
|
||||
yield from throwException();
|
||||
}
|
||||
];
|
||||
|
||||
foreach ($callbacks as $callback) {
|
||||
yield from $callback();
|
||||
}
|
||||
}
|
||||
|
||||
function get(string $first, int $second): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
get(...loop());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): throwException()
|
||||
#1 %s(%d): {closure}()
|
||||
#2 %s(%d): loop()
|
||||
#3 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79668 (get_defined_functions(true) may miss functions)
|
||||
--INI--
|
||||
disable_functions=sha1_file,password_hash
|
||||
--FILE--
|
||||
<?php
|
||||
$df = get_defined_functions(true);
|
||||
foreach (['sha1', 'sha1_file', 'hash', 'password_hash'] as $funcname) {
|
||||
var_dump(in_array($funcname, $df['internal'], true));
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79740: serialize() and unserialize() methods can not be called statically
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public function serialize() { }
|
||||
public function unserialize() { }
|
||||
}
|
||||
|
||||
var_dump(is_callable(['A', 'serialize']));
|
||||
var_dump(is_callable(['A', 'unserialize']));
|
||||
A::serialize();
|
||||
A::unserialize();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
||||
Deprecated: Non-static method A::serialize() should not be called statically in %s on line %d
|
||||
|
||||
Deprecated: Non-static method A::unserialize() should not be called statically in %s on line %d
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79778: Assertion failure if dumping closure with unresolved static variable
|
||||
--FILE--
|
||||
<?php
|
||||
$closure1 = function() {
|
||||
static $var = CONST_REF;
|
||||
};
|
||||
var_dump($closure1);
|
||||
print_r($closure1);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Closure)#1 (1) {
|
||||
["static"]=>
|
||||
array(1) {
|
||||
["var"]=>
|
||||
string(14) "<constant ast>"
|
||||
}
|
||||
}
|
||||
Closure Object
|
||||
(
|
||||
[static] => Array
|
||||
(
|
||||
[var] => <constant ast>
|
||||
)
|
||||
|
||||
)
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79779: Assertion failure when assigning property of string offset by reference
|
||||
--FILE--
|
||||
<?php
|
||||
$str = "";
|
||||
$str[1]->a = &$b;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot use string offset as an object in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79783: Segfault in php_str_replace_common
|
||||
--FILE--
|
||||
<?php
|
||||
str_replace("a", "b", "c", strlen("d"));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot pass parameter 4 by reference in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79784: Use after free if changing array during undef var during array write fetch
|
||||
--FILE--
|
||||
<?php
|
||||
set_error_handler(function () {
|
||||
$GLOBALS['a'] = null;
|
||||
});
|
||||
|
||||
$a[$c] = 'x' ;
|
||||
var_dump($a);
|
||||
$a[$c] .= 'x' ;
|
||||
var_dump($a);
|
||||
$a[$c][$c] = 'x' ;
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79792: HT iterators not removed if empty array is destroyed
|
||||
--FILE--
|
||||
<?php
|
||||
$a = [42];
|
||||
foreach ($a as &$c) {
|
||||
// Make the array empty.
|
||||
unset($a[0]);
|
||||
// Destroy the array.
|
||||
$a = null;
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: Invalid argument supplied for foreach() in %s on line %d
|
||||
===DONE===
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79793: Use after free if string used in undefined index warning is changed
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$key = "foo";
|
||||
$key .= "bar";
|
||||
set_error_handler(function($_, $m) use (&$key) {
|
||||
echo "$m\n";
|
||||
$key .= "baz";
|
||||
});
|
||||
|
||||
$ary = [];
|
||||
$ary[$key]++;
|
||||
var_dump($ary);
|
||||
$ary[$key] += 1;
|
||||
var_dump($ary);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Undefined index: foobar
|
||||
array(1) {
|
||||
["foobar"]=>
|
||||
int(1)
|
||||
}
|
||||
Undefined index: foobarbaz
|
||||
array(2) {
|
||||
["foobar"]=>
|
||||
int(1)
|
||||
["foobarbaz"]=>
|
||||
int(1)
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79862: Public non-static property in child should take priority over private static
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a {
|
||||
private static $prop1;
|
||||
private static $prop2;
|
||||
private $prop3;
|
||||
private $prop4;
|
||||
private static $prop5;
|
||||
private static $prop6;
|
||||
public function __construct() {
|
||||
$this->prop1 = 1;
|
||||
$this->prop2 = 2;
|
||||
$this->prop3 = 3;
|
||||
$this->prop4 = 4;
|
||||
$this->prop5 = 5;
|
||||
$this->prop6 = 6;
|
||||
var_dump(self::$prop1);
|
||||
var_dump(self::$prop2);
|
||||
var_dump(self::$prop5);
|
||||
var_dump(self::$prop6);
|
||||
var_dump($this);
|
||||
}
|
||||
}
|
||||
class c extends a {
|
||||
public $prop1;
|
||||
protected $prop2;
|
||||
public static $prop3;
|
||||
protected static $prop4;
|
||||
public static $prop5;
|
||||
protected static $prop6;
|
||||
}
|
||||
|
||||
$c = new c;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Accessing static property c::$prop5 as non static in %s on line %d
|
||||
|
||||
Notice: Accessing static property c::$prop6 as non static in %s on line %d
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
object(c)#1 (6) {
|
||||
["prop1"]=>
|
||||
int(1)
|
||||
["prop2":protected]=>
|
||||
int(2)
|
||||
["prop3":"a":private]=>
|
||||
int(3)
|
||||
["prop4":"a":private]=>
|
||||
int(4)
|
||||
["prop5"]=>
|
||||
int(5)
|
||||
["prop6"]=>
|
||||
int(6)
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79919 (Stack use-after-scope in define())
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('simplexml')) die('skip simplexml extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$b = error_log(0);
|
||||
$b = simplexml_load_string('<xml/>', null, $b);
|
||||
define(0, $b);
|
||||
?>
|
||||
--EXPECT--
|
||||
0
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79934: CRLF-only line in heredoc causes parsing error
|
||||
--DESCRIPTION--
|
||||
This test covers different variations of whitespace-only lines in heredoc strings.
|
||||
These whitespace-only lines should be ignored when stripping indentation.
|
||||
--FILE--
|
||||
<?php
|
||||
// lines with only CRLF should not cause a parse error
|
||||
eval("\$s1 = <<<HEREDOC\r\n a\r\n\r\n b\r\n HEREDOC;");
|
||||
var_dump(addcslashes($s1, "\r\n"));
|
||||
|
||||
// lines with only a LF should not cause a parse error
|
||||
eval("\$s2 = <<<HEREDOC\n a\n\n b\n HEREDOC;");
|
||||
var_dump(addcslashes($s2, "\n"));
|
||||
|
||||
// lines with only a CR should not cause a parse error
|
||||
eval("\$s3 = <<<HEREDOC\r a\r\r b\r HEREDOC;");
|
||||
var_dump(addcslashes($s3, "\r"));
|
||||
|
||||
// lines with only whitespace should not cause a parse error
|
||||
eval("\$s4 = <<<HEREDOC\r a\r\n \r\n b\r HEREDOC;");
|
||||
var_dump(addcslashes($s4, "\n\r"));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(10) "a\r\n\r\nb"
|
||||
string(6) "a\n\nb"
|
||||
string(6) "a\r\rb"
|
||||
string(10) "a\r\n\r\nb"
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79947: Memory leak on invalid offset type in compound assignment
|
||||
--FILE--
|
||||
<?php
|
||||
$array = [];
|
||||
$key = [];
|
||||
$array[$key] += [$key];
|
||||
var_dump($array);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
array(0) {
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79979 (passing value to by-ref param via CUF(A) crashes)
|
||||
--FILE--
|
||||
<?php
|
||||
call_user_func_array("str_replace", ["a", "b", "c", 0]);
|
||||
|
||||
$cufa = "call_user_func_array";
|
||||
$cufa("str_replace", ["a", "b", "c", 0]);
|
||||
|
||||
call_user_func_array($cufa, ["str_replace", ["a", "b", "c", 0]]);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Parameter 4 to str_replace() expected to be a reference, value given in %s on line %d
|
||||
|
||||
Warning: Parameter 4 to str_replace() expected to be a reference, value given in %s on line %d
|
||||
|
||||
Warning: Parameter 4 to str_replace() expected to be a reference, value given in %s on line %d
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80037: Typed property must not be accessed before initialization when __get() declared
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
final class A
|
||||
{
|
||||
public string $a;
|
||||
|
||||
public static function fromArray(array $props): self
|
||||
{
|
||||
$me = new static;
|
||||
foreach ($props as $k => &$v) {
|
||||
$me->{$k} = &$v; # try to remove &
|
||||
}
|
||||
return $me;
|
||||
}
|
||||
|
||||
public function __get($name)
|
||||
{
|
||||
throw new \LogicException("Property '$name' is not defined.");
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(A::fromArray(['a' => 'foo']));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(A)#1 (1) {
|
||||
["a"]=>
|
||||
string(3) "foo"
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80046: FREE for SWITCH_STRING optimized away
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test($foo) {
|
||||
switch ($foo . 'Bar') {
|
||||
case 'A':
|
||||
throw new Exception('A');
|
||||
default:
|
||||
throw new Exception('Default');
|
||||
}
|
||||
}
|
||||
try {
|
||||
test('Foo');
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Default
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80049: Memleak when coercing integers to string via variadic argument
|
||||
--FILE--
|
||||
<?php
|
||||
function coerceToString(string ...$strings) {
|
||||
var_dump($strings);
|
||||
}
|
||||
coerceToString(...[123]);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "123"
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80126: Covariant return types failing compilation
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface I {
|
||||
public function method(): I;
|
||||
}
|
||||
|
||||
abstract class A implements I {
|
||||
public function method(): I { }
|
||||
}
|
||||
|
||||
class C extends A { }
|
||||
|
||||
class C2 extends C {
|
||||
public function method(): C2 { }
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80126: Covariant return types failing compilation (variation 2)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface I {
|
||||
public function method(): I;
|
||||
}
|
||||
|
||||
abstract class A implements I {
|
||||
public function method(): I {
|
||||
return new static();
|
||||
}
|
||||
}
|
||||
|
||||
class C extends A { }
|
||||
|
||||
interface I2 { }
|
||||
|
||||
class C2 extends C implements I2 {
|
||||
public function method(): C2 { }
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80194: Assertion failure during block assembly of unreachable free with leading nop
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test($x) {
|
||||
switch ($x->y) {
|
||||
default:
|
||||
throw new Exception;
|
||||
case 'foobar':
|
||||
return new stdClass();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$x = (object)['y' => 'foobar'];
|
||||
var_dump(test($x));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(stdClass)#2 (0) {
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80781: Error handler that throws ErrorException infinite loop
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function handle(int $severity, string $message, string $file, int $line): bool {
|
||||
if((error_reporting() & $severity) !== 0) {
|
||||
throw new \ErrorException($message, 0, $severity, $file, $line);
|
||||
}
|
||||
|
||||
return true; // stfu operator
|
||||
}
|
||||
|
||||
set_error_handler('handle');
|
||||
|
||||
function getPlugin(string $plugin) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$array = [];
|
||||
if (isset($array[$data]) or getPlugin($data)) {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught ErrorException: Illegal offset type in isset or empty in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): handle(2, 'Illegal offset ...', %s, %d, Array)
|
||||
#1 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -9,7 +9,6 @@ namespace {
|
||||
|
||||
var_dump(FOO); // Ok
|
||||
var_dump(foo); // Deprecated
|
||||
var_dump(\foo); // Deprecated
|
||||
|
||||
var_dump(NS\FOO); // Ok
|
||||
var_dump(ns\FOO); // Ok
|
||||
@@ -73,13 +72,10 @@ int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 8
|
||||
int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 9
|
||||
int(42)
|
||||
int(24)
|
||||
int(24)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 13
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 12
|
||||
int(24)
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -88,24 +84,24 @@ bool(true)
|
||||
bool(true)
|
||||
int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 22
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 21
|
||||
int(42)
|
||||
int(24)
|
||||
int(24)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 25
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 24
|
||||
int(24)
|
||||
int(24)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 30
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 29
|
||||
int(24)
|
||||
int(24)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 35
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 34
|
||||
int(24)
|
||||
int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 40
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 39
|
||||
int(42)
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -114,18 +110,18 @@ bool(true)
|
||||
bool(true)
|
||||
int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 49
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 48
|
||||
int(42)
|
||||
int(24)
|
||||
int(24)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 52
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 51
|
||||
int(24)
|
||||
int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 56
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 55
|
||||
int(42)
|
||||
int(43)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 60
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 59
|
||||
int(43)
|
||||
+12
-12
@@ -118,10 +118,10 @@ bindTo(new Cls, null):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, Cls::class):
|
||||
Cannot rebind scope of closure created from function
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(null, Cls::class):
|
||||
Cannot rebind scope of closure created from function
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
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 from function
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(null, Cls::class):
|
||||
Cannot rebind scope of closure created from function
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
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 from method
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(null, ClsChild::class):
|
||||
Cannot rebind scope of closure created from method
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(null, ClsUnrelated::class):
|
||||
Cannot rebind scope of closure created from method
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
(new Cls)->method()
|
||||
-------------------
|
||||
@@ -189,13 +189,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 from method
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(new Cls, ClsUnrelated::class):
|
||||
Cannot rebind scope of closure created from method
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(new Cls, ClsChild::class):
|
||||
Cannot rebind scope of closure created from method
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
(new SplDoublyLinkedList)->count()
|
||||
----------------------------------
|
||||
@@ -216,10 +216,10 @@ bindTo(null, SplDoublyLinkedList::class):
|
||||
Cannot unbind $this of internal method
|
||||
|
||||
bindTo(new SplDoublyLinkedList, null):
|
||||
Cannot rebind scope of closure created from method
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(new SplDoublyLinkedList, ClsUnrelated::class):
|
||||
Cannot rebind scope of closure created from method
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
(function() {})()
|
||||
-----------------
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Make sure type inference upholds invariants for dead arrays
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
foreach ($a as $v) {
|
||||
$b[] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
test();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
|
||||
Warning: Invalid argument supplied for foreach() in %s on line %d
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
EX(func) can be null during write_property in an edge case
|
||||
--FILE--
|
||||
<?php
|
||||
class a {
|
||||
public static $i = 0;
|
||||
function __destruct() {
|
||||
if (self::$i++ != 0) throw new Exception;
|
||||
$b = new a;
|
||||
echo $b;
|
||||
}
|
||||
}
|
||||
new a;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Object of class a could not be converted to string in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): a->__destruct()
|
||||
#1 {main}
|
||||
|
||||
Next Exception in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): a->__destruct()
|
||||
#1 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Exception thrown by __get() during =& assignment
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
private $x;
|
||||
public function &__get($name) {
|
||||
throw new Exception("Foobar");
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
$y = 5;
|
||||
try {
|
||||
$test->x =& $y;
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Foobar
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Leak when setting recursive previous exception in finally handling
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
try {
|
||||
try {
|
||||
throw new Exception("Test");
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
} finally {
|
||||
throw $e;
|
||||
}
|
||||
} catch (Exception $e2) {
|
||||
echo $e2->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Test
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78434: Generator skips first item after valid() call
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$function = function () {
|
||||
yield 0;
|
||||
};
|
||||
|
||||
$wrapper = function () use ($function) {
|
||||
$generator = $function();
|
||||
$generator->valid();
|
||||
yield from $generator;
|
||||
|
||||
$generator = $function();
|
||||
$generator->valid();
|
||||
yield from $generator;
|
||||
};
|
||||
|
||||
foreach ($wrapper() as $value) {
|
||||
echo $value, "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
0
|
||||
0
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79600: Regression in 7.4.6 when yielding an array based generator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function createArrayGenerator() {
|
||||
yield from [
|
||||
1,
|
||||
2,
|
||||
];
|
||||
}
|
||||
|
||||
function createGeneratorFromArrayGenerator() {
|
||||
yield from createArrayGenerator();
|
||||
}
|
||||
|
||||
foreach (createGeneratorFromArrayGenerator() as $value) {
|
||||
echo $value, "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
1
|
||||
2
|
||||
@@ -1,25 +0,0 @@
|
||||
--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===
|
||||
@@ -10,6 +10,9 @@ function from($levels) {
|
||||
}
|
||||
|
||||
function gen($gen, $level) {
|
||||
if ($level % 2) {
|
||||
yield $gen->current();
|
||||
}
|
||||
yield from $gen;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Yield from non-iterable
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
yield from new stdClass;
|
||||
}
|
||||
|
||||
try {
|
||||
gen()->current();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Can use "yield from" only with arrays and Traversables
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Exception from valid() during yield from
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class FooBar implements Iterator {
|
||||
function rewind() {}
|
||||
function current() {}
|
||||
function key() {}
|
||||
function next() {}
|
||||
function valid() {
|
||||
throw new Exception("Exception from valid()");
|
||||
}
|
||||
}
|
||||
|
||||
function gen() {
|
||||
try {
|
||||
// the fact that the yield from result is used is relevant.
|
||||
var_dump(yield from new FooBar);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$x = gen();
|
||||
$x->current();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Exception from valid()
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
String offset error during list() by-ref assignment
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = [0];
|
||||
$v = 'b';
|
||||
$i = 0;
|
||||
list(&$a[$i++]) = $v;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot create references to/from string offsets in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,19 +0,0 @@
|
||||
--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,16 +0,0 @@
|
||||
--TEST--
|
||||
Test property guard hash value assumption
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
function __get($var) {
|
||||
return $this->{$var.''};
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
var_dump($test->x);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined property: Test::$x in %s on line %d
|
||||
NULL
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Regression test for incorrect update of pi node users when removing a predecessor block
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
for (; $n--; )
|
||||
C;
|
||||
}
|
||||
test();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: n in %s on line %d
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Symtable cache slots may be acquired while cleaning symtable
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
// Must be larger than the symtable cache.
|
||||
static $max = 40;
|
||||
function __destruct() {
|
||||
if (self::$max-- < 0) return;
|
||||
$x = 'y';
|
||||
$$x = new a;
|
||||
}
|
||||
}
|
||||
new A;
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Assigning stringable object to static string property
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test1 {
|
||||
public static $ref;
|
||||
}
|
||||
class Test2 {
|
||||
public string $str = "str";
|
||||
}
|
||||
class Test3 {
|
||||
public function __toString() {
|
||||
$x = "foo";
|
||||
return $x . "bar";
|
||||
}
|
||||
}
|
||||
|
||||
$test2 = new Test2;
|
||||
Test1::$ref =& $test2->str;
|
||||
Test1::$ref = new Test3;
|
||||
var_dump(Test1::$ref);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foobar"
|
||||
@@ -1,47 +0,0 @@
|
||||
--TEST--
|
||||
Variable assignment in catch must respect typed references
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public int $i = 42;
|
||||
public string $s = "str";
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
|
||||
$ref =& $test->i;
|
||||
try {
|
||||
try {
|
||||
throw new Exception("ex");
|
||||
} catch (Exception $ref) {
|
||||
echo "Unreachable\n";
|
||||
}
|
||||
} catch (TypeError $e) {
|
||||
var_dump($test->i);
|
||||
echo $e . "\n\n";
|
||||
}
|
||||
|
||||
$ref =& $test->s;
|
||||
try {
|
||||
try {
|
||||
throw new Exception("ex");
|
||||
} catch (Exception $ref) {
|
||||
echo "Unreachable\n";
|
||||
}
|
||||
} catch (TypeError $e) {
|
||||
var_dump($test->s);
|
||||
echo $e . "\n\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(42)
|
||||
TypeError: Cannot assign Exception to reference held by property Test::$i of type int in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
|
||||
string(3) "str"
|
||||
TypeError: Cannot assign Exception to reference held by property Test::$s of type string in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
@@ -1,46 +0,0 @@
|
||||
--TEST--
|
||||
Converting undefined index/offset notice to exception
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function($_, $msg) {
|
||||
throw new Exception($msg);
|
||||
});
|
||||
|
||||
$test = [];
|
||||
try {
|
||||
$test[0] .= "xyz";
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
var_dump($test);
|
||||
|
||||
try {
|
||||
$test["key"] .= "xyz";
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
var_dump($test);
|
||||
|
||||
unset($test);
|
||||
try {
|
||||
$GLOBALS["test"] .= "xyz";
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
var_dump($test);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Undefined offset: 0
|
||||
array(0) {
|
||||
}
|
||||
Undefined index: key
|
||||
array(0) {
|
||||
}
|
||||
Undefined index: test
|
||||
Undefined variable: test
|
||||
@@ -6,7 +6,6 @@ No warnings should be thrown during heredoc scan-ahead
|
||||
<<<TEST
|
||||
${x}
|
||||
\400
|
||||
${"\400"}
|
||||
${/*}
|
||||
TEST;
|
||||
|
||||
@@ -16,8 +15,6 @@ Warning: Unexpected character in input: '' (ASCII=1) state=0 in %s on line %d
|
||||
|
||||
Warning: Octal escape sequence overflow \400 is greater than \377 in %s on line %d
|
||||
|
||||
Warning: Octal escape sequence overflow \400 is greater than \377 in %s on line %d
|
||||
|
||||
Warning: Unterminated comment starting line %d in %s on line %d
|
||||
|
||||
Parse error: syntax error, unexpected end of file in %s on line %d
|
||||
+2
-16
@@ -81,7 +81,6 @@ ZEND_API char *(*zend_getenv)(char *name, size_t name_len);
|
||||
ZEND_API zend_string *(*zend_resolve_path)(const char *filename, size_t filename_len);
|
||||
ZEND_API int (*zend_post_startup_cb)(void) = NULL;
|
||||
ZEND_API void (*zend_post_shutdown_cb)(void) = NULL;
|
||||
ZEND_API int (*zend_preload_autoload)(zend_string *filename) = NULL;
|
||||
|
||||
void (*zend_on_timeout)(int seconds);
|
||||
|
||||
@@ -165,12 +164,6 @@ static ZEND_INI_MH(OnUpdateAssertions) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#if ZEND_DEBUG
|
||||
# define SIGNAL_CHECK_DEFAULT "1"
|
||||
#else
|
||||
# define SIGNAL_CHECK_DEFAULT "0"
|
||||
#endif
|
||||
|
||||
ZEND_INI_BEGIN()
|
||||
ZEND_INI_ENTRY("error_reporting", NULL, ZEND_INI_ALL, OnUpdateErrorReporting)
|
||||
STD_ZEND_INI_ENTRY("zend.assertions", "1", ZEND_INI_ALL, OnUpdateAssertions, assertions, zend_executor_globals, executor_globals)
|
||||
@@ -179,7 +172,7 @@ ZEND_INI_BEGIN()
|
||||
ZEND_INI_ENTRY("zend.script_encoding", NULL, ZEND_INI_ALL, OnUpdateScriptEncoding)
|
||||
STD_ZEND_INI_BOOLEAN("zend.detect_unicode", "1", ZEND_INI_ALL, OnUpdateBool, detect_unicode, zend_compiler_globals, compiler_globals)
|
||||
#ifdef ZEND_SIGNALS
|
||||
STD_ZEND_INI_BOOLEAN("zend.signal_check", SIGNAL_CHECK_DEFAULT, ZEND_INI_SYSTEM, OnUpdateBool, check, zend_signal_globals_t, zend_signal_globals)
|
||||
STD_ZEND_INI_BOOLEAN("zend.signal_check", "0", ZEND_INI_SYSTEM, OnUpdateBool, check, zend_signal_globals_t, zend_signal_globals)
|
||||
#endif
|
||||
STD_ZEND_INI_BOOLEAN("zend.exception_ignore_args", "0", ZEND_INI_ALL, OnUpdateBool, exception_ignore_args, zend_executor_globals, executor_globals)
|
||||
ZEND_INI_END()
|
||||
@@ -1086,11 +1079,6 @@ void zend_shutdown(void) /* {{{ */
|
||||
CG(map_ptr_base) = NULL;
|
||||
CG(map_ptr_size) = 0;
|
||||
}
|
||||
if (CG(script_encoding_list)) {
|
||||
free(CG(script_encoding_list));
|
||||
CG(script_encoding_list) = NULL;
|
||||
CG(script_encoding_list_size) = 0;
|
||||
}
|
||||
#endif
|
||||
zend_destroy_rsrc_list_dtors();
|
||||
}
|
||||
@@ -1309,9 +1297,7 @@ static ZEND_COLD void zend_error_va_list(
|
||||
#ifdef HAVE_DTRACE
|
||||
if (DTRACE_ERROR_ENABLED()) {
|
||||
char *dtrace_error_buffer;
|
||||
va_copy(usr_copy, args);
|
||||
zend_vspprintf(&dtrace_error_buffer, 0, format, usr_copy);
|
||||
va_end(usr_copy);
|
||||
zend_vspprintf(&dtrace_error_buffer, 0, format, args);
|
||||
DTRACE_ERROR(dtrace_error_buffer, (char *)error_filename, error_lineno);
|
||||
efree(dtrace_error_buffer);
|
||||
}
|
||||
|
||||
@@ -292,9 +292,6 @@ extern ZEND_API zend_string *(*zend_resolve_path)(const char *filename, size_t f
|
||||
extern ZEND_API int (*zend_post_startup_cb)(void);
|
||||
extern ZEND_API void (*zend_post_shutdown_cb)(void);
|
||||
|
||||
/* Callback for loading of not preloaded part of the script */
|
||||
extern ZEND_API int (*zend_preload_autoload)(zend_string *filename);
|
||||
|
||||
ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
|
||||
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
|
||||
/* If filename is NULL the default filename is used. */
|
||||
|
||||
+41
-4
@@ -4367,7 +4367,7 @@ ZEND_API void zend_save_error_handling(zend_error_handling *current) /* {{{ */
|
||||
{
|
||||
current->handling = EG(error_handling);
|
||||
current->exception = EG(exception_class);
|
||||
ZVAL_UNDEF(¤t->user_handler);
|
||||
ZVAL_COPY(¤t->user_handler, &EG(user_error_handler));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -4375,17 +4375,54 @@ ZEND_API void zend_replace_error_handling(zend_error_handling_t error_handling,
|
||||
{
|
||||
if (current) {
|
||||
zend_save_error_handling(current);
|
||||
if (error_handling != EH_NORMAL && Z_TYPE(EG(user_error_handler)) != IS_UNDEF) {
|
||||
zval_ptr_dtor(&EG(user_error_handler));
|
||||
ZVAL_UNDEF(&EG(user_error_handler));
|
||||
}
|
||||
}
|
||||
ZEND_ASSERT(error_handling == EH_THROW || exception_class == NULL);
|
||||
EG(error_handling) = error_handling;
|
||||
EG(exception_class) = exception_class;
|
||||
EG(exception_class) = error_handling == EH_THROW ? exception_class : NULL;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int same_zval(zval *zv1, zval *zv2) /* {{{ */
|
||||
{
|
||||
if (Z_TYPE_P(zv1) != Z_TYPE_P(zv2)) {
|
||||
return 0;
|
||||
}
|
||||
switch (Z_TYPE_P(zv1)) {
|
||||
case IS_UNDEF:
|
||||
case IS_NULL:
|
||||
case IS_FALSE:
|
||||
case IS_TRUE:
|
||||
return 1;
|
||||
case IS_LONG:
|
||||
return Z_LVAL_P(zv1) == Z_LVAL_P(zv2);
|
||||
case IS_DOUBLE:
|
||||
return Z_LVAL_P(zv1) == Z_LVAL_P(zv2);
|
||||
case IS_STRING:
|
||||
case IS_ARRAY:
|
||||
case IS_OBJECT:
|
||||
case IS_RESOURCE:
|
||||
return Z_COUNTED_P(zv1) == Z_COUNTED_P(zv2);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zend_restore_error_handling(zend_error_handling *saved) /* {{{ */
|
||||
{
|
||||
EG(error_handling) = saved->handling;
|
||||
EG(exception_class) = saved->exception;
|
||||
EG(exception_class) = saved->handling == EH_THROW ? saved->exception : NULL;
|
||||
if (Z_TYPE(saved->user_handler) != IS_UNDEF
|
||||
&& !same_zval(&saved->user_handler, &EG(user_error_handler))) {
|
||||
zval_ptr_dtor(&EG(user_error_handler));
|
||||
ZVAL_COPY_VALUE(&EG(user_error_handler), &saved->user_handler);
|
||||
} else if (Z_TYPE(saved->user_handler)) {
|
||||
zval_ptr_dtor(&saved->user_handler);
|
||||
}
|
||||
ZVAL_UNDEF(&saved->user_handler);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+1
-1
@@ -1099,7 +1099,7 @@ static zend_always_inline void zend_mm_free_pages_ex(zend_mm_heap *heap, zend_mm
|
||||
/* this setting may be not accurate */
|
||||
chunk->free_tail = page_num;
|
||||
}
|
||||
if (free_chunk && chunk != heap->main_chunk && chunk->free_pages == ZEND_MM_PAGES - ZEND_MM_FIRST_PAGE) {
|
||||
if (free_chunk && chunk->free_pages == ZEND_MM_PAGES - ZEND_MM_FIRST_PAGE) {
|
||||
zend_mm_delete_chunk(heap, chunk);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -895,7 +895,9 @@ repeat:
|
||||
case IS_OBJECT:
|
||||
if (Z_TYPE(val_free) == IS_UNDEF) {
|
||||
if (Z_OBJ_HT_P(val)->get) {
|
||||
val = Z_OBJ_HT_P(val)->get(val, &val_free);
|
||||
zval rv;
|
||||
val = Z_OBJ_HT_P(val)->get(val, &rv);
|
||||
ZVAL_COPY_VALUE(&val_free, val);
|
||||
goto repeat;
|
||||
} else if (Z_OBJ_HT_P(val)->cast_object) {
|
||||
if (Z_OBJ_HT_P(val)->cast_object(val, &val_free, IS_STRING) == SUCCESS) {
|
||||
@@ -1808,6 +1810,7 @@ ZEND_FUNCTION(get_defined_functions)
|
||||
zend_string *key;
|
||||
zend_function *func;
|
||||
zend_bool exclude_disabled = 0;
|
||||
char *disable_functions = NULL;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &exclude_disabled) == FAILURE) {
|
||||
return;
|
||||
@@ -1817,11 +1820,19 @@ ZEND_FUNCTION(get_defined_functions)
|
||||
array_init(&user);
|
||||
array_init(return_value);
|
||||
|
||||
if (exclude_disabled) {
|
||||
disable_functions = INI_STR("disable_functions");
|
||||
}
|
||||
ZEND_HASH_FOREACH_STR_KEY_PTR(EG(function_table), key, func) {
|
||||
if (key && ZSTR_VAL(key)[0] != 0) {
|
||||
if (func->type == ZEND_INTERNAL_FUNCTION
|
||||
&& (!exclude_disabled || func->internal_function.handler != ZEND_FN(display_disabled_function))) {
|
||||
add_next_index_str(&internal, zend_string_copy(key));
|
||||
if (func->type == ZEND_INTERNAL_FUNCTION) {
|
||||
if (disable_functions != NULL) {
|
||||
if (strstr(disable_functions, func->common.function_name->val) == NULL) {
|
||||
add_next_index_str(&internal, zend_string_copy(key));
|
||||
}
|
||||
} else {
|
||||
add_next_index_str(&internal, zend_string_copy(key));
|
||||
}
|
||||
} else if (func->type == ZEND_USER_FUNCTION) {
|
||||
add_next_index_str(&user, zend_string_copy(key));
|
||||
}
|
||||
|
||||
+1
-12
@@ -104,11 +104,7 @@ static zend_bool zend_valid_closure_binding(
|
||||
}
|
||||
|
||||
if (is_fake_closure && scope != func->common.scope) {
|
||||
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");
|
||||
}
|
||||
zend_error(E_WARNING, "Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -535,17 +531,10 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp) /* {{{
|
||||
debug_info = zend_new_array(8);
|
||||
|
||||
if (closure->func.type == ZEND_USER_FUNCTION && closure->func.op_array.static_variables) {
|
||||
zval *var;
|
||||
HashTable *static_variables =
|
||||
ZEND_MAP_PTR_GET(closure->func.op_array.static_variables_ptr);
|
||||
ZVAL_ARR(&val, zend_array_dup(static_variables));
|
||||
zend_hash_update(debug_info, ZSTR_KNOWN(ZEND_STR_STATIC), &val);
|
||||
ZEND_HASH_FOREACH_VAL(Z_ARRVAL(val), var) {
|
||||
if (Z_TYPE_P(var) == IS_CONSTANT_AST) {
|
||||
zval_ptr_dtor(var);
|
||||
ZVAL_STRING(var, "<constant ast>");
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
}
|
||||
|
||||
if (Z_TYPE(closure->this_ptr) != IS_UNDEF) {
|
||||
|
||||
+17
-52
@@ -1050,12 +1050,7 @@ ZEND_API int do_bind_function(zval *lcname) /* {{{ */
|
||||
return FAILURE;
|
||||
}
|
||||
function = (zend_function*)Z_PTR_P(zv);
|
||||
if (UNEXPECTED(function->common.fn_flags & ZEND_ACC_PRELOADED)
|
||||
&& !(CG(compiler_options) & ZEND_COMPILE_PRELOAD)) {
|
||||
zv = zend_hash_add(EG(function_table), Z_STR_P(lcname), zv);
|
||||
} else {
|
||||
zv = zend_hash_set_bucket_key(EG(function_table), (Bucket*)zv, Z_STR_P(lcname));
|
||||
}
|
||||
zv = zend_hash_set_bucket_key(EG(function_table), (Bucket*)zv, Z_STR_P(lcname));
|
||||
if (UNEXPECTED(!zv)) {
|
||||
do_bind_function_error(Z_STR_P(lcname), &function->op_array, 0);
|
||||
return FAILURE;
|
||||
@@ -1077,21 +1072,11 @@ ZEND_API int do_bind_class(zval *lcname, zend_string *lc_parent_name) /* {{{ */
|
||||
ce = zend_hash_find_ptr(EG(class_table), Z_STR_P(lcname));
|
||||
if (ce) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare %s %s, because the name is already in use", zend_get_object_type(ce), ZSTR_VAL(ce->name));
|
||||
return FAILURE;
|
||||
} else {
|
||||
do {
|
||||
ZEND_ASSERT(EG(current_execute_data)->func->op_array.fn_flags & ZEND_ACC_PRELOADED);
|
||||
if (zend_preload_autoload
|
||||
&& zend_preload_autoload(EG(current_execute_data)->func->op_array.filename) == SUCCESS) {
|
||||
zv = zend_hash_find_ex(EG(class_table), Z_STR_P(rtd_key), 1);
|
||||
if (EXPECTED(zv != NULL)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
zend_error_noreturn(E_ERROR, "Class %s wasn't preloaded", Z_STRVAL_P(lcname));
|
||||
return FAILURE;
|
||||
} while (0);
|
||||
ZEND_ASSERT(EG(current_execute_data)->func->op_array.fn_flags & ZEND_ACC_PRELOADED);
|
||||
zend_error_noreturn(E_ERROR, "Class %s wasn't preloaded", Z_STRVAL_P(lcname));
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
/* Register the derived class */
|
||||
@@ -3014,11 +2999,7 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc) /* {{{ */
|
||||
zend_compile_var(&arg_node, arg, BP_VAR_R, 0);
|
||||
if (arg_node.op_type & (IS_CONST|IS_TMP_VAR)) {
|
||||
/* Function call was converted into builtin instruction */
|
||||
if (!fbc || ARG_MUST_BE_SENT_BY_REF(fbc, arg_num)) {
|
||||
opcode = ZEND_SEND_VAL_EX;
|
||||
} else {
|
||||
opcode = ZEND_SEND_VAL;
|
||||
}
|
||||
opcode = ZEND_SEND_VAL;
|
||||
} else {
|
||||
if (fbc) {
|
||||
if (ARG_MUST_BE_SENT_BY_REF(fbc, arg_num)) {
|
||||
@@ -5822,14 +5803,8 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo
|
||||
}
|
||||
} else if (zend_string_equals_literal(lcname, "serialize")) {
|
||||
ce->serialize_func = (zend_function *) op_array;
|
||||
if (!is_static) {
|
||||
op_array->fn_flags |= ZEND_ACC_ALLOW_STATIC;
|
||||
}
|
||||
} else if (zend_string_equals_literal(lcname, "unserialize")) {
|
||||
ce->unserialize_func = (zend_function *) op_array;
|
||||
if (!is_static) {
|
||||
op_array->fn_flags |= ZEND_ACC_ALLOW_STATIC;
|
||||
}
|
||||
} else if (ZSTR_VAL(lcname)[0] != '_' || ZSTR_VAL(lcname)[1] != '_') {
|
||||
if (!is_static) {
|
||||
op_array->fn_flags |= ZEND_ACC_ALLOW_STATIC;
|
||||
@@ -5949,12 +5924,11 @@ static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_as
|
||||
return;
|
||||
}
|
||||
|
||||
/* Generate RTD keys until we find one that isn't in use yet. */
|
||||
key = NULL;
|
||||
do {
|
||||
zend_tmp_string_release(key);
|
||||
key = zend_build_runtime_definition_key(lcname, decl->start_lineno);
|
||||
} while (!zend_hash_add_ptr(CG(function_table), key, op_array));
|
||||
key = zend_build_runtime_definition_key(lcname, decl->start_lineno);
|
||||
if (!zend_hash_add_ptr(CG(function_table), key, op_array)) {
|
||||
zend_error_noreturn(E_ERROR,
|
||||
"Runtime definition key collision for function %s. This is a bug", ZSTR_VAL(name));
|
||||
}
|
||||
|
||||
if (op_array->fn_flags & ZEND_ACC_CLOSURE) {
|
||||
opline = zend_emit_op_tmp(result, ZEND_DECLARE_LAMBDA_FUNCTION, NULL, NULL);
|
||||
@@ -6420,15 +6394,8 @@ zend_op *zend_compile_class_decl(zend_ast *ast, zend_bool toplevel) /* {{{ */
|
||||
|
||||
zend_register_seen_symbol(lcname, ZEND_SYMBOL_CLASS);
|
||||
} else {
|
||||
/* Find an anon class name that is not in use yet. */
|
||||
name = NULL;
|
||||
lcname = NULL;
|
||||
do {
|
||||
zend_tmp_string_release(name);
|
||||
zend_tmp_string_release(lcname);
|
||||
name = zend_generate_anon_class_name(decl->start_lineno);
|
||||
lcname = zend_string_tolower(name);
|
||||
} while (zend_hash_exists(CG(class_table), lcname));
|
||||
name = zend_generate_anon_class_name(decl->start_lineno);
|
||||
lcname = zend_string_tolower(name);
|
||||
}
|
||||
lcname = zend_new_interned_string(lcname);
|
||||
|
||||
@@ -6585,20 +6552,18 @@ zend_op *zend_compile_class_decl(zend_ast *ast, zend_bool toplevel) /* {{{ */
|
||||
opline->result_type = IS_VAR;
|
||||
opline->result.var = get_temporary_variable();
|
||||
if (!zend_hash_add_ptr(CG(class_table), lcname, ce)) {
|
||||
/* We checked above that the class name is not used. This really shouldn't happen. */
|
||||
zend_error_noreturn(E_ERROR,
|
||||
"Runtime definition key collision for %s. This is a bug", ZSTR_VAL(name));
|
||||
}
|
||||
} else {
|
||||
/* Generate RTD keys until we find one that isn't in use yet. */
|
||||
zend_string *key = NULL;
|
||||
do {
|
||||
zend_tmp_string_release(key);
|
||||
key = zend_build_runtime_definition_key(lcname, decl->start_lineno);
|
||||
} while (!zend_hash_add_ptr(CG(class_table), key, ce));
|
||||
zend_string *key = zend_build_runtime_definition_key(lcname, decl->start_lineno);
|
||||
|
||||
/* RTD key is placed after lcname literal in op1 */
|
||||
zend_add_literal_string(&key);
|
||||
if (!zend_hash_add_ptr(CG(class_table), key, ce)) {
|
||||
zend_error_noreturn(E_ERROR,
|
||||
"Runtime definition key collision for class %s. This is a bug", ZSTR_VAL(name));
|
||||
}
|
||||
|
||||
opline->opcode = ZEND_DECLARE_CLASS;
|
||||
if (extends_ast && toplevel
|
||||
|
||||
@@ -73,44 +73,6 @@ 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) {
|
||||
@@ -133,11 +95,6 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-11
@@ -76,15 +76,9 @@ void zend_exception_set_previous(zend_object *exception, zend_object *add_previo
|
||||
zval pv, zv, rv;
|
||||
zend_class_entry *base_ce;
|
||||
|
||||
if (!exception || !add_previous) {
|
||||
if (exception == add_previous || !add_previous || !exception) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (exception == add_previous) {
|
||||
OBJ_RELEASE(add_previous);
|
||||
return;
|
||||
}
|
||||
|
||||
ZVAL_OBJ(&pv, add_previous);
|
||||
if (!instanceof_function(Z_OBJCE(pv), zend_ce_throwable)) {
|
||||
zend_error_noreturn(E_CORE_ERROR, "Previous exception must implement Throwable");
|
||||
@@ -185,18 +179,16 @@ ZEND_API ZEND_COLD void zend_throw_exception_internal(zval *exception) /* {{{ */
|
||||
|
||||
ZEND_API void zend_clear_exception(void) /* {{{ */
|
||||
{
|
||||
zend_object *exception;
|
||||
if (EG(prev_exception)) {
|
||||
|
||||
OBJ_RELEASE(EG(prev_exception));
|
||||
EG(prev_exception) = NULL;
|
||||
}
|
||||
if (!EG(exception)) {
|
||||
return;
|
||||
}
|
||||
/* exception may have destructor */
|
||||
exception = EG(exception);
|
||||
OBJ_RELEASE(EG(exception));
|
||||
EG(exception) = NULL;
|
||||
OBJ_RELEASE(exception);
|
||||
if (EG(current_execute_data)) {
|
||||
EG(current_execute_data)->opline = EG(opline_before_exception);
|
||||
}
|
||||
|
||||
+73
-133
@@ -51,11 +51,11 @@
|
||||
# define ZEND_VM_FP_GLOBAL_REG "%r14"
|
||||
# define ZEND_VM_IP_GLOBAL_REG "%r15"
|
||||
# elif defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(__powerpc64__)
|
||||
# define ZEND_VM_FP_GLOBAL_REG "r14"
|
||||
# define ZEND_VM_IP_GLOBAL_REG "r15"
|
||||
# define ZEND_VM_FP_GLOBAL_REG "r28"
|
||||
# define ZEND_VM_IP_GLOBAL_REG "r29"
|
||||
# elif defined(__IBMC__) && ZEND_GCC_VERSION >= 4002 && defined(__powerpc64__)
|
||||
# define ZEND_VM_FP_GLOBAL_REG "r14"
|
||||
# define ZEND_VM_IP_GLOBAL_REG "r15"
|
||||
# define ZEND_VM_FP_GLOBAL_REG "r28"
|
||||
# define ZEND_VM_IP_GLOBAL_REG "r29"
|
||||
# elif defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(__aarch64__)
|
||||
# define ZEND_VM_FP_GLOBAL_REG "x27"
|
||||
# define ZEND_VM_IP_GLOBAL_REG "x28"
|
||||
@@ -1446,21 +1446,9 @@ static zend_never_inline ZEND_COLD void zend_wrong_string_offset(EXECUTE_DATA_D)
|
||||
while (opline < end) {
|
||||
if (opline->op1_type == IS_VAR && opline->op1.var == var) {
|
||||
switch (opline->opcode) {
|
||||
case ZEND_FETCH_OBJ_W:
|
||||
case ZEND_FETCH_OBJ_RW:
|
||||
case ZEND_FETCH_OBJ_FUNC_ARG:
|
||||
case ZEND_FETCH_OBJ_UNSET:
|
||||
case ZEND_ASSIGN_OBJ:
|
||||
case ZEND_ASSIGN_OBJ_OP:
|
||||
case ZEND_ASSIGN_OBJ_REF:
|
||||
msg = "Cannot use string offset as an object";
|
||||
break;
|
||||
case ZEND_FETCH_DIM_W:
|
||||
case ZEND_FETCH_DIM_RW:
|
||||
case ZEND_FETCH_DIM_FUNC_ARG:
|
||||
case ZEND_FETCH_DIM_UNSET:
|
||||
case ZEND_FETCH_LIST_W:
|
||||
case ZEND_ASSIGN_DIM:
|
||||
case ZEND_ASSIGN_DIM_OP:
|
||||
msg = "Cannot use string offset as an array";
|
||||
break;
|
||||
@@ -1478,6 +1466,21 @@ static zend_never_inline ZEND_COLD void zend_wrong_string_offset(EXECUTE_DATA_D)
|
||||
case ZEND_POST_DEC:
|
||||
msg = "Cannot increment/decrement string offsets";
|
||||
break;
|
||||
case ZEND_FETCH_DIM_W:
|
||||
case ZEND_FETCH_DIM_RW:
|
||||
case ZEND_FETCH_DIM_FUNC_ARG:
|
||||
case ZEND_FETCH_DIM_UNSET:
|
||||
case ZEND_FETCH_LIST_W:
|
||||
case ZEND_ASSIGN_DIM:
|
||||
msg = "Cannot use string offset as an array";
|
||||
break;
|
||||
case ZEND_FETCH_OBJ_W:
|
||||
case ZEND_FETCH_OBJ_RW:
|
||||
case ZEND_FETCH_OBJ_FUNC_ARG:
|
||||
case ZEND_FETCH_OBJ_UNSET:
|
||||
case ZEND_ASSIGN_OBJ:
|
||||
msg = "Cannot use string offset as an object";
|
||||
break;
|
||||
case ZEND_ASSIGN_REF:
|
||||
case ZEND_ADD_ARRAY_ELEMENT:
|
||||
case ZEND_INIT_ARRAY:
|
||||
@@ -1512,7 +1515,6 @@ static zend_never_inline ZEND_COLD void zend_wrong_string_offset(EXECUTE_DATA_D)
|
||||
msg = "Cannot create references to/from string offsets";
|
||||
break;
|
||||
}
|
||||
opline++;
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE();
|
||||
@@ -1959,44 +1961,6 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_undefined_index(const
|
||||
zend_error(E_NOTICE, "Undefined index: %s", ZSTR_VAL(offset));
|
||||
}
|
||||
|
||||
static zend_never_inline ZEND_COLD int ZEND_FASTCALL zend_undefined_offset_write(
|
||||
HashTable *ht, zend_long lval)
|
||||
{
|
||||
/* The array may be destroyed while throwing the notice.
|
||||
* Temporarily increase the refcount to detect this situation. */
|
||||
if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) {
|
||||
GC_ADDREF(ht);
|
||||
}
|
||||
zend_undefined_offset(lval);
|
||||
if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) {
|
||||
zend_array_destroy(ht);
|
||||
return FAILURE;
|
||||
}
|
||||
if (EG(exception)) {
|
||||
return FAILURE;
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static zend_never_inline ZEND_COLD int ZEND_FASTCALL zend_undefined_index_write(
|
||||
HashTable *ht, zend_string *offset)
|
||||
{
|
||||
/* The array may be destroyed while throwing the notice.
|
||||
* Temporarily increase the refcount to detect this situation. */
|
||||
if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) {
|
||||
GC_ADDREF(ht);
|
||||
}
|
||||
zend_undefined_index(offset);
|
||||
if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) {
|
||||
zend_array_destroy(ht);
|
||||
return FAILURE;
|
||||
}
|
||||
if (EG(exception)) {
|
||||
return FAILURE;
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_undefined_method(const zend_class_entry *ce, const zend_string *method)
|
||||
{
|
||||
zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), ZSTR_VAL(method));
|
||||
@@ -2052,6 +2016,8 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_use_new_element_for_s
|
||||
|
||||
static ZEND_COLD void zend_binary_assign_op_dim_slow(zval *container, zval *dim OPLINE_DC EXECUTE_DATA_DC)
|
||||
{
|
||||
zend_free_op free_op_data1;
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) {
|
||||
if (opline->op2_type == IS_UNUSED) {
|
||||
zend_use_new_element_for_string();
|
||||
@@ -2062,27 +2028,16 @@ static ZEND_COLD void zend_binary_assign_op_dim_slow(zval *container, zval *dim
|
||||
} else if (EXPECTED(!Z_ISERROR_P(container))) {
|
||||
zend_use_scalar_as_array();
|
||||
}
|
||||
get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
|
||||
FREE_OP(free_op_data1);
|
||||
}
|
||||
|
||||
static zend_never_inline zend_uchar slow_index_convert(HashTable *ht, const zval *dim, zend_value *value EXECUTE_DATA_DC)
|
||||
static zend_never_inline zend_uchar slow_index_convert(const zval *dim, zend_value *value EXECUTE_DATA_DC)
|
||||
{
|
||||
switch (Z_TYPE_P(dim)) {
|
||||
case IS_UNDEF: {
|
||||
/* The array may be destroyed while throwing the notice.
|
||||
* Temporarily increase the refcount to detect this situation. */
|
||||
if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) {
|
||||
GC_ADDREF(ht);
|
||||
}
|
||||
case IS_UNDEF:
|
||||
ZVAL_UNDEFINED_OP2();
|
||||
if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && !GC_DELREF(ht)) {
|
||||
zend_array_destroy(ht);
|
||||
return IS_NULL;
|
||||
}
|
||||
if (EG(exception)) {
|
||||
return IS_NULL;
|
||||
}
|
||||
/* break missing intentionally */
|
||||
}
|
||||
case IS_NULL:
|
||||
value->str = ZSTR_EMPTY_ALLOC();
|
||||
return IS_STRING;
|
||||
@@ -2127,10 +2082,9 @@ num_undef:
|
||||
retval = &EG(uninitialized_zval);
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
if (UNEXPECTED(zend_undefined_offset_write(ht, hval) == FAILURE)) {
|
||||
return NULL;
|
||||
}
|
||||
/* break missing intentionally */
|
||||
zend_undefined_offset(hval);
|
||||
retval = zend_hash_index_update(ht, hval, &EG(uninitialized_zval));
|
||||
break;
|
||||
case BP_VAR_W:
|
||||
retval = zend_hash_index_add_new(ht, hval, &EG(uninitialized_zval));
|
||||
break;
|
||||
@@ -2158,9 +2112,7 @@ str_index:
|
||||
retval = &EG(uninitialized_zval);
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
if (UNEXPECTED(zend_undefined_index_write(ht, offset_key))) {
|
||||
return NULL;
|
||||
}
|
||||
zend_undefined_index(offset_key);
|
||||
/* break missing intentionally */
|
||||
case BP_VAR_W:
|
||||
ZVAL_NULL(retval);
|
||||
@@ -2178,14 +2130,8 @@ str_index:
|
||||
retval = &EG(uninitialized_zval);
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
/* Key may be released while throwing the undefined index warning. */
|
||||
zend_string_addref(offset_key);
|
||||
if (UNEXPECTED(zend_undefined_index_write(ht, offset_key) == FAILURE)) {
|
||||
zend_string_release(offset_key);
|
||||
return NULL;
|
||||
}
|
||||
retval = zend_hash_add_new(ht, offset_key, &EG(uninitialized_zval));
|
||||
zend_string_release(offset_key);
|
||||
zend_undefined_index(offset_key);
|
||||
retval = zend_hash_update(ht, offset_key, &EG(uninitialized_zval));
|
||||
break;
|
||||
case BP_VAR_W:
|
||||
retval = zend_hash_add_new(ht, offset_key, &EG(uninitialized_zval));
|
||||
@@ -2197,7 +2143,7 @@ str_index:
|
||||
goto try_again;
|
||||
} else {
|
||||
zend_value val;
|
||||
zend_uchar t = slow_index_convert(ht, dim, &val EXECUTE_DATA_CC);
|
||||
zend_uchar t = slow_index_convert(dim, &val EXECUTE_DATA_CC);
|
||||
|
||||
if (t == IS_STRING) {
|
||||
offset_key = val.str;
|
||||
@@ -2873,10 +2819,6 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
ZVAL_ERROR(result);
|
||||
return;
|
||||
}
|
||||
} else if (UNEXPECTED(Z_ISERROR_P(ptr))) {
|
||||
ZVAL_ERROR(result);
|
||||
return;
|
||||
@@ -3226,41 +3168,45 @@ ZEND_API zend_bool ZEND_FASTCALL zend_verify_ref_assignable_zval(zend_reference
|
||||
return 1;
|
||||
}
|
||||
|
||||
static zend_always_inline void i_zval_ptr_dtor_noref(zval *zval_ptr) {
|
||||
if (Z_REFCOUNTED_P(zval_ptr)) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(zval_ptr);
|
||||
ZEND_ASSERT(Z_TYPE_P(zval_ptr) != IS_REFERENCE);
|
||||
if (!GC_DELREF(ref)) {
|
||||
rc_dtor_func(ref);
|
||||
} else if (UNEXPECTED(GC_MAY_LEAK(ref))) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *orig_value, zend_uchar value_type, zend_bool strict, zend_refcounted *ref)
|
||||
ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *value, zend_uchar value_type, zend_bool strict, zend_refcounted *ref)
|
||||
{
|
||||
zend_bool need_copy = ZEND_CONST_COND(value_type & (IS_CONST|IS_CV), 1) ||
|
||||
((value_type & IS_VAR) && UNEXPECTED(ref) && GC_REFCOUNT(ref) > 1);
|
||||
zend_bool ret;
|
||||
zval value;
|
||||
ZVAL_COPY(&value, orig_value);
|
||||
ret = zend_verify_ref_assignable_zval(Z_REF_P(variable_ptr), &value, strict);
|
||||
variable_ptr = Z_REFVAL_P(variable_ptr);
|
||||
if (EXPECTED(ret)) {
|
||||
i_zval_ptr_dtor_noref(variable_ptr);
|
||||
ZVAL_COPY_VALUE(variable_ptr, &value);
|
||||
} else {
|
||||
zval_ptr_dtor_nogc(&value);
|
||||
zval tmp;
|
||||
|
||||
if (need_copy) {
|
||||
ZVAL_COPY(&tmp, value);
|
||||
value = &tmp;
|
||||
}
|
||||
if (value_type & (IS_VAR|IS_TMP_VAR)) {
|
||||
if (UNEXPECTED(ref)) {
|
||||
if (UNEXPECTED(GC_DELREF(ref) == 0)) {
|
||||
zval_ptr_dtor(orig_value);
|
||||
efree_size(ref, sizeof(zend_reference));
|
||||
}
|
||||
} else {
|
||||
i_zval_ptr_dtor_noref(orig_value);
|
||||
ret = zend_verify_ref_assignable_zval(Z_REF_P(variable_ptr), value, strict);
|
||||
if (need_copy) {
|
||||
Z_TRY_DELREF_P(value);
|
||||
}
|
||||
if (!ret) {
|
||||
if (value_type & (IS_VAR|IS_TMP_VAR)) {
|
||||
zval_ptr_dtor(value);
|
||||
}
|
||||
return Z_REFVAL_P(variable_ptr);
|
||||
}
|
||||
|
||||
variable_ptr = Z_REFVAL_P(variable_ptr);
|
||||
if (EXPECTED(Z_REFCOUNTED_P(variable_ptr))) {
|
||||
zend_refcounted *garbage = Z_COUNTED_P(variable_ptr);
|
||||
|
||||
zend_copy_to_variable(variable_ptr, value, value_type, ref);
|
||||
if (GC_DELREF(garbage) == 0) {
|
||||
rc_dtor_func(garbage);
|
||||
} else { /* we need to split */
|
||||
/* optimized version of GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr) */
|
||||
if (UNEXPECTED(GC_MAY_LEAK(garbage))) {
|
||||
gc_possible_root(garbage);
|
||||
}
|
||||
}
|
||||
return variable_ptr;
|
||||
}
|
||||
|
||||
zend_copy_to_variable(variable_ptr, value, value_type, ref);
|
||||
return variable_ptr;
|
||||
}
|
||||
|
||||
@@ -3437,13 +3383,12 @@ ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_val
|
||||
|
||||
ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table) /* {{{ */
|
||||
{
|
||||
/* Clean before putting into the cache, since clean could call dtors,
|
||||
* which could use the cached hash. Also do this before the check for
|
||||
* available cache slots, as those may be used by a dtor as well. */
|
||||
zend_symtable_clean(symbol_table);
|
||||
if (EG(symtable_cache_ptr) >= EG(symtable_cache_limit)) {
|
||||
zend_array_destroy(symbol_table);
|
||||
} else {
|
||||
/* clean before putting into the cache, since clean
|
||||
could call dtors, which could use cached hash */
|
||||
zend_symtable_clean(symbol_table);
|
||||
*(EG(symtable_cache_ptr)++) = symbol_table;
|
||||
}
|
||||
}
|
||||
@@ -4471,15 +4416,11 @@ static zend_always_inline int _zend_quick_get_constant(
|
||||
is_deprecated = !zend_string_equals(c->name, Z_STR_P(access_key));
|
||||
} else {
|
||||
check_short_name:
|
||||
/* Namespaces are always case-insensitive. Only compare shortname. */
|
||||
ns_sep = zend_memrchr(ZSTR_VAL(c->name), '\\', ZSTR_LEN(c->name));
|
||||
if (ns_sep) {
|
||||
shortname_offset = ns_sep - ZSTR_VAL(c->name) + 1;
|
||||
shortname_len = ZSTR_LEN(c->name) - shortname_offset;
|
||||
} else {
|
||||
shortname_offset = 0;
|
||||
shortname_len = ZSTR_LEN(c->name);
|
||||
}
|
||||
ZEND_ASSERT(ns_sep);
|
||||
/* Namespaces are always case-insensitive. Only compare shortname. */
|
||||
shortname_offset = ns_sep - ZSTR_VAL(c->name) + 1;
|
||||
shortname_len = ZSTR_LEN(c->name) - shortname_offset;
|
||||
|
||||
is_deprecated = memcmp(ZSTR_VAL(c->name) + shortname_offset, Z_STRVAL_P(orig_key - 1) + shortname_offset, shortname_len) != 0;
|
||||
}
|
||||
@@ -4555,7 +4496,6 @@ static zend_always_inline zend_execute_data *_zend_vm_stack_push_call_frame(uint
|
||||
if (check_exception) { \
|
||||
OPLINE = EX(opline) + (skip); \
|
||||
} else { \
|
||||
ZEND_ASSERT(!EG(exception)); \
|
||||
OPLINE = opline + (skip); \
|
||||
} \
|
||||
ZEND_VM_CONTINUE()
|
||||
|
||||
+6
-14
@@ -287,9 +287,8 @@ void shutdown_executor(void) /* {{{ */
|
||||
if (op_array->static_variables) {
|
||||
HashTable *ht = ZEND_MAP_PTR_GET(op_array->static_variables_ptr);
|
||||
if (ht) {
|
||||
if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && GC_DELREF(ht) == 0) {
|
||||
zend_array_destroy(ht);
|
||||
}
|
||||
ZEND_ASSERT(GC_REFCOUNT(ht) == 1);
|
||||
zend_array_destroy(ht);
|
||||
ZEND_MAP_PTR_SET(op_array->static_variables_ptr, NULL);
|
||||
}
|
||||
}
|
||||
@@ -757,7 +756,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
|
||||
for (i=0; i<fci->param_count; i++) {
|
||||
zval *param;
|
||||
zval *arg = &fci->params[i];
|
||||
zend_bool must_wrap = 0;
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(func, i + 1)) {
|
||||
if (UNEXPECTED(!Z_ISREF_P(arg))) {
|
||||
@@ -766,13 +764,12 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
|
||||
ZVAL_NEW_REF(arg, arg);
|
||||
} else if (!ARG_MAY_BE_SENT_BY_REF(func, i + 1)) {
|
||||
/* By-value send is not allowed -- emit a warning,
|
||||
* and perform the call with the value wrapped in a reference. */
|
||||
* but still perform the call with a by-value send. */
|
||||
zend_error(E_WARNING,
|
||||
"Parameter %d to %s%s%s() expected to be a reference, value given", i+1,
|
||||
func->common.scope ? ZSTR_VAL(func->common.scope->name) : "",
|
||||
func->common.scope ? "::" : "",
|
||||
ZSTR_VAL(func->common.function_name));
|
||||
must_wrap = 1;
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
ZEND_CALL_NUM_ARGS(call) = i;
|
||||
zend_vm_stack_free_args(call);
|
||||
@@ -793,12 +790,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
|
||||
}
|
||||
|
||||
param = ZEND_CALL_ARG(call, i+1);
|
||||
if (EXPECTED(!must_wrap)) {
|
||||
ZVAL_COPY(param, arg);
|
||||
} else {
|
||||
Z_TRY_ADDREF_P(arg);
|
||||
ZVAL_NEW_REF(param, arg);
|
||||
}
|
||||
ZVAL_COPY(param, arg);
|
||||
}
|
||||
|
||||
if (UNEXPECTED(func->op_array.fn_flags & ZEND_ACC_CLOSURE)) {
|
||||
@@ -1294,7 +1286,7 @@ static void zend_set_timeout_ex(zend_long seconds, int 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;
|
||||
|
||||
# if defined(__CYGWIN__) || defined(__PASE__)
|
||||
# ifdef __CYGWIN__
|
||||
setitimer(ITIMER_REAL, &t_r, NULL);
|
||||
}
|
||||
signo = SIGALRM;
|
||||
@@ -1356,7 +1348,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;
|
||||
|
||||
# if defined(__CYGWIN__) || defined(__PASE__)
|
||||
# ifdef __CYGWIN__
|
||||
setitimer(ITIMER_REAL, &no_timeout, NULL);
|
||||
# else
|
||||
setitimer(ITIMER_PROF, &no_timeout, NULL);
|
||||
|
||||
+12
-9
@@ -55,9 +55,10 @@ END_EXTERN_C()
|
||||
Implementation notes:
|
||||
|
||||
x86_64:
|
||||
- Since all x86_64 compilers use SSE by default, we do not define these
|
||||
macros there. We ignore the compiler option -mfpmath=i387, because there is
|
||||
no reason to use it on x86_64.
|
||||
- Since all x86_64 compilers use SSE by default, it is probably unnecessary
|
||||
to use these macros there. We define them anyway since we are too lazy
|
||||
to differentiate the architecture. Also, the compiler option -mfpmath=i387
|
||||
justifies this decision.
|
||||
|
||||
General:
|
||||
- It would be nice if one could detect whether SSE if used for math via some
|
||||
@@ -66,7 +67,9 @@ END_EXTERN_C()
|
||||
|
||||
MS Visual C:
|
||||
- Since MSVC users typically don't use autoconf or CMake, we will detect
|
||||
MSVC via compile time define.
|
||||
MSVC via compile time define. Floating point precision change isn't
|
||||
supported on 64 bit platforms, so it's NOP. See
|
||||
http://msdn.microsoft.com/en-us/library/c9676k6h(v=vs.110).aspx
|
||||
*/
|
||||
|
||||
/* MSVC detection (MSVC people usually don't use autoconf) */
|
||||
@@ -74,7 +77,7 @@ END_EXTERN_C()
|
||||
# define HAVE__CONTROLFP_S
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
#if defined(HAVE__CONTROLFP_S) && !defined(__x86_64__)
|
||||
#ifdef HAVE__CONTROLFP_S
|
||||
|
||||
/* float.h defines _controlfp_s */
|
||||
# include <float.h>
|
||||
@@ -138,7 +141,7 @@ END_EXTERN_C()
|
||||
return _xpfpa_result; \
|
||||
} while (0)
|
||||
|
||||
#elif defined(HAVE__CONTROLFP) && !defined(__x86_64__)
|
||||
#elif defined(HAVE__CONTROLFP)
|
||||
|
||||
/* float.h defines _controlfp */
|
||||
# include <float.h>
|
||||
@@ -197,7 +200,7 @@ END_EXTERN_C()
|
||||
return _xpfpa_result; \
|
||||
} while (0)
|
||||
|
||||
#elif defined(HAVE__FPU_SETCW) && !defined(__x86_64__) /* glibc systems */
|
||||
#elif defined(HAVE__FPU_SETCW) /* glibc systems */
|
||||
|
||||
/* fpu_control.h defines _FPU_[GS]ETCW */
|
||||
# include <fpu_control.h>
|
||||
@@ -256,7 +259,7 @@ END_EXTERN_C()
|
||||
return _xpfpa_result; \
|
||||
} while (0)
|
||||
|
||||
#elif defined(HAVE_FPSETPREC) && !defined(__x86_64__) /* FreeBSD */
|
||||
#elif defined(HAVE_FPSETPREC) /* FreeBSD */
|
||||
|
||||
/* fpu_control.h defines _FPU_[GS]ETCW */
|
||||
# include <machine/ieeefp.h>
|
||||
@@ -312,7 +315,7 @@ END_EXTERN_C()
|
||||
return _xpfpa_result; \
|
||||
} while (0)
|
||||
|
||||
#elif defined(HAVE_FPU_INLINE_ASM_X86) && !defined(__x86_64__)
|
||||
#elif defined(HAVE_FPU_INLINE_ASM_X86)
|
||||
|
||||
/*
|
||||
Custom x86 inline assembler implementation.
|
||||
|
||||
+7
-20
@@ -271,6 +271,10 @@ static void zend_generator_free_storage(zend_object *object) /* {{{ */
|
||||
}
|
||||
|
||||
zend_object_std_dtor(&generator->std);
|
||||
|
||||
if (generator->iterator) {
|
||||
zend_iterator_dtor(generator->iterator);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -340,16 +344,6 @@ static HashTable *zend_generator_get_gc(zval *object, zval **table, int *n) /* {
|
||||
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;
|
||||
gc_buffer_size = calc_gc_buffer_size(generator);
|
||||
if (generator->gc_buffer_size < gc_buffer_size) {
|
||||
@@ -615,7 +609,6 @@ void zend_generator_yield_from(zend_generator *generator, zend_generator *from)
|
||||
generator->node.parent = from;
|
||||
zend_generator_get_current(generator);
|
||||
GC_DELREF(&from->std);
|
||||
generator->flags |= ZEND_GENERATOR_DO_INIT;
|
||||
}
|
||||
|
||||
ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator, zend_generator *leaf)
|
||||
@@ -738,9 +731,6 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
|
||||
}
|
||||
|
||||
if (iter->funcs->valid(iter) == FAILURE) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
goto exception;
|
||||
}
|
||||
/* reached end of iteration */
|
||||
goto failure;
|
||||
}
|
||||
@@ -769,7 +759,7 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
|
||||
return SUCCESS;
|
||||
|
||||
exception:
|
||||
zend_generator_throw_exception(generator, NULL);
|
||||
zend_rethrow_exception(generator->execute_data);
|
||||
|
||||
failure:
|
||||
zval_ptr_dtor(&generator->values);
|
||||
@@ -795,13 +785,11 @@ try_again:
|
||||
|
||||
if (UNEXPECTED((orig_generator->flags & ZEND_GENERATOR_DO_INIT) != 0 && !Z_ISUNDEF(generator->value))) {
|
||||
/* We must not advance Generator if we yield from a Generator being currently run */
|
||||
orig_generator->flags &= ~ZEND_GENERATOR_DO_INIT;
|
||||
return;
|
||||
}
|
||||
|
||||
if (UNEXPECTED(!Z_ISUNDEF(generator->values))) {
|
||||
if (EXPECTED(zend_generator_get_next_delegated_value(generator) == SUCCESS)) {
|
||||
orig_generator->flags &= ~ZEND_GENERATOR_DO_INIT;
|
||||
return;
|
||||
}
|
||||
/* If there are no more deletegated values, resume the generator
|
||||
@@ -866,7 +854,6 @@ try_again:
|
||||
} else {
|
||||
generator = zend_generator_get_current(orig_generator);
|
||||
zend_generator_throw_exception(generator, NULL);
|
||||
orig_generator->flags &= ~ZEND_GENERATOR_DO_INIT;
|
||||
goto try_again;
|
||||
}
|
||||
}
|
||||
@@ -877,15 +864,15 @@ try_again:
|
||||
goto try_again;
|
||||
}
|
||||
}
|
||||
|
||||
orig_generator->flags &= ~ZEND_GENERATOR_DO_INIT;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static inline void zend_generator_ensure_initialized(zend_generator *generator) /* {{{ */
|
||||
{
|
||||
if (UNEXPECTED(Z_TYPE(generator->value) == IS_UNDEF) && EXPECTED(generator->execute_data) && EXPECTED(generator->node.parent == NULL)) {
|
||||
generator->flags |= ZEND_GENERATOR_DO_INIT;
|
||||
zend_generator_resume(generator);
|
||||
generator->flags &= ~ZEND_GENERATOR_DO_INIT;
|
||||
generator->flags |= ZEND_GENERATOR_AT_FIRST_YIELD;
|
||||
}
|
||||
}
|
||||
|
||||
+17
-21
@@ -1627,13 +1627,13 @@ ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht)
|
||||
}
|
||||
} while (++p != end);
|
||||
}
|
||||
zend_hash_iterators_remove(ht);
|
||||
SET_INCONSISTENT(HT_DESTROYED);
|
||||
} else if (EXPECTED(HT_FLAGS(ht) & HASH_FLAG_UNINITIALIZED)) {
|
||||
goto free_ht;
|
||||
}
|
||||
SET_INCONSISTENT(HT_DESTROYED);
|
||||
efree(HT_GET_DATA_ADDR(ht));
|
||||
free_ht:
|
||||
zend_hash_iterators_remove(ht);
|
||||
FREE_HASHTABLE(ht);
|
||||
}
|
||||
|
||||
@@ -2055,7 +2055,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
|
||||
target->nTableMask = HT_MIN_MASK;
|
||||
target->nNumUsed = 0;
|
||||
target->nNumOfElements = 0;
|
||||
target->nNextFreeElement = source->nNextFreeElement;
|
||||
target->nNextFreeElement = 0;
|
||||
target->nInternalPointer = 0;
|
||||
target->nTableSize = HT_MIN_SIZE;
|
||||
HT_SET_DATA_ADDR(target, &uninitialized_bucket);
|
||||
@@ -2124,7 +2124,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source
|
||||
{
|
||||
uint32_t idx;
|
||||
Bucket *p;
|
||||
zval *t, *s;
|
||||
zval *t;
|
||||
|
||||
IS_CONSISTENT(source);
|
||||
IS_CONSISTENT(target);
|
||||
@@ -2133,20 +2133,18 @@ ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source
|
||||
if (overwrite) {
|
||||
for (idx = 0; idx < source->nNumUsed; idx++) {
|
||||
p = source->arData + idx;
|
||||
s = &p->val;
|
||||
if (UNEXPECTED(Z_TYPE_P(s) == IS_INDIRECT)) {
|
||||
s = Z_INDIRECT_P(s);
|
||||
}
|
||||
if (UNEXPECTED(Z_TYPE_P(s) == IS_UNDEF)) {
|
||||
continue;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_INDIRECT) &&
|
||||
UNEXPECTED(Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) {
|
||||
continue;
|
||||
}
|
||||
if (p->key) {
|
||||
t = _zend_hash_add_or_update_i(target, p->key, s, HASH_UPDATE | HASH_UPDATE_INDIRECT);
|
||||
t = _zend_hash_add_or_update_i(target, p->key, &p->val, HASH_UPDATE | HASH_UPDATE_INDIRECT);
|
||||
if (pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
} else {
|
||||
t = zend_hash_index_update(target, p->h, s);
|
||||
t = zend_hash_index_update(target, p->h, &p->val);
|
||||
if (pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
@@ -2155,20 +2153,18 @@ ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source
|
||||
} else {
|
||||
for (idx = 0; idx < source->nNumUsed; idx++) {
|
||||
p = source->arData + idx;
|
||||
s = &p->val;
|
||||
if (UNEXPECTED(Z_TYPE_P(s) == IS_INDIRECT)) {
|
||||
s = Z_INDIRECT_P(s);
|
||||
}
|
||||
if (UNEXPECTED(Z_TYPE_P(s) == IS_UNDEF)) {
|
||||
continue;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_INDIRECT) &&
|
||||
UNEXPECTED(Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) {
|
||||
continue;
|
||||
}
|
||||
if (p->key) {
|
||||
t = _zend_hash_add_or_update_i(target, p->key, s, HASH_ADD | HASH_UPDATE_INDIRECT);
|
||||
t = _zend_hash_add_or_update_i(target, p->key, &p->val, HASH_ADD | HASH_UPDATE_INDIRECT);
|
||||
if (t && pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
} else {
|
||||
t = zend_hash_index_add(target, p->h, s);
|
||||
t = zend_hash_index_add(target, p->h, &p->val);
|
||||
if (t && pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
@@ -2809,7 +2805,7 @@ convert:
|
||||
{
|
||||
HashTable *new_ht = zend_new_array(zend_hash_num_elements(ht));
|
||||
|
||||
ZEND_HASH_FOREACH_KEY_VAL_IND(ht, num_key, str_key, zv) {
|
||||
ZEND_HASH_FOREACH_KEY_VAL(ht, num_key, str_key, zv) {
|
||||
do {
|
||||
if (Z_OPT_REFCOUNTED_P(zv)) {
|
||||
if (Z_ISREF_P(zv) && Z_REFCOUNT_P(zv) == 1) {
|
||||
|
||||
+13
-18
@@ -86,14 +86,7 @@ static zend_function *zend_duplicate_user_function(zend_function *func) /* {{{ *
|
||||
if (!(GC_FLAGS(new_function->op_array.static_variables) & IS_ARRAY_IMMUTABLE)) {
|
||||
GC_ADDREF(new_function->op_array.static_variables);
|
||||
}
|
||||
|
||||
if (CG(compiler_options) & ZEND_COMPILE_PRELOAD) {
|
||||
ZEND_ASSERT(new_function->op_array.fn_flags & ZEND_ACC_PRELOADED);
|
||||
ZEND_MAP_PTR_NEW(new_function->op_array.static_variables_ptr);
|
||||
} else {
|
||||
ZEND_MAP_PTR_INIT(new_function->op_array.static_variables_ptr, &new_function->op_array.static_variables);
|
||||
}
|
||||
|
||||
ZEND_MAP_PTR_INIT(new_function->op_array.static_variables_ptr, &new_function->op_array.static_variables);
|
||||
return new_function;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -259,6 +252,8 @@ static zend_class_entry *lookup_class(zend_class_entry *scope, zend_string *name
|
||||
|
||||
/* Instanceof that's safe to use on unlinked classes. */
|
||||
static zend_bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce2) {
|
||||
zend_class_entry *ce;
|
||||
|
||||
if (ce1 == ce2) {
|
||||
return 1;
|
||||
}
|
||||
@@ -267,18 +262,18 @@ static zend_bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce
|
||||
return instanceof_function(ce1, ce2);
|
||||
}
|
||||
|
||||
if (ce1->parent) {
|
||||
zend_class_entry *parent_ce;
|
||||
if (ce1->ce_flags & ZEND_ACC_RESOLVED_PARENT) {
|
||||
parent_ce = ce1->parent;
|
||||
ce = ce1;
|
||||
while (ce->parent) {
|
||||
if (ce->ce_flags & ZEND_ACC_RESOLVED_PARENT) {
|
||||
ce = ce->parent;
|
||||
} else {
|
||||
parent_ce = zend_lookup_class_ex(ce1->parent_name, NULL,
|
||||
ce = zend_lookup_class_ex(ce->parent_name, NULL,
|
||||
ZEND_FETCH_CLASS_ALLOW_UNLINKED | ZEND_FETCH_CLASS_NO_AUTOLOAD);
|
||||
if (!ce) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* It's not sufficient to only check the parent chain itself, as need to do a full
|
||||
* recursive instanceof in case the parent interfaces haven't been copied yet. */
|
||||
if (parent_ce && unlinked_instanceof(parent_ce, ce2)) {
|
||||
if (ce == ce2) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -295,7 +290,7 @@ static zend_bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < ce1->num_interfaces; i++) {
|
||||
zend_class_entry *ce = zend_lookup_class_ex(
|
||||
ce = zend_lookup_class_ex(
|
||||
ce1->interface_names[i].name, ce1->interface_names[i].lc_name,
|
||||
ZEND_FETCH_CLASS_ALLOW_UNLINKED | ZEND_FETCH_CLASS_NO_AUTOLOAD);
|
||||
if (ce && unlinked_instanceof(ce, ce2)) {
|
||||
|
||||
+1
-1
@@ -321,7 +321,7 @@ ZEND_API int zend_alter_ini_entry_ex(zend_string *name, zend_string *new_value,
|
||||
{
|
||||
zend_ini_entry *ini_entry;
|
||||
zend_string *duplicate;
|
||||
uint8_t modifiable;
|
||||
zend_bool modifiable;
|
||||
zend_bool modified;
|
||||
|
||||
if ((ini_entry = zend_hash_find_ptr(EG(ini_directives), name)) == NULL) {
|
||||
|
||||
@@ -292,7 +292,6 @@ static void zval_ini_dtor(zval *zv)
|
||||
%define api.pure full
|
||||
%define parse.error verbose
|
||||
|
||||
%token END 0 "end of file"
|
||||
%token TC_SECTION
|
||||
%token TC_RAW
|
||||
%token TC_CONSTANT
|
||||
|
||||
@@ -177,7 +177,7 @@ static void yy_pop_state(void)
|
||||
zend_stack_del_top(&SCNG(state_stack));
|
||||
}
|
||||
|
||||
static void yy_scan_buffer(char *str, size_t len)
|
||||
static void yy_scan_buffer(char *str, unsigned int len)
|
||||
{
|
||||
YYCURSOR = (YYCTYPE*)str;
|
||||
YYLIMIT = YYCURSOR + len;
|
||||
@@ -554,7 +554,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle)
|
||||
}
|
||||
}
|
||||
SCNG(yy_start) = (unsigned char *)buf;
|
||||
yy_scan_buffer(buf, size);
|
||||
yy_scan_buffer(buf, (unsigned int)size);
|
||||
} else {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "zend_stream_mmap() failed");
|
||||
}
|
||||
@@ -722,7 +722,7 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename)
|
||||
}
|
||||
}
|
||||
|
||||
yy_scan_buffer(buf, size);
|
||||
yy_scan_buffer(buf, (unsigned int)size);
|
||||
|
||||
new_compiled_filename = zend_string_init(filename, strlen(filename), 0);
|
||||
zend_set_compiled_filename(new_compiled_filename);
|
||||
@@ -1072,7 +1072,8 @@ static int zend_scan_escape_string(zval *zendlval, char *str, int len, char quot
|
||||
octal_buf[2] = *(++s);
|
||||
}
|
||||
}
|
||||
if (octal_buf[2] && (octal_buf[0] > '3') && !SCNG(heredoc_scan_ahead)) {
|
||||
if (octal_buf[2] &&
|
||||
(octal_buf[0] > '3')) {
|
||||
/* 3 octit values must not overflow 0xFF (\377) */
|
||||
zend_error(E_COMPILE_WARNING, "Octal escape sequence overflow \\%s is greater than \\377", octal_buf);
|
||||
}
|
||||
@@ -1117,7 +1118,6 @@ static const char *next_newline(const char *str, const char *end, size_t *newlin
|
||||
for (; str < end; str++) {
|
||||
if (*str == '\r') {
|
||||
*newline_len = str + 1 < end && *(str + 1) == '\n' ? 2 : 1;
|
||||
return str;
|
||||
} else if (*str == '\n') {
|
||||
*newline_len = 1;
|
||||
return str;
|
||||
|
||||
@@ -421,11 +421,7 @@ dynamic:
|
||||
if (flags & ZEND_ACC_CHANGED) {
|
||||
zend_property_info *p = zend_get_parent_private_property(scope, ce, member);
|
||||
|
||||
/* If there is a public/protected instance property on ce, don't try to use a
|
||||
* private static property on scope. If both are static, prefer the static
|
||||
* property on scope. This will throw a static property notice, rather than
|
||||
* a visibility error. */
|
||||
if (p && (!(p->flags & ZEND_ACC_STATIC) || (flags & ZEND_ACC_STATIC))) {
|
||||
if (p) {
|
||||
property_info = p;
|
||||
flags = property_info->flags;
|
||||
goto found;
|
||||
@@ -619,8 +615,8 @@ ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *membe
|
||||
if (EXPECTED(Z_TYPE_P(zv) == IS_STRING)) {
|
||||
zend_string *str = Z_STR_P(zv);
|
||||
if (EXPECTED(str == member) ||
|
||||
/* "str" always has a pre-calculated hash value here */
|
||||
(EXPECTED(ZSTR_H(str) == zend_string_hash_val(member)) &&
|
||||
/* hash values are always pred-calculated here */
|
||||
(EXPECTED(ZSTR_H(str) == ZSTR_H(member)) &&
|
||||
EXPECTED(zend_string_equal_content(str, member)))) {
|
||||
return &Z_PROPERTY_GUARD_P(zv);
|
||||
} else if (EXPECTED(Z_PROPERTY_GUARD_P(zv) == 0)) {
|
||||
@@ -809,13 +805,6 @@ exit:
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_always_inline zend_bool property_uses_strict_types() {
|
||||
zend_execute_data *execute_data = EG(current_execute_data);
|
||||
return execute_data
|
||||
&& execute_data->func
|
||||
&& ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data));
|
||||
}
|
||||
|
||||
ZEND_API zval *zend_std_write_property(zval *object, zval *member, zval *value, void **cache_slot) /* {{{ */
|
||||
{
|
||||
zend_object *zobj;
|
||||
@@ -840,7 +829,7 @@ ZEND_API zval *zend_std_write_property(zval *object, zval *member, zval *value,
|
||||
|
||||
if (UNEXPECTED(prop_info)) {
|
||||
ZVAL_COPY_VALUE(&tmp, value);
|
||||
if (UNEXPECTED(!zend_verify_property_type(prop_info, &tmp, property_uses_strict_types()))) {
|
||||
if (UNEXPECTED(!zend_verify_property_type(prop_info, &tmp, EG(current_execute_data) && ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data))))) {
|
||||
Z_TRY_DELREF_P(value);
|
||||
variable_ptr = &EG(error_zval);
|
||||
goto exit;
|
||||
@@ -849,7 +838,7 @@ ZEND_API zval *zend_std_write_property(zval *object, zval *member, zval *value,
|
||||
}
|
||||
|
||||
found:
|
||||
zend_assign_to_variable(variable_ptr, value, IS_TMP_VAR, property_uses_strict_types());
|
||||
zend_assign_to_variable(variable_ptr, value, IS_TMP_VAR, EG(current_execute_data) && ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data)));
|
||||
goto exit;
|
||||
}
|
||||
if (Z_PROP_FLAG_P(variable_ptr) == IS_PROP_UNINIT) {
|
||||
@@ -905,7 +894,7 @@ write_std_property:
|
||||
|
||||
if (UNEXPECTED(prop_info)) {
|
||||
ZVAL_COPY_VALUE(&tmp, value);
|
||||
if (UNEXPECTED(!zend_verify_property_type(prop_info, &tmp, property_uses_strict_types()))) {
|
||||
if (UNEXPECTED(!zend_verify_property_type(prop_info, &tmp, ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data))))) {
|
||||
zval_ptr_dtor(value);
|
||||
goto exit;
|
||||
}
|
||||
@@ -1058,8 +1047,7 @@ ZEND_API zval *zend_std_get_property_ptr_ptr(zval *object, zval *member, int typ
|
||||
retval = OBJ_PROP(zobj, property_offset);
|
||||
if (UNEXPECTED(Z_TYPE_P(retval) == IS_UNDEF)) {
|
||||
if (EXPECTED(!zobj->ce->__get) ||
|
||||
UNEXPECTED((*zend_get_property_guard(zobj, name)) & IN_GET) ||
|
||||
UNEXPECTED(prop_info && Z_PROP_FLAG_P(retval) == IS_PROP_UNINIT)) {
|
||||
UNEXPECTED((*zend_get_property_guard(zobj, name)) & IN_GET)) {
|
||||
if (UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
|
||||
if (UNEXPECTED(prop_info)) {
|
||||
zend_throw_error(NULL,
|
||||
@@ -1808,10 +1796,7 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty
|
||||
case IS_STRING:
|
||||
ce = Z_OBJCE_P(readobj);
|
||||
if (ce->__tostring) {
|
||||
zend_class_entry *fake_scope = EG(fake_scope);
|
||||
EG(fake_scope) = NULL;
|
||||
zend_call_method_with_0_params(readobj, ce, &ce->__tostring, "__tostring", &retval);
|
||||
EG(fake_scope) = fake_scope;
|
||||
if (EXPECTED(Z_TYPE(retval) == IS_STRING)) {
|
||||
ZVAL_COPY_VALUE(writeobj, &retval);
|
||||
return SUCCESS;
|
||||
|
||||
@@ -934,7 +934,7 @@ ZEND_API zend_string* ZEND_FASTCALL zval_try_get_string_func(zval *op) /* {{{ */
|
||||
|
||||
static zend_never_inline void ZEND_FASTCALL add_function_array(zval *result, zval *op1, zval *op2) /* {{{ */
|
||||
{
|
||||
if (result == op1 && Z_ARR_P(op1) == Z_ARR_P(op2)) {
|
||||
if ((result == op1) && (result == op2)) {
|
||||
/* $a += $a */
|
||||
return;
|
||||
}
|
||||
@@ -1871,9 +1871,6 @@ ZEND_API int ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2) /
|
||||
}
|
||||
} else if (UNEXPECTED(Z_STRLEN_P(op2) == 0)) {
|
||||
if (EXPECTED(result != op1)) {
|
||||
if (result == orig_op1) {
|
||||
i_zval_ptr_dtor(result);
|
||||
}
|
||||
ZVAL_COPY(result, op1);
|
||||
}
|
||||
} else {
|
||||
|
||||
+2
-2
@@ -62,8 +62,7 @@ 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*));
|
||||
|
||||
#if defined(__CYGWIN__) || defined(__PASE__)
|
||||
/* Matches zend_excute_API.c; these platforms don't support ITIMER_PROF. */
|
||||
#ifdef __CYGWIN__
|
||||
#define TIMEOUT_SIG SIGALRM
|
||||
#else
|
||||
#define TIMEOUT_SIG SIGPROF
|
||||
@@ -329,6 +328,7 @@ void zend_signal_activate(void)
|
||||
|
||||
SIGG(active) = 1;
|
||||
SIGG(depth) = 0;
|
||||
SIGG(check) = ZEND_DEBUG;
|
||||
} /* }}} */
|
||||
|
||||
/* {{{ zend_signal_deactivate
|
||||
|
||||
@@ -238,8 +238,6 @@ ZEND_API int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *
|
||||
return 0;
|
||||
}
|
||||
switch (fh1->type) {
|
||||
case ZEND_HANDLE_FILENAME:
|
||||
return strcmp(fh1->filename, fh2->filename) == 0;
|
||||
case ZEND_HANDLE_FP:
|
||||
return fh1->handle.fp == fh2->handle.fp;
|
||||
case ZEND_HANDLE_STREAM:
|
||||
|
||||
+8
-12
@@ -186,13 +186,12 @@ static zend_always_inline zend_string *zend_string_realloc(zend_string *s, size_
|
||||
ZSTR_LEN(ret) = len;
|
||||
zend_string_forget_hash_val(ret);
|
||||
return ret;
|
||||
} else {
|
||||
GC_DELREF(s);
|
||||
}
|
||||
}
|
||||
ret = zend_string_alloc(len, persistent);
|
||||
memcpy(ZSTR_VAL(ret), ZSTR_VAL(s), MIN(len, ZSTR_LEN(s)) + 1);
|
||||
if (!ZSTR_IS_INTERNED(s)) {
|
||||
GC_DELREF(s);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -207,13 +206,12 @@ static zend_always_inline zend_string *zend_string_extend(zend_string *s, size_t
|
||||
ZSTR_LEN(ret) = len;
|
||||
zend_string_forget_hash_val(ret);
|
||||
return ret;
|
||||
} else {
|
||||
GC_DELREF(s);
|
||||
}
|
||||
}
|
||||
ret = zend_string_alloc(len, persistent);
|
||||
memcpy(ZSTR_VAL(ret), ZSTR_VAL(s), ZSTR_LEN(s) + 1);
|
||||
if (!ZSTR_IS_INTERNED(s)) {
|
||||
GC_DELREF(s);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -228,13 +226,12 @@ static zend_always_inline zend_string *zend_string_truncate(zend_string *s, size
|
||||
ZSTR_LEN(ret) = len;
|
||||
zend_string_forget_hash_val(ret);
|
||||
return ret;
|
||||
} else {
|
||||
GC_DELREF(s);
|
||||
}
|
||||
}
|
||||
ret = zend_string_alloc(len, persistent);
|
||||
memcpy(ZSTR_VAL(ret), ZSTR_VAL(s), len + 1);
|
||||
if (!ZSTR_IS_INTERNED(s)) {
|
||||
GC_DELREF(s);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -248,13 +245,12 @@ static zend_always_inline zend_string *zend_string_safe_realloc(zend_string *s,
|
||||
ZSTR_LEN(ret) = (n * m) + l;
|
||||
zend_string_forget_hash_val(ret);
|
||||
return ret;
|
||||
} else {
|
||||
GC_DELREF(s);
|
||||
}
|
||||
}
|
||||
ret = zend_string_safe_alloc(n, m, l, persistent);
|
||||
memcpy(ZSTR_VAL(ret), ZSTR_VAL(s), MIN((n * m) + l, ZSTR_LEN(s)) + 1);
|
||||
if (!ZSTR_IS_INTERNED(s)) {
|
||||
GC_DELREF(s);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+3
-33
@@ -55,14 +55,6 @@
|
||||
#define IO_REPARSE_TAG_ONEDRIVE (0x80000021L)
|
||||
#endif
|
||||
|
||||
# ifndef IO_REPARSE_TAG_ACTIVISION_HSM
|
||||
# define IO_REPARSE_TAG_ACTIVISION_HSM (0x00000047L)
|
||||
# endif
|
||||
|
||||
# ifndef IO_REPARSE_TAG_PROJFS
|
||||
# define IO_REPARSE_TAG_PROJFS (0x9000001CL)
|
||||
# endif
|
||||
|
||||
# ifndef VOLUME_NAME_NT
|
||||
# define VOLUME_NAME_NT 0x2
|
||||
# endif
|
||||
@@ -498,7 +490,6 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
|
||||
HANDLE hFind = INVALID_HANDLE_VALUE;
|
||||
ALLOCA_FLAG(use_heap_large)
|
||||
wchar_t *pathw = NULL;
|
||||
int may_retry_reparse_point;
|
||||
#define FREE_PATHW() \
|
||||
do { free(pathw); } while(0);
|
||||
|
||||
@@ -597,8 +588,6 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
|
||||
}
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
retry_reparse_point:
|
||||
may_retry_reparse_point = 0;
|
||||
if (save) {
|
||||
pathw = php_win32_ioutil_any_to_w(path);
|
||||
if (!pathw) {
|
||||
@@ -621,7 +610,7 @@ retry_reparse_point:
|
||||
tmp = do_alloca(len+1, use_heap);
|
||||
memcpy(tmp, path, len+1);
|
||||
|
||||
retry_reparse_tag_cloud:
|
||||
retry:
|
||||
if(save &&
|
||||
!(IS_UNC_PATH(path, len) && len >= 3 && path[2] != '?') &&
|
||||
(dataw.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
|
||||
@@ -682,7 +671,7 @@ retry_reparse_tag_cloud:
|
||||
dataw.dwFileAttributes = fileInformation.dwFileAttributes;
|
||||
CloseHandle(hLink);
|
||||
(*ll)--;
|
||||
goto retry_reparse_tag_cloud;
|
||||
goto retry;
|
||||
}
|
||||
free_alloca(tmp, use_heap);
|
||||
CloseHandle(hLink);
|
||||
@@ -693,7 +682,6 @@ retry_reparse_tag_cloud:
|
||||
CloseHandle(hLink);
|
||||
|
||||
if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
|
||||
may_retry_reparse_point = 1;
|
||||
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
|
||||
isabsolute = pbuffer->SymbolicLinkReparseBuffer.Flags == 0;
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
@@ -765,9 +753,7 @@ retry_reparse_tag_cloud:
|
||||
else if (pbuffer->ReparseTag == IO_REPARSE_TAG_DEDUP ||
|
||||
/* Starting with 1709. */
|
||||
(pbuffer->ReparseTag & ~IO_REPARSE_TAG_CLOUD_MASK) == IO_REPARSE_TAG_CLOUD ||
|
||||
IO_REPARSE_TAG_ONEDRIVE == pbuffer->ReparseTag ||
|
||||
IO_REPARSE_TAG_ACTIVISION_HSM == pbuffer->ReparseTag ||
|
||||
IO_REPARSE_TAG_PROJFS == pbuffer->ReparseTag) {
|
||||
IO_REPARSE_TAG_ONEDRIVE == pbuffer->ReparseTag) {
|
||||
isabsolute = 1;
|
||||
substitutename = malloc((len + 1) * sizeof(char));
|
||||
if (!substitutename) {
|
||||
@@ -830,22 +816,6 @@ retry_reparse_tag_cloud:
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
free(substitutename);
|
||||
|
||||
if (may_retry_reparse_point) {
|
||||
DWORD attrs;
|
||||
|
||||
FREE_PATHW()
|
||||
pathw = php_win32_ioutil_any_to_w(path);
|
||||
if (!pathw) {
|
||||
return (size_t)-1;
|
||||
}
|
||||
attrs = GetFileAttributesW(pathw);
|
||||
if (!isVolume && attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_REPARSE_POINT)) {
|
||||
free_alloca(tmp, use_heap);
|
||||
FREE_PATHW()
|
||||
goto retry_reparse_point;
|
||||
}
|
||||
}
|
||||
|
||||
if(isabsolute == 1) {
|
||||
if (!((j == 3) && (path[1] == ':') && (path[2] == '\\'))) {
|
||||
/* use_realpath is 0 in the call below coz path is absolute*/
|
||||
|
||||
+26
-69
@@ -1272,7 +1272,6 @@ ZEND_VM_C_LABEL(assign_dim_op_new_array):
|
||||
} else {
|
||||
zend_binary_assign_op_dim_slow(container, dim OPLINE_CC EXECUTE_DATA_CC);
|
||||
ZEND_VM_C_LABEL(assign_dim_op_ret_null):
|
||||
FREE_UNFETCHED_OP_DATA();
|
||||
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
|
||||
ZVAL_NULL(EX_VAR(opline->result.var));
|
||||
}
|
||||
@@ -2620,14 +2619,15 @@ ZEND_VM_HANDLER(23, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMPVAR|UNUSED|NEXT|CV, SPEC(O
|
||||
|
||||
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) {
|
||||
ZEND_VM_C_LABEL(try_assign_dim_array):
|
||||
value = GET_OP_DATA_ZVAL_PTR(BP_VAR_R);
|
||||
SEPARATE_ARRAY(object_ptr);
|
||||
if (OP2_TYPE == IS_UNUSED) {
|
||||
value = GET_OP_DATA_ZVAL_PTR(BP_VAR_R);
|
||||
if (OP_DATA_TYPE == IS_CV || OP_DATA_TYPE == IS_VAR) {
|
||||
ZVAL_DEREF(value);
|
||||
}
|
||||
variable_ptr = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value);
|
||||
if (UNEXPECTED(variable_ptr == NULL)) {
|
||||
FREE_OP_DATA();
|
||||
zend_cannot_add_element();
|
||||
ZEND_VM_C_GOTO(assign_dim_error);
|
||||
} else if (OP_DATA_TYPE == IS_CV) {
|
||||
@@ -2656,6 +2656,7 @@ ZEND_VM_C_LABEL(try_assign_dim_array):
|
||||
if (UNEXPECTED(variable_ptr == NULL)) {
|
||||
ZEND_VM_C_GOTO(assign_dim_error);
|
||||
}
|
||||
value = GET_OP_DATA_ZVAL_PTR(BP_VAR_R);
|
||||
value = zend_assign_to_variable(variable_ptr, value, OP_DATA_TYPE, EX_USES_STRICT_TYPES());
|
||||
}
|
||||
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
|
||||
@@ -4631,15 +4632,17 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, JMP_ADDR, LAST_CATCH|CACHE_SLOT)
|
||||
|
||||
exception = EG(exception);
|
||||
ex = EX_VAR(opline->result.var);
|
||||
{
|
||||
/* Always perform a strict assignment. There is a reasonable expectation that if you
|
||||
* write "catch (Exception $e)" then $e will actually be instanceof Exception. As such,
|
||||
* we should not permit coercion to string here. */
|
||||
zval tmp;
|
||||
ZVAL_OBJ(&tmp, exception);
|
||||
if (UNEXPECTED(Z_ISREF_P(ex))) {
|
||||
ex = Z_REFVAL_P(ex);
|
||||
}
|
||||
zval_ptr_dtor(ex);
|
||||
ZVAL_OBJ(ex, EG(exception));
|
||||
if (UNEXPECTED(EG(exception) != exception)) {
|
||||
GC_ADDREF(EG(exception));
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
EG(exception) = NULL;
|
||||
zend_assign_to_variable(ex, &tmp, IS_TMP_VAR, /* strict */ 1);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5128,7 +5131,6 @@ ZEND_VM_C_LABEL(send_array):
|
||||
arg_num = 1;
|
||||
param = ZEND_CALL_ARG(EX(call), 1);
|
||||
ZEND_HASH_FOREACH_VAL(ht, arg) {
|
||||
zend_bool must_wrap = 0;
|
||||
if (skip > 0) {
|
||||
skip--;
|
||||
continue;
|
||||
@@ -5140,7 +5142,6 @@ ZEND_VM_C_LABEL(send_array):
|
||||
/* By-value send is not allowed -- emit a warning,
|
||||
* but still perform the call. */
|
||||
zend_param_must_be_ref(EX(call)->func, arg_num);
|
||||
must_wrap = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -5150,12 +5151,7 @@ ZEND_VM_C_LABEL(send_array):
|
||||
arg = Z_REFVAL_P(arg);
|
||||
}
|
||||
}
|
||||
if (EXPECTED(!must_wrap)) {
|
||||
ZVAL_COPY(param, arg);
|
||||
} else {
|
||||
Z_TRY_ADDREF_P(arg);
|
||||
ZVAL_NEW_REF(param, arg);
|
||||
}
|
||||
ZVAL_COPY(param, arg);
|
||||
ZEND_CALL_NUM_ARGS(EX(call))++;
|
||||
arg_num++;
|
||||
param++;
|
||||
@@ -5167,14 +5163,12 @@ ZEND_VM_C_LABEL(send_array):
|
||||
arg_num = 1;
|
||||
param = ZEND_CALL_ARG(EX(call), 1);
|
||||
ZEND_HASH_FOREACH_VAL(ht, arg) {
|
||||
zend_bool must_wrap = 0;
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
|
||||
if (UNEXPECTED(!Z_ISREF_P(arg))) {
|
||||
if (!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
|
||||
/* By-value send is not allowed -- emit a warning,
|
||||
* but still perform the call. */
|
||||
zend_param_must_be_ref(EX(call)->func, arg_num);
|
||||
must_wrap = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -5184,12 +5178,7 @@ ZEND_VM_C_LABEL(send_array):
|
||||
arg = Z_REFVAL_P(arg);
|
||||
}
|
||||
}
|
||||
if (EXPECTED(!must_wrap)) {
|
||||
ZVAL_COPY(param, arg);
|
||||
} else {
|
||||
Z_TRY_ADDREF_P(arg);
|
||||
ZVAL_NEW_REF(param, arg);
|
||||
}
|
||||
ZVAL_COPY(param, arg);
|
||||
ZEND_CALL_NUM_ARGS(EX(call))++;
|
||||
arg_num++;
|
||||
param++;
|
||||
@@ -5310,7 +5299,6 @@ ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, NUM, UNUSED|CACHE_SLOT)
|
||||
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(params)) {
|
||||
param = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T);
|
||||
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
|
||||
ZEND_ADD_CALL_FLAG(execute_data, ZEND_CALL_FREE_EXTRA_ARGS);
|
||||
do {
|
||||
zend_verify_variadic_arg_type(EX(func), arg_num, param, NULL, CACHE_ADDR(opline->op2.num));
|
||||
if (Z_OPT_REFCOUNTED_P(param)) Z_ADDREF_P(param);
|
||||
@@ -6317,7 +6305,11 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET_R, CONST|TMP|VAR|CV, JMP_ADDR)
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else if (OP1_TYPE != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
|
||||
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
|
||||
HashTable *properties;
|
||||
result = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(result, array_ptr);
|
||||
if (OP1_TYPE != IS_TMP_VAR) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
if (Z_OBJ_P(array_ptr)->properties
|
||||
&& UNEXPECTED(GC_REFCOUNT(Z_OBJ_P(array_ptr)->properties) > 1)) {
|
||||
if (EXPECTED(!(GC_FLAGS(Z_OBJ_P(array_ptr)->properties) & IS_ARRAY_IMMUTABLE))) {
|
||||
@@ -6325,21 +6317,8 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET_R, CONST|TMP|VAR|CV, JMP_ADDR)
|
||||
}
|
||||
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
|
||||
}
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
|
||||
|
||||
properties = Z_OBJPROP_P(array_ptr);
|
||||
result = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(result, array_ptr);
|
||||
if (OP1_TYPE != IS_TMP_VAR) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
|
||||
if (zend_hash_num_elements(properties) == 0) {
|
||||
Z_FE_ITER_P(result) = (uint32_t) -1;
|
||||
FREE_OP1_IF_VAR();
|
||||
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
|
||||
}
|
||||
|
||||
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
|
||||
FREE_OP1_IF_VAR();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
} else {
|
||||
@@ -6406,7 +6385,6 @@ ZEND_VM_COLD_CONST_HANDLER(125, ZEND_FE_RESET_RW, CONST|TMP|VAR|CV, JMP_ADDR)
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else if (OP1_TYPE != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
|
||||
if (!Z_OBJCE_P(array_ptr)->get_iterator) {
|
||||
HashTable *properties;
|
||||
if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) {
|
||||
if (array_ptr == array_ref) {
|
||||
ZVAL_NEW_REF(array_ref, array_ref);
|
||||
@@ -6425,15 +6403,8 @@ ZEND_VM_COLD_CONST_HANDLER(125, ZEND_FE_RESET_RW, CONST|TMP|VAR|CV, JMP_ADDR)
|
||||
}
|
||||
Z_OBJ_P(array_ptr)->properties = zend_array_dup(Z_OBJ_P(array_ptr)->properties);
|
||||
}
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(Z_OBJPROP_P(array_ptr), 0);
|
||||
|
||||
properties = Z_OBJPROP_P(array_ptr);
|
||||
if (zend_hash_num_elements(properties) == 0) {
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
|
||||
FREE_OP1_VAR_PTR();
|
||||
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
|
||||
}
|
||||
|
||||
Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(properties, 0);
|
||||
FREE_OP1_VAR_PTR();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
} else {
|
||||
@@ -6937,10 +6908,6 @@ ZEND_VM_C_LABEL(num_index_prop):
|
||||
ZEND_VM_C_GOTO(isset_again);
|
||||
} else {
|
||||
value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC);
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
result = 0;
|
||||
ZEND_VM_C_GOTO(isset_dim_obj_exit);
|
||||
}
|
||||
}
|
||||
|
||||
if (!(opline->extended_value & ZEND_ISEMPTY)) {
|
||||
@@ -7350,17 +7317,8 @@ ZEND_VM_HANDLER(146, ZEND_DECLARE_ANON_CLASS, ANY, ANY, CACHE_SLOT)
|
||||
zv = zend_hash_find_ex(EG(class_table), rtd_key, 1);
|
||||
if (UNEXPECTED(zv == NULL)) {
|
||||
SAVE_OPLINE();
|
||||
do {
|
||||
ZEND_ASSERT(EX(func)->op_array.fn_flags & ZEND_ACC_PRELOADED);
|
||||
if (zend_preload_autoload
|
||||
&& zend_preload_autoload(EX(func)->op_array.filename) == SUCCESS) {
|
||||
zv = zend_hash_find_ex(EG(class_table), rtd_key, 1);
|
||||
if (EXPECTED(zv != NULL)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
zend_error_noreturn(E_ERROR, "Anonymous class wasn't preloaded");
|
||||
} while (0);
|
||||
ZEND_ASSERT(EX(func)->op_array.fn_flags & ZEND_ACC_PRELOADED);
|
||||
zend_error_noreturn(E_ERROR, "Anonymous class wasn't preloaded");
|
||||
}
|
||||
ZEND_ASSERT(zv != NULL);
|
||||
ce = Z_CE_P(zv);
|
||||
@@ -7928,7 +7886,6 @@ ZEND_VM_HANDLER(166, ZEND_YIELD_FROM, CONST|TMP|VAR|CV, ANY)
|
||||
}
|
||||
} else {
|
||||
zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables");
|
||||
FREE_OP1();
|
||||
UNDEF_RESULT();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -8344,10 +8301,10 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY)
|
||||
}
|
||||
|
||||
if (ret == NULL) {
|
||||
ZVAL_NULL(&retval);
|
||||
ret = &retval;
|
||||
}
|
||||
|
||||
ZVAL_NULL(ret);
|
||||
if (!zend_execute_internal) {
|
||||
/* saves one function call if zend_execute_internal is not used */
|
||||
fbc->internal_function.handler(call, ret);
|
||||
@@ -9421,10 +9378,10 @@ ZEND_VM_DEFINE_OP(137, ZEND_OP_DATA);
|
||||
ZEND_VM_HELPER(zend_interrupt_helper, ANY, ANY)
|
||||
{
|
||||
EG(vm_interrupt) = 0;
|
||||
SAVE_OPLINE();
|
||||
if (EG(timed_out)) {
|
||||
zend_timeout(0);
|
||||
} else if (zend_interrupt_function) {
|
||||
SAVE_OPLINE();
|
||||
zend_interrupt_function(execute_data);
|
||||
ZEND_VM_ENTER();
|
||||
}
|
||||
|
||||
+140
-221
File diff suppressed because it is too large.
Load diff
@@ -75,7 +75,6 @@ void zend_vm_dtor(void)
|
||||
if (zend_handlers_table) {
|
||||
zend_hash_destroy(zend_handlers_table);
|
||||
free(zend_handlers_table);
|
||||
zend_handlers_table = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -91,10 +91,6 @@ if not exist "%PHP_BUILD_CACHE_ENCHANT_DICT_DIR%\en_US.aff" (
|
||||
mkdir %USERPROFILE%\enchant\myspell
|
||||
copy %PHP_BUILD_CACHE_ENCHANT_DICT_DIR%\* %USERPROFILE%\enchant\myspell
|
||||
|
||||
set TEST_PHPDBG_EXECUTABLE=%PHP_BUILD_OBJ_DIR%\Release
|
||||
if "%THREAD_SAFE%" equ "1" set TEST_PHPDBG_EXECUTABLE=%TEST_PHPDBG_EXECUTABLE%_TS
|
||||
set TEST_PHPDBG_EXECUTABLE=%TEST_PHPDBG_EXECUTABLE%\phpdbg.exe
|
||||
|
||||
mkdir c:\tests_tmp
|
||||
|
||||
set TEST_PHP_JUNIT=c:\junit.out.xml
|
||||
|
||||
@@ -11,14 +11,6 @@ trigger:
|
||||
- UPGRADING
|
||||
- UPGRADING.INTERNALS
|
||||
|
||||
schedules:
|
||||
- cron: "0 1 * * *"
|
||||
displayName: Nightly build
|
||||
branches:
|
||||
include:
|
||||
- PHP-7.4
|
||||
- master
|
||||
|
||||
jobs:
|
||||
- template: azure/job.yml
|
||||
parameters:
|
||||
|
||||
+1
-4
@@ -7,9 +7,6 @@ steps:
|
||||
sudo apt install bison \
|
||||
re2c \
|
||||
locales \
|
||||
ldap-utils \
|
||||
openssl \
|
||||
slapd \
|
||||
language-pack-de \
|
||||
re2c \
|
||||
libgmp-dev \
|
||||
@@ -32,9 +29,9 @@ steps:
|
||||
libpq-dev \
|
||||
libreadline-dev \
|
||||
libldap2-dev \
|
||||
libsasl2-dev \
|
||||
libsodium-dev \
|
||||
libargon2-0-dev \
|
||||
libmm-dev \
|
||||
postgresql \
|
||||
postgresql-contrib \
|
||||
llvm \
|
||||
|
||||
+5
-14
@@ -50,7 +50,7 @@ jobs:
|
||||
- script: |
|
||||
git clone https://github.com/laravel/framework.git --branch=master --depth=1
|
||||
cd framework
|
||||
php7.4 /usr/bin/composer install --no-progress
|
||||
php7.3 /usr/bin/composer install --no-progress
|
||||
export USE_ZEND_ALLOC=0
|
||||
sed -i 's/$exit = true/$exit = false/g' vendor/phpunit/phpunit/src/TextUI/Command.php
|
||||
# Avoid test using exit(), which thus leaks.
|
||||
@@ -59,10 +59,10 @@ jobs:
|
||||
php vendor/bin/phpunit
|
||||
displayName: 'Test Laravel'
|
||||
- script: |
|
||||
git clone https://github.com/symfony/symfony.git --depth=1
|
||||
git clone https://github.com/symfony/symfony.git --branch=master --depth=1
|
||||
cd symfony
|
||||
php7.4 /usr/bin/composer install --no-progress
|
||||
php7.4 ./phpunit install
|
||||
php7.3 /usr/bin/composer install --no-progress
|
||||
php7.3 ./phpunit install
|
||||
export USE_ZEND_ALLOC=0
|
||||
export USE_TRACKED_ALLOC=1
|
||||
export ASAN_OPTIONS=exitcode=139
|
||||
@@ -75,18 +75,9 @@ jobs:
|
||||
- script: |
|
||||
git clone https://github.com/amphp/amp.git --branch=master --depth=1
|
||||
cd amp
|
||||
php /usr/bin/composer install --no-progress --ignore-platform-reqs
|
||||
php7.3 /usr/bin/composer install --no-progress --ignore-platform-reqs
|
||||
export USE_ZEND_ALLOC=0
|
||||
sed -i 's/$exit = true/$exit = false/g' vendor/phpunit/phpunit/src/TextUI/Command.php
|
||||
php vendor/bin/phpunit
|
||||
displayName: 'Test Amphp'
|
||||
condition: or(succeeded(), failed())
|
||||
- script: |
|
||||
php7.4 /usr/bin/composer create-project symfony/symfony-demo symfony_demo --no-progress
|
||||
cd symfony_demo
|
||||
export USE_ZEND_ALLOC=0
|
||||
export USE_TRACKED_ALLOC=1
|
||||
sed -i 's/PHP_SAPI/"cli-server"/g' var/cache/dev/App_KernelDevDebugContainer.preload.php
|
||||
php -d opcache.preload=var/cache/dev/App_KernelDevDebugContainer.preload.php public/index.php
|
||||
displayName: 'Symfony Preloading'
|
||||
condition: or(succeeded(), failed())
|
||||
@@ -20,7 +20,11 @@ jobs:
|
||||
- script: make -j$(/usr/bin/nproc) >/dev/null
|
||||
displayName: 'Make Build'
|
||||
- template: install.yml
|
||||
- template: setup.yml
|
||||
- script: |
|
||||
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
|
||||
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
|
||||
sudo -u postgres psql -c "CREATE DATABASE test;"
|
||||
displayName: 'Setup'
|
||||
- template: test.yml
|
||||
parameters:
|
||||
configurationName: ${{ parameters.configurationName }}
|
||||
@@ -32,13 +36,10 @@ 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 Cobertura XML Report'
|
||||
displayName: 'Generate ${{ parameters.configurationName }} Test Coverage'
|
||||
condition: or(succeeded(), failed())
|
||||
- task: PublishCodeCoverageResults@1
|
||||
inputs:
|
||||
|
||||
+3
-4
@@ -7,10 +7,7 @@ steps:
|
||||
sudo apt-get update -y | true
|
||||
sudo apt-get install -y gcc-multilib
|
||||
sudo apt-get install -y g++-multilib
|
||||
sudo apt-get purge -y libxml2
|
||||
# TODO: Reenable postgresql + postgresql-contrib packages once they work again.
|
||||
sudo apt-get purge -y libpq5
|
||||
sudo apt-get install -y libc6:i386
|
||||
sudo apt-get install -y valgrind:i386
|
||||
sudo apt-get install -y bison \
|
||||
re2c \
|
||||
locales \
|
||||
@@ -44,5 +41,7 @@ steps:
|
||||
libffi-dev:i386 \
|
||||
libfreetype6-dev:i386 \
|
||||
libsodium-dev:i386 \
|
||||
postgresql \
|
||||
postgresql-contrib \
|
||||
${{ parameters.packages }}
|
||||
displayName: 'APT'
|
||||
+3
-6
@@ -5,7 +5,7 @@ parameters:
|
||||
jobs:
|
||||
- job: ${{ parameters.configurationName }}
|
||||
pool:
|
||||
vmImage: 'ubuntu-20.04'
|
||||
vmImage: 'ubuntu-18.04'
|
||||
steps:
|
||||
- template: apt.yml
|
||||
- script: |
|
||||
@@ -70,7 +70,6 @@ jobs:
|
||||
- script: make -j$(/usr/bin/nproc) >/dev/null
|
||||
displayName: 'Make Build'
|
||||
- script: |
|
||||
set -e
|
||||
sudo make install
|
||||
sudo mkdir /etc/php.d
|
||||
sudo chmod 777 /etc/php.d
|
||||
@@ -80,11 +79,9 @@ jobs:
|
||||
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
|
||||
displayName: 'Install Build'
|
||||
- script: |
|
||||
set -e
|
||||
sudo service mysql start
|
||||
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
|
||||
#sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
|
||||
#sudo -u postgres psql -c "CREATE DATABASE test;"
|
||||
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
|
||||
sudo -u postgres psql -c "CREATE DATABASE test;"
|
||||
displayName: 'Setup'
|
||||
- template: test.yml
|
||||
parameters:
|
||||
|
||||
@@ -17,7 +17,6 @@ steps:
|
||||
-j$(/usr/bin/nproc) \
|
||||
-g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \
|
||||
--offline \
|
||||
--show-diff \
|
||||
--show-slow 1000 \
|
||||
--set-timeout 120 \
|
||||
${{ parameters.runTestsParameters }}
|
||||
|
||||
Loaded 100 of 1344 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user