mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 10:10:50 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aeb198af40 |
No files matched your search
+1
-8
@@ -9,13 +9,6 @@ branches:
|
||||
|
||||
clone_depth: 64
|
||||
|
||||
skip_commits:
|
||||
files:
|
||||
- docs/*
|
||||
- NEWS
|
||||
- UPGRADING
|
||||
- UPGRADING.INTERNALS
|
||||
|
||||
cache:
|
||||
- c:\build-cache
|
||||
|
||||
@@ -23,7 +16,7 @@ environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0beta6
|
||||
PHP_BUILD_CRT: vc15
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
|
||||
@@ -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
-2
@@ -249,8 +249,7 @@ tmp-php.ini
|
||||
# ------------------------------------------------------------------------------
|
||||
*.gcda
|
||||
*.gcno
|
||||
/gcovr.xml
|
||||
/gcovr_html/
|
||||
/lcov_data/
|
||||
/lcov_html/
|
||||
/php_lcov.info
|
||||
|
||||
|
||||
+15
-36
@@ -10,30 +10,18 @@ addons:
|
||||
- locales
|
||||
- language-pack-de
|
||||
- re2c
|
||||
- ccache
|
||||
- mysql-server
|
||||
- libaspell-dev
|
||||
- libbz2-dev
|
||||
- libcurl4-gnutls-dev
|
||||
- libenchant-dev
|
||||
- libfreetype6-dev
|
||||
- libgmp-dev
|
||||
- libicu-dev
|
||||
- libjpeg-dev
|
||||
- libkrb5-dev
|
||||
- libonig-dev
|
||||
- libpng-dev
|
||||
- libpq-dev
|
||||
- libtidy-dev
|
||||
- libenchant-dev
|
||||
- libaspell-dev
|
||||
- libpspell-dev
|
||||
- libsasl2-dev
|
||||
- libsqlite3-dev
|
||||
- libsodium-dev
|
||||
- libtidy-dev
|
||||
- libwebp-dev
|
||||
- libxml2-dev
|
||||
- libxpm-dev
|
||||
- libxslt1-dev
|
||||
- libzip-dev
|
||||
- libsqlite3-dev
|
||||
- libwebp-dev
|
||||
- libonig-dev
|
||||
|
||||
|
||||
services:
|
||||
@@ -63,20 +51,10 @@ env:
|
||||
- PDO_MYSQL_TEST_USER=travis
|
||||
- PDO_MYSQL_TEST_PASS=
|
||||
- PDO_MYSQL_TEST_HOST=127.0.0.1
|
||||
- PDO_PGSQL_TEST_DSN="pgsql:host=localhost port=5432 dbname=test user=postgres password="
|
||||
- REPORT_EXIT_STATUS=1
|
||||
|
||||
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
|
||||
matrix:
|
||||
- ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
|
||||
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
|
||||
|
||||
before_script:
|
||||
- ccache --version
|
||||
@@ -87,14 +65,15 @@ before_script:
|
||||
# Compile PHP
|
||||
- travis_wait ./travis/compile.sh
|
||||
# Setup Extensions
|
||||
- ./travis/setup-mysql.sh
|
||||
- ./travis/setup-pgsql.sh
|
||||
- . ./travis/ext/mysql/setup.sh
|
||||
- . ./travis/ext/mysqli/setup.sh
|
||||
- . ./travis/ext/pdo_mysql/setup.sh
|
||||
- . ./travis/ext/pgsql/setup.sh
|
||||
- . ./travis/ext/pdo_pgsql/setup.sh
|
||||
|
||||
# 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 -j2
|
||||
- sapi/cli/php -d extension_dir=`pwd`/modules -r 'dl("zend_test");'
|
||||
|
||||
after_success:
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ use these rules.
|
||||
|
||||
4. Use definitions and macros whenever possible, so that constants have
|
||||
meaningful names and can be easily manipulated. The only exceptions to this
|
||||
rule are 0 and 1, when used as `false` and `true` (respectively). Any other
|
||||
rule are 1 and 2, when used as `false` and `true` (respectively). Any other
|
||||
use of a numeric constant to specify different behavior or actions should be
|
||||
done through a `#define`.
|
||||
|
||||
|
||||
+6
-6
@@ -35,7 +35,7 @@ If you are fixing a bug, then please submit your PR against the lowest actively
|
||||
supported branch of PHP that the bug affects (only green branches on
|
||||
[the supported version page](https://www.php.net/supported-versions.php) are
|
||||
supported). For example, at the time of writing, the lowest supported version is
|
||||
PHP 7.3, which corresponds to the `PHP-7.3` branch in Git. Please also make sure
|
||||
PHP 7.2, which corresponds to the `PHP-7.2` branch in Git. Please also make sure
|
||||
you add a link to the PR in the bug on [the bug tracker](https://bugs.php.net/).
|
||||
|
||||
Pull requests implementing RFCs should be submitted against `master`.
|
||||
@@ -331,10 +331,10 @@ Currently we have the following branches in use:
|
||||
| Branch | |
|
||||
| --------- | --------- |
|
||||
| master | Active development branch for PHP 8.0, which is open for backwards incompatible changes and major internal API changes. |
|
||||
| PHP-7.4 | Is used to release the PHP 7.4.x series. This is a current stable version and is open for bugfixes only. |
|
||||
| PHP-7.4 | Active development branch for PHP 7.4, which is open for new features and minor internal API changes. |
|
||||
| PHP-7.3 | Is used to release the PHP 7.3.x series. This is a current stable version and is open for bugfixes only. |
|
||||
| PHP-7.2 | Is used to release the PHP 7.2.x series. This is an old stable version and is open for security fixes only. |
|
||||
| PHP-7.1 | This branch is closed. |
|
||||
| PHP-7.2 | Is used to release the PHP 7.2.x series. This is a current stable version and is open for bugfixes only. |
|
||||
| PHP-7.1 | Is used to release the PHP 7.1.x series. This is an old stable version and is open for security fixes only. |
|
||||
| PHP-7.0 | This branch is closed. |
|
||||
| PHP-5.6 | This branch is closed. |
|
||||
| PHP-5.5 | This branch is closed. |
|
||||
@@ -348,8 +348,8 @@ Currently we have the following branches in use:
|
||||
The next few rules are more of a technical nature:
|
||||
|
||||
1. All non-security bugfix changes should first go to the lowest bugfix branch
|
||||
(i.e. 7.3) and then get merged up to all other branches. All security fixes
|
||||
should go to the lowest security fixes branch (i.e 7.2). If a change is not
|
||||
(i.e. 7.2) and then get merged up to all other branches. All security fixes
|
||||
should go to the lowest security fixes branch (i.e 7.1). If a change is not
|
||||
needed for later branches (i.e. fixes for features which were dropped from
|
||||
later branches) an empty merge should be done.
|
||||
|
||||
|
||||
+1
-5
@@ -329,7 +329,6 @@ STATUS: Working
|
||||
EXTENSION: gmp
|
||||
PRIMARY MAINTAINER: Stanislav Malyshev <stas@php.net> (2000 - 2018)
|
||||
Antony Dovgal <tony2001@php.net> (2005 - 2010)
|
||||
Nikita Popov <nikic@php.net> (2013 - 2019)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.4
|
||||
@@ -377,14 +376,12 @@ STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mbstring
|
||||
PRIMARY MAINTAINER: Rui Hirokawa <hirokawa@php.net> (2001 - 2013)
|
||||
Nikita Popov <nikic@php.net> (2017 - 2019)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: opcache
|
||||
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@php.net> (2013 - 2018)
|
||||
Xinchen Hui <laruence@php.net> (2013 - 2018)
|
||||
Nikita Popov <nikic@php.net> (2016 - 2019)
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.5.0
|
||||
@@ -500,8 +497,7 @@ STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: tokenizer
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net> (2002 - 2002)
|
||||
Nikita Popov <nikic@php.net> (2013 - 2019)
|
||||
MAINTENANCE: Maintained
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: zip
|
||||
|
||||
@@ -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
|
||||
|
||||
+10
-10
@@ -26,11 +26,11 @@ PCRE2 LICENCE
|
||||
PCRE2 is a library of functions to support regular expressions whose syntax
|
||||
and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Releases 10.00 and above of PCRE2 are distributed under the terms of the "BSD"
|
||||
licence, as specified below, with one exemption for certain binary
|
||||
redistributions. The documentation for PCRE2, supplied in the "doc" directory,
|
||||
is distributed under the same terms as the software itself. The data in the
|
||||
testdata directory is not copyrighted and is in the public domain.
|
||||
Release 10 of PCRE2 is distributed under the terms of the "BSD" licence, as
|
||||
specified below, with one exemption for certain binary redistributions. The
|
||||
documentation for PCRE2, supplied in the "doc" directory, is distributed under
|
||||
the same terms as the software itself. The data in the testdata directory is
|
||||
not copyrighted and is in the public domain.
|
||||
|
||||
The basic library functions are written in C and are freestanding. Also
|
||||
included in the distribution is a just-in-time compiler that can be used to
|
||||
@@ -48,7 +48,7 @@ Email domain: cam.ac.uk
|
||||
University of Cambridge Computing Service,
|
||||
Cambridge, England.
|
||||
|
||||
Copyright (c) 1997-2019 University of Cambridge
|
||||
Copyright (c) 1997-2018 University of Cambridge
|
||||
All rights reserved.
|
||||
|
||||
|
||||
@@ -57,9 +57,9 @@ PCRE2 JUST-IN-TIME COMPILATION SUPPORT
|
||||
|
||||
Written by: Zoltan Herczeg
|
||||
Email local part: hzmester
|
||||
Email domain: freemail.hu
|
||||
Emain domain: freemail.hu
|
||||
|
||||
Copyright(c) 2010-2019 Zoltan Herczeg
|
||||
Copyright(c) 2010-2018 Zoltan Herczeg
|
||||
All rights reserved.
|
||||
|
||||
|
||||
@@ -68,9 +68,9 @@ STACK-LESS JUST-IN-TIME COMPILER
|
||||
|
||||
Written by: Zoltan Herczeg
|
||||
Email local part: hzmester
|
||||
Email domain: freemail.hu
|
||||
Emain domain: freemail.hu
|
||||
|
||||
Copyright(c) 2009-2019 Zoltan Herczeg
|
||||
Copyright(c) 2009-2018 Zoltan Herczeg
|
||||
All rights reserved.
|
||||
|
||||
|
||||
|
||||
+8
-16
@@ -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) {
|
||||
@@ -722,7 +720,6 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
TSRM_API int shmdt(const void *shmaddr)
|
||||
{/*{{{*/
|
||||
shm_pair *shm = shm_get(0, (void*)shmaddr);
|
||||
int ret;
|
||||
|
||||
if (!shm->segment) {
|
||||
return -1;
|
||||
@@ -732,12 +729,7 @@ TSRM_API int shmdt(const void *shmaddr)
|
||||
shm->descriptor->shm_lpid = getpid();
|
||||
shm->descriptor->shm_nattch--;
|
||||
|
||||
ret = UnmapViewOfFile(shm->addr) ? 0 : -1;
|
||||
if (!ret && shm->descriptor->shm_nattch <= 0) {
|
||||
ret = UnmapViewOfFile(shm->descriptor) ? 0 : -1;
|
||||
shm->descriptor = NULL;
|
||||
}
|
||||
return ret;
|
||||
return UnmapViewOfFile(shm->addr) ? 0 : -1;
|
||||
}/*}}}*/
|
||||
|
||||
TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf)
|
||||
|
||||
@@ -28,26 +28,16 @@ PHP 7.4 UPGRADE NOTES
|
||||
RFC: https://wiki.php.net/rfc/notice-for-non-valid-array-container
|
||||
. get_declared_classes() no longer returns anonymous classes that haven't
|
||||
been instantiated yet.
|
||||
. "fn" is now a reserved keyword. In particular, it can no longer be used as a
|
||||
. "fn" is now a reserved keyword. In particular it can no longer be used as a
|
||||
function or class name. It can still be used as a method or class constant
|
||||
name.
|
||||
. Passing the result of a (non-reference) list() assignment by reference is
|
||||
consistently disallowed now. Previously this worked if the right-hand side
|
||||
consistently disallowed now. Previously this worked if the right hand side
|
||||
was a simple (CV) variable and did not occur as part of the list().
|
||||
. `<?php` at the end of the file (without trailing newline) will now be
|
||||
interpreted as an opening PHP tag. Previously it was interpreted either as
|
||||
`<? php` and resulted in a syntax error (with short_open_tag=1) or was
|
||||
interpreted as a literal `<?php` string (with short_open_tag=0).
|
||||
. When using include/require on a stream, stream_set_option() will be invoked
|
||||
with the STREAM_OPTION_READ_BUFFER option. Custom stream wrapper
|
||||
implementations may need to implement the stream_set_option() method to
|
||||
avoid a warning (always returning false is a sufficient implementation).
|
||||
. The "creating default object from empty value" warning is now consistently
|
||||
thrown if a falsy value is promoted into an stdClass object. Previously some
|
||||
cases like `$null->prop[0] = $val` missed this warning.
|
||||
. Previously get_declared_classes() always returned parent classes before
|
||||
child classes. This is no longer the case. No particular order is guaranteed
|
||||
for the get_declared_classes() return value.
|
||||
|
||||
- BCMath:
|
||||
. BCMath functions will now warn if a non well-formed number is passed, such
|
||||
@@ -69,12 +59,6 @@ PHP 7.4 UPGRADE NOTES
|
||||
a warning and always return false. Previously all DateInterval objects were
|
||||
considered equal, unless they had properties.
|
||||
|
||||
DOM:
|
||||
. As of PHP 7.4.4, the value of the $childNodes property of DOMDocument,
|
||||
DOMNode, DOMProcessingInstruction, DOMComment, DOMText, DOMCdataSection and
|
||||
DOMNotation is now an empty DOMNodeList instead of NULL, according to the
|
||||
W3C and WHATWG standards and the PHP manual.
|
||||
|
||||
- Intl:
|
||||
. The default parameter value of idn_to_ascii() and idn_to_utf8() is now
|
||||
INTL_IDNA_VARIANT_UTS46 instead of the deprecated INTL_IDNA_VARIANT_2003.
|
||||
@@ -94,11 +78,6 @@ DOM:
|
||||
function does not throw, so explicitly checking it is not necessary.
|
||||
RFC: http://php.net/manual/de/function.openssl-random-pseudo-bytes.php
|
||||
|
||||
- Pcntl:
|
||||
. The $restart_syscalls flag for pcntl_signal() will now be respected for
|
||||
SIGALARM. Previously it was hardcoded to false. To reduce the backwards
|
||||
compatibility impact, the default for SIGALARM will remain false however.
|
||||
|
||||
- PCRE:
|
||||
. When PREG_UNMATCHED_AS_NULL mode is used, trailing unmatched capturing
|
||||
groups will now also be set to null (or [null, -1] if offset capture is
|
||||
@@ -119,16 +98,6 @@ DOM:
|
||||
to serialize them. Serialization for reflection objects was never
|
||||
supported and resulted in corrupted reflection objects. It has been
|
||||
explicitly prohibited now.
|
||||
. The signature of the ReflectionMethod::getClosure() method changed to
|
||||
account for existing behavior with static methods:
|
||||
Before: ReflectionMethod::getClosure($object)
|
||||
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
|
||||
@@ -139,9 +108,6 @@ DOM:
|
||||
* ReflectionObject::getProperties()
|
||||
* reset(), current(), etc. Use Iterator methods instead.
|
||||
* Potentially others working on object properties as a list.
|
||||
* Other internal functions that iterate over an array, but which
|
||||
previously silently accepted an ArrayObject as well; eg curl_setopt()
|
||||
when used with an option that expects an array.
|
||||
|
||||
(array) casts are *not* affected. They will continue to return either the
|
||||
wrapped array, or the ArrayObject properties, depending on whether the
|
||||
@@ -161,7 +127,7 @@ DOM:
|
||||
. Password hashing algorithm identifiers are now nullable strings rather
|
||||
than integers.
|
||||
|
||||
* PASSWORD_DEFAULT was int 1; now is null in PHP <7.4.3 and string '2y' afterwards
|
||||
* PASSWORD_DEFAULT was int 1; now is null
|
||||
* PASSWORD_BCRYPT was int 1; now is string '2y'
|
||||
* PASSWORD_ARGON2I was int 2; now is string 'argon2i'
|
||||
* PASSWORD_ARGON2ID was int 3; now is string 'argon2id'
|
||||
@@ -178,10 +144,6 @@ DOM:
|
||||
considered failures.
|
||||
. fread() and fwrite() on plain files will now throw a notice on failure,
|
||||
such as when trying to write to a read-only file resource.
|
||||
. The stream_read() and stream_write() methods on stream wrappers now
|
||||
interpret "false" as a failure return values. If no data is available, but
|
||||
no error occurred, an empty string should be returned instead.
|
||||
. round(-0.0) will now return -0.0 rather than +0.0.
|
||||
|
||||
- Tokenizer:
|
||||
. token_get_all() will now emit a T_BAD_CHARACTER token for unexpected
|
||||
@@ -297,10 +259,6 @@ DOM:
|
||||
. Added mb_str_split() function, which provides the same functionality as
|
||||
str_split(), but operating on code points rather than bytes.
|
||||
RFC: https://wiki.php.net/rfc/mb_str_split
|
||||
. Added mbstring.regex_retry_limit ini setting defaulting to 1000000. It
|
||||
limits the amount of backtracking that may be performed during one mbregex
|
||||
match and thus protects against exponential backtracking attacks (ReDOS).
|
||||
This setting only takes effect when linking against oniguruma >= 6.8.0.
|
||||
|
||||
- OPcache:
|
||||
. Support for preloading code has been added.
|
||||
@@ -310,7 +268,7 @@ DOM:
|
||||
. The preg_replace_callback() and preg_replace_callback_array() functions now
|
||||
accept an additional $flags argument, with support for the
|
||||
PREG_OFFSET_CAPTURE and PREG_UNMATCHED_AS_NULL flags. This influences the
|
||||
format of the matches array passed to the callback function.
|
||||
format of the matches array passed to to the callback function.
|
||||
|
||||
- PDO:
|
||||
. The username and password can now be specified as part of the PDO DSN for
|
||||
@@ -354,12 +312,6 @@ DOM:
|
||||
|
||||
RFC: https://wiki.php.net/rfc/custom_object_serialization
|
||||
|
||||
. A new 'max_depth' option for unserialize(), as well as an
|
||||
unserialize_max_depth ini setting have been added. These control the
|
||||
maximum depth of structures permitted during unserialization, and are
|
||||
intended to prevent stack overflows. The default depth limit is 4096 and
|
||||
can be disabled by setting unserialize_max_depth=0.
|
||||
|
||||
. array_merge() and array_merge_recursive() may now be called without any
|
||||
arguments, in which case they will return an empty array. This is useful
|
||||
in conjunction with the spread operator, e.g. array_merge(...$arrays).
|
||||
@@ -409,7 +361,7 @@ DOM:
|
||||
ReflectionMethod::getClosure() and closure rebinding is deprecated. Doing
|
||||
so is equivalent to calling a non-static method statically, which has been
|
||||
deprecated since PHP 7.0.
|
||||
. Unbinding $this of a non-static closure that uses $this is deprecated.
|
||||
. Unbinding $this of a non-static closure is deprecated.
|
||||
. Using "parent" inside a class without a parent is deprecated, and will throw
|
||||
a compile-time error in the future. Currently an error will only be
|
||||
generated if/when the parent is accessed at run-time.
|
||||
@@ -448,11 +400,6 @@ DOM:
|
||||
// $str = ReflectionClass::export(Foo::class, true) is:
|
||||
$str = (string) new ReflectionClass(Foo::class);
|
||||
|
||||
- Socket:
|
||||
. The AI_IDN_ALLOW_UNASSIGNED and AI_IDN_USE_STD3_ASCII_RULES flags for
|
||||
socket_addrinfo_lookup() are deprecated, due to an upstream deprecation in
|
||||
glibc.
|
||||
|
||||
- Standard:
|
||||
. Passing invalid characters to ''base_convert()'', ''bindec()'', ''octdec()''
|
||||
and ''hexdec()'' will now generate a deprecation notice. The result will
|
||||
@@ -574,12 +521,6 @@ DOM:
|
||||
9. Other Changes to Extensions
|
||||
========================================
|
||||
|
||||
DBA:
|
||||
. As of PHP 7.4.2, dba_open() accepts a fifth optional parameter for lmdb
|
||||
databases which allows to specify the mapsize. The parameter defaults to
|
||||
zero, in which case the compiled in default mapsize (usually 1048576) will
|
||||
be used. The mapsize should be a multiple of the page size of the OS.
|
||||
|
||||
- GD:
|
||||
. The behavior of imagecropauto() in the bundled libgd has been synced with
|
||||
that of system libgd:
|
||||
@@ -602,10 +543,6 @@ DOM:
|
||||
. The Intl extension now requires at least ICU 50.1.
|
||||
. ResourceBundle now implements Countable.
|
||||
|
||||
- Ldap:
|
||||
. Support for nsldap has been removed.
|
||||
. Support for umich_ldap has been removed.
|
||||
|
||||
- Libxml:
|
||||
. All libxml based extensions now require libxml 2.7.6 or newer.
|
||||
|
||||
@@ -625,9 +562,6 @@ DOM:
|
||||
exists "?" operator. For more details see the RFC:
|
||||
https://wiki.php.net/rfc/pdo_escape_placeholders
|
||||
|
||||
- PDO_Firebird:
|
||||
. The extension now also support dialect 1 in addition to dialect 3.
|
||||
|
||||
- Reflection:
|
||||
. Numeric value of class, property, function and constant modifiers was
|
||||
changed. Don't filter methods and properties through
|
||||
@@ -709,11 +643,6 @@ DOM:
|
||||
. New INI directive to include or exclude arguments from stack traces
|
||||
generated for exceptions.
|
||||
|
||||
- opcache.preload_user
|
||||
. New INI directive to specify the user account under which preloading code
|
||||
is executed, if it was to be run as root otherwise (which is not allowed
|
||||
for security reasons).
|
||||
|
||||
========================================
|
||||
12. Windows Support
|
||||
========================================
|
||||
@@ -733,14 +662,10 @@ DOM:
|
||||
- configure now regards additional CFLAGS and LDFLAGS set as environment
|
||||
variables.
|
||||
|
||||
- OPcache now supports an arbitrary amount of separate caches per user via
|
||||
- OPcache now supports an arbitrary amount of separate caches per user via the
|
||||
the INI directive opcache.cache_id. All processes with the same cache ID and
|
||||
user share an OPcache instance.
|
||||
|
||||
- The OpenSSL default config path has been changed to
|
||||
"C:\Program Files\Common Files\SSL\openssl.cnf" and
|
||||
"C:\Program Files (x86)\Common Files\SSL\openssl.cnf", respectively.
|
||||
|
||||
========================================
|
||||
13. Migration to pkg-config
|
||||
========================================
|
||||
|
||||
+2
-2
@@ -213,8 +213,8 @@ PHP 7.4 INTERNALS UPGRADE NOTES
|
||||
an exception. For instructions on how to gracefully handle this see
|
||||
https://wiki.php.net/rfc/tostring_exceptions#extension_guidelines.
|
||||
|
||||
u. The typedefs uint and ulong are no longer guaranteed to be available, and
|
||||
have to be replaced with standard types.
|
||||
u. The Windows typedefs uint and ulong are no longer available, and have to be
|
||||
replaced with standard types.
|
||||
|
||||
v. Compound assignment opcodes were changed. Instead of ZEND_ASSIGN_ADD (and
|
||||
others) with 0, ZEND_ASSIGN_DIM, ZEND_ASSIGN_OBJ or
|
||||
|
||||
+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`
|
||||
|
||||
+37
-37
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
if (function_exists("date_default_timezone_set")) {
|
||||
date_default_timezone_set("UTC");
|
||||
date_default_timezone_set("UTC");
|
||||
}
|
||||
|
||||
function simple() {
|
||||
@@ -220,30 +220,30 @@ function heapsort_r($n, &$ra) {
|
||||
$ir = $n;
|
||||
|
||||
while (1) {
|
||||
if ($l > 1) {
|
||||
$rra = $ra[--$l];
|
||||
} else {
|
||||
$rra = $ra[$ir];
|
||||
$ra[$ir] = $ra[1];
|
||||
if (--$ir == 1) {
|
||||
$ra[1] = $rra;
|
||||
return;
|
||||
}
|
||||
}
|
||||
$i = $l;
|
||||
$j = $l << 1;
|
||||
while ($j <= $ir) {
|
||||
if (($j < $ir) && ($ra[$j] < $ra[$j+1])) {
|
||||
$j++;
|
||||
}
|
||||
if ($rra < $ra[$j]) {
|
||||
$ra[$i] = $ra[$j];
|
||||
$j += ($i = $j);
|
||||
} else {
|
||||
$j = $ir + 1;
|
||||
}
|
||||
}
|
||||
$ra[$i] = $rra;
|
||||
if ($l > 1) {
|
||||
$rra = $ra[--$l];
|
||||
} else {
|
||||
$rra = $ra[$ir];
|
||||
$ra[$ir] = $ra[1];
|
||||
if (--$ir == 1) {
|
||||
$ra[1] = $rra;
|
||||
return;
|
||||
}
|
||||
}
|
||||
$i = $l;
|
||||
$j = $l << 1;
|
||||
while ($j <= $ir) {
|
||||
if (($j < $ir) && ($ra[$j] < $ra[$j+1])) {
|
||||
$j++;
|
||||
}
|
||||
if ($rra < $ra[$j]) {
|
||||
$ra[$i] = $ra[$j];
|
||||
$j += ($i = $j);
|
||||
} else {
|
||||
$j = $ir + 1;
|
||||
}
|
||||
}
|
||||
$ra[$i] = $rra;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,9 +268,9 @@ function mkmatrix ($rows, $cols) {
|
||||
$count = 1;
|
||||
$mx = array();
|
||||
for ($i=0; $i<$rows; $i++) {
|
||||
for ($j=0; $j<$cols; $j++) {
|
||||
$mx[$i][$j] = $count++;
|
||||
}
|
||||
for ($j=0; $j<$cols; $j++) {
|
||||
$mx[$i][$j] = $count++;
|
||||
}
|
||||
}
|
||||
return($mx);
|
||||
}
|
||||
@@ -278,13 +278,13 @@ function mkmatrix ($rows, $cols) {
|
||||
function mmult ($rows, $cols, $m1, $m2) {
|
||||
$m3 = array();
|
||||
for ($i=0; $i<$rows; $i++) {
|
||||
for ($j=0; $j<$cols; $j++) {
|
||||
$x = 0;
|
||||
for ($k=0; $k<$cols; $k++) {
|
||||
$x += $m1[$i][$k] * $m2[$k][$j];
|
||||
}
|
||||
$m3[$i][$j] = $x;
|
||||
}
|
||||
for ($j=0; $j<$cols; $j++) {
|
||||
$x = 0;
|
||||
for ($k=0; $k<$cols; $k++) {
|
||||
$x += $m1[$i][$k] * $m2[$k][$j];
|
||||
}
|
||||
$m3[$i][$j] = $x;
|
||||
}
|
||||
}
|
||||
return($m3);
|
||||
}
|
||||
@@ -353,7 +353,7 @@ function gethrtime()
|
||||
|
||||
function start_test()
|
||||
{
|
||||
ob_start();
|
||||
ob_start();
|
||||
return gethrtime();
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ function end_test($start, $name)
|
||||
$pad = str_repeat(" ", 24-strlen($name)-strlen($num));
|
||||
|
||||
echo $name.$pad.$num."\n";
|
||||
ob_start();
|
||||
ob_start();
|
||||
return gethrtime();
|
||||
}
|
||||
|
||||
|
||||
+141
-141
@@ -22,220 +22,220 @@ function simpleicall($n) {
|
||||
}
|
||||
|
||||
class Foo {
|
||||
static $a = 0;
|
||||
public $b = 0;
|
||||
const TEST = 0;
|
||||
static $a = 0;
|
||||
public $b = 0;
|
||||
const TEST = 0;
|
||||
|
||||
static function read_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = self::$a;
|
||||
}
|
||||
}
|
||||
static function read_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = self::$a;
|
||||
}
|
||||
}
|
||||
|
||||
static function write_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
self::$a = 0;
|
||||
}
|
||||
}
|
||||
static function write_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
self::$a = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static function isset_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = isset(self::$a);
|
||||
}
|
||||
}
|
||||
static function isset_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = isset(self::$a);
|
||||
}
|
||||
}
|
||||
|
||||
static function empty_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = empty(self::$a);
|
||||
}
|
||||
}
|
||||
static function empty_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = empty(self::$a);
|
||||
}
|
||||
}
|
||||
|
||||
static function f() {
|
||||
}
|
||||
static function f() {
|
||||
}
|
||||
|
||||
static function call_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
self::f();
|
||||
}
|
||||
}
|
||||
static function call_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
self::f();
|
||||
}
|
||||
}
|
||||
|
||||
function read_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $this->b;
|
||||
}
|
||||
}
|
||||
function read_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $this->b;
|
||||
}
|
||||
}
|
||||
|
||||
function write_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b = 0;
|
||||
}
|
||||
}
|
||||
function write_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function assign_add_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b += 2;
|
||||
}
|
||||
}
|
||||
function assign_add_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b += 2;
|
||||
}
|
||||
}
|
||||
|
||||
function pre_inc_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
++$this->b;
|
||||
}
|
||||
}
|
||||
function pre_inc_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
++$this->b;
|
||||
}
|
||||
}
|
||||
|
||||
function pre_dec_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
--$this->b;
|
||||
}
|
||||
}
|
||||
function pre_dec_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
--$this->b;
|
||||
}
|
||||
}
|
||||
|
||||
function post_inc_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b++;
|
||||
}
|
||||
}
|
||||
function post_inc_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b++;
|
||||
}
|
||||
}
|
||||
|
||||
function post_dec_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b--;
|
||||
}
|
||||
}
|
||||
function post_dec_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b--;
|
||||
}
|
||||
}
|
||||
|
||||
function isset_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = isset($this->b);
|
||||
}
|
||||
}
|
||||
function isset_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = isset($this->b);
|
||||
}
|
||||
}
|
||||
|
||||
function empty_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = empty($this->b);
|
||||
}
|
||||
}
|
||||
function empty_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = empty($this->b);
|
||||
}
|
||||
}
|
||||
|
||||
function g() {
|
||||
}
|
||||
function g() {
|
||||
}
|
||||
|
||||
function call($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->g();
|
||||
}
|
||||
}
|
||||
function call($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->g();
|
||||
}
|
||||
}
|
||||
|
||||
function read_const($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $this::TEST;
|
||||
}
|
||||
}
|
||||
function read_const($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $this::TEST;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function read_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = Foo::$a;
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = Foo::$a;
|
||||
}
|
||||
}
|
||||
|
||||
function write_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
Foo::$a = 0;
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
Foo::$a = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function isset_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = isset(Foo::$a);
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = isset(Foo::$a);
|
||||
}
|
||||
}
|
||||
|
||||
function empty_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = empty(Foo::$a);
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = empty(Foo::$a);
|
||||
}
|
||||
}
|
||||
|
||||
function call_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
Foo::f();
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
Foo::f();
|
||||
}
|
||||
}
|
||||
|
||||
function create_object($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = new Foo();
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = new Foo();
|
||||
}
|
||||
}
|
||||
|
||||
define('TEST', null);
|
||||
|
||||
function read_const($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = TEST;
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = TEST;
|
||||
}
|
||||
}
|
||||
|
||||
function read_auto_global($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $_GET;
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $_GET;
|
||||
}
|
||||
}
|
||||
|
||||
$g_var = 0;
|
||||
|
||||
function read_global_var($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $GLOBALS['g_var'];
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $GLOBALS['g_var'];
|
||||
}
|
||||
}
|
||||
|
||||
function read_hash($n) {
|
||||
$hash = array('test' => 0);
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $hash['test'];
|
||||
}
|
||||
$hash = array('test' => 0);
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $hash['test'];
|
||||
}
|
||||
}
|
||||
|
||||
function read_str_offset($n) {
|
||||
$str = "test";
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $str[1];
|
||||
}
|
||||
$str = "test";
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $str[1];
|
||||
}
|
||||
}
|
||||
|
||||
function issetor($n) {
|
||||
$val = array(0,1,2,3,4,5,6,7,8,9);
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $val ?: null;
|
||||
}
|
||||
$val = array(0,1,2,3,4,5,6,7,8,9);
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $val ?: null;
|
||||
}
|
||||
}
|
||||
|
||||
function issetor2($n) {
|
||||
$f = false; $j = 0;
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $f ?: $j + 1;
|
||||
}
|
||||
$f = false; $j = 0;
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $f ?: $j + 1;
|
||||
}
|
||||
}
|
||||
|
||||
function ternary($n) {
|
||||
$val = array(0,1,2,3,4,5,6,7,8,9);
|
||||
$f = false;
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $f ? null : $val;
|
||||
}
|
||||
$val = array(0,1,2,3,4,5,6,7,8,9);
|
||||
$f = false;
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $f ? null : $val;
|
||||
}
|
||||
}
|
||||
|
||||
function ternary2($n) {
|
||||
$f = false; $j = 0;
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $f ? $f : $j + 1;
|
||||
}
|
||||
$f = false; $j = 0;
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $f ? $f : $j + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*****/
|
||||
|
||||
function empty_loop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
}
|
||||
}
|
||||
|
||||
function gethrtime()
|
||||
|
||||
@@ -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,20 +0,0 @@
|
||||
--TEST--
|
||||
Using array unpacking in an array literal that also has string keys (OSS-Fuzz #17965)
|
||||
--FILE--
|
||||
<?php
|
||||
$y = [1, 2, 3];
|
||||
$z = "bar";
|
||||
$x = [...$y, "foo" => $z];
|
||||
var_dump($x);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
["foo"]=>
|
||||
string(3) "bar"
|
||||
}
|
||||
@@ -94,7 +94,7 @@ L0:
|
||||
}
|
||||
}));
|
||||
|
||||
assert(0 && ($a = function &(?array &$a, X $b = null) use ($c,&$d) : X {
|
||||
assert(0 && ($a = function &(array &$a, X $b = null) use ($c,&$d) : X {
|
||||
class A {
|
||||
use T1, T2 {
|
||||
T1::foo insteadof foo;
|
||||
@@ -140,7 +140,6 @@ assert(0 && ($a = function () {
|
||||
if ($a) {
|
||||
} elseif ($b) {
|
||||
}
|
||||
if ($a); else;
|
||||
}));
|
||||
|
||||
?>
|
||||
@@ -244,7 +243,7 @@ Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c,
|
||||
|
||||
})) failed in %sexpect_015.php on line %d
|
||||
|
||||
Warning: assert(): assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X {
|
||||
Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c, &$d): X {
|
||||
class A {
|
||||
use T1, T2 {
|
||||
T1::foo insteadof foo;
|
||||
@@ -293,7 +292,4 @@ Warning: assert(): assert(0 && ($a = function () {
|
||||
if ($a) {
|
||||
} elseif ($b) {
|
||||
}
|
||||
if ($a) {
|
||||
} else {
|
||||
}
|
||||
})) failed in %sexpect_015.php on line %d
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Null coalesce assign with memoized constant operand that is later interned (OSS-Fuzz #17903)
|
||||
--FILE--
|
||||
<?php
|
||||
$foo[__DIR__] ??= 42;
|
||||
var_dump($foo);
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
["%s"]=>
|
||||
int(42)
|
||||
}
|
||||
@@ -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"
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Assigning the result of a non-reference function by-reference should not leak
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function func() {
|
||||
return [0];
|
||||
}
|
||||
|
||||
$x = $y =& func();
|
||||
var_dump($x, $y);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Only variables should be assigned by reference in %s on line %d
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -6,7 +6,4 @@ class test implements a {
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Interface 'a' not found in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
Fatal error: Interface 'a' not found in %sbug30519.php on line 2
|
||||
@@ -10,7 +10,4 @@ var_dump($a instanceOf A);
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Interface 'RecurisiveFooFar' not found in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
Fatal error: Interface RecurisiveFooFar cannot implement itself in %s on line %d
|
||||
@@ -6,7 +6,6 @@ highlight.comment = #FF8000
|
||||
highlight.keyword = #007700
|
||||
highlight.default = #0000BB
|
||||
highlight.html = #000000
|
||||
--WHITESPACE_SENSITIVE--
|
||||
--FILE--
|
||||
<?php
|
||||
$code = '
|
||||
|
||||
@@ -24,14 +24,11 @@ var_dump(new Foo());
|
||||
--EXPECTF--
|
||||
string(3) "Foo"
|
||||
string(3) "Bar"
|
||||
string(3) "Foo"
|
||||
string(3) "Bar"
|
||||
|
||||
Fatal error: Uncaught Exception: Bar in %s:%d
|
||||
Fatal error: During class fetch: Uncaught Exception: Bar in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: {closure}('Bar')
|
||||
#1 %s(%d): spl_autoload_call('Bar')
|
||||
#2 [internal function]: {closure}('Foo')
|
||||
#3 %s(%d): spl_autoload_call('Foo')
|
||||
#4 {main}
|
||||
thrown in %s on line %d
|
||||
#4 {main} in %s on line %d
|
||||
@@ -25,8 +25,9 @@ try {
|
||||
--EXPECTF--
|
||||
1. Exception: aaa in %sbug52361.php:5
|
||||
Stack trace:
|
||||
#0 %sbug52361.php(16): aaa->__destruct()
|
||||
#1 {main}
|
||||
#0 %sbug52361.php(13): aaa->__destruct()
|
||||
#1 %sbug52361.php(16): bbb()
|
||||
#2 {main}
|
||||
2. Exception: bbb in %sbug52361.php:13
|
||||
Stack trace:
|
||||
#0 %sbug52361.php(16): bbb()
|
||||
|
||||
@@ -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,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #60161: Implementing an interface extending Traversable is order dependent
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface Foo extends Traversable {
|
||||
}
|
||||
|
||||
class Example implements Foo, IteratorAggregate {
|
||||
public function getIterator() {
|
||||
return new ArrayIterator([]);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -11,12 +11,14 @@ set_error_handler(function($errno, $errstr, $errfile, $errline){
|
||||
require 'notfound.php';
|
||||
--EXPECTF--
|
||||
error(require(notfound.php): failed to open stream: %s)
|
||||
Fatal error: Uncaught Exception: Foo in %sbug60909_1.php:5
|
||||
Warning: Uncaught Exception: Foo in %sbug60909_1.php:5
|
||||
Stack trace:
|
||||
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array)
|
||||
#1 %sbug60909_1.php(8): require()
|
||||
#2 {main}
|
||||
thrown in %sbug60909_1.php on line 5
|
||||
|
||||
Fatal error: main(): Failed opening required 'notfound.php' (include_path='%s') in %sbug60909_1.php on line 8
|
||||
|
||||
|
||||
!!!shutdown!!!
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63206 Fully support error_handler stacking, even inside the error_handler
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'First handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'Second handler' . PHP_EOL;
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'Internal handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
$triggerInternalNotice++; // warnings while handling the error should go into internal handler
|
||||
|
||||
restore_error_handler();
|
||||
});
|
||||
|
||||
$triggerNotice1++;
|
||||
$triggerNotice2++;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Second handler
|
||||
Internal handler
|
||||
Second handler
|
||||
Internal handler
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63206 Fully support error_handler stacking, even with null
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'First handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'Second handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
set_error_handler(null);
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'Fourth handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
restore_error_handler();
|
||||
restore_error_handler();
|
||||
|
||||
$triggerNotice++;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Second handler
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63206 Fully support exception_handler stacking, even with null
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_exception_handler(function() {
|
||||
echo 'First handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
set_exception_handler(function() {
|
||||
echo 'Second handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
set_exception_handler(null);
|
||||
|
||||
set_exception_handler(function() {
|
||||
echo 'Fourth handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
restore_exception_handler();
|
||||
restore_exception_handler();
|
||||
|
||||
throw new Exception();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Second handler
|
||||
@@ -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===
|
||||
@@ -13,17 +13,12 @@ class foo {
|
||||
function &noref() { $foo = 1; return $foo; }
|
||||
|
||||
$foo = new foo;
|
||||
try {
|
||||
$foo->i = &noref();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
$foo->i = &noref();
|
||||
var_dump($foo);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Cannot assign by reference to overloaded object
|
||||
object(foo)#1 (1) {
|
||||
["var":"foo":private]=>
|
||||
NULL
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,8 +1,17 @@
|
||||
--TEST--
|
||||
Bug #70253 (segfault at _efree () in zend_alloc.c:1389)
|
||||
--INI--
|
||||
memory_limit=2M
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
|
||||
if ($zend_mm_enabled === "0") {
|
||||
die("skip Zend MM disabled");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
unserialize('a:2:{i:0;O:9:"000000000":10000000');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: unserialize(): Error at offset 33 of 33 bytes in %s on line %d
|
||||
Fatal error: Allowed memory size of 2097152 bytes exhausted%s(tried to allocate %d bytes) in %s on line %d
|
||||
@@ -7,4 +7,4 @@ $x = (new ReflectionFunction("substr"))->getClosure();
|
||||
$x->call(new a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot rebind scope of closure created 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)
|
||||
@@ -9,6 +9,6 @@ var_dump($highlightedString);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(169) "<code><span style="color: #000000">
|
||||
<span style="color: #0000BB"><?php <br /> 09 09 09</span><span style="color: #007700">;</span>
|
||||
<span style="color: #0000BB"><?php <br /> </span><span style="color: #007700">09 09 09;</span>
|
||||
</span>
|
||||
</code>"
|
||||
@@ -19,7 +19,7 @@ class MemoryLeak
|
||||
private $things = [];
|
||||
}
|
||||
|
||||
ini_set('memory_limit', '20M');
|
||||
ini_set('memory_limit', '10M');
|
||||
|
||||
for ($i = 0; $i < 100000; ++$i) {
|
||||
$obj = new MemoryLeak();
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72530: Use After Free in GC with Certain Destructors
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class ryat {
|
||||
var $ryat;
|
||||
var $chtg;
|
||||
|
||||
function __destruct() {
|
||||
$this->chtg = $this->ryat;
|
||||
$this->ryat = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$o = new ryat;
|
||||
$o->ryat = $o;
|
||||
$x =& $o->chtg;
|
||||
|
||||
unset($o);
|
||||
gc_collect_cycles();
|
||||
var_dump($x);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(ryat)#1 (2) {
|
||||
["ryat"]=>
|
||||
int(1)
|
||||
["chtg"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
@@ -20,8 +20,12 @@ var_dump($array);
|
||||
$array = [1];
|
||||
$func(list(&$val) = $array);
|
||||
var_dump($array);
|
||||
|
||||
$array = [1];
|
||||
change(list($val) = $array);
|
||||
var_dump($array);
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
@@ -70,3 +74,9 @@ array(10) {
|
||||
[9]=>
|
||||
int(10)
|
||||
}
|
||||
|
||||
Notice: Only variables should be passed by reference in %s on line %d
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73663.2 ("Invalid opcode 65/16/8" occurs with a variable created with list())
|
||||
--FILE--
|
||||
<?php
|
||||
function change(&$ref) {
|
||||
$ref = range(1, 10);
|
||||
return;
|
||||
}
|
||||
|
||||
$array = [1];
|
||||
change(list($val) = $array);
|
||||
var_dump($array);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Only variables can be passed by reference in %s on line %d
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73816: Broken eval(anonymous class)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function anon()
|
||||
{
|
||||
static $i = 0;
|
||||
return eval(sprintf('return new class { private $prop%s; };', ++$i));
|
||||
}
|
||||
|
||||
var_dump(anon());
|
||||
var_dump(anon());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(class@anonymous)#1 (1) {
|
||||
["prop1":"class@anonymous":private]=>
|
||||
NULL
|
||||
}
|
||||
object(class@anonymous)#1 (1) {
|
||||
["prop2":"class@anonymous":private]=>
|
||||
NULL
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
--TEST--
|
||||
Bug #76047: Use-after-free when accessing already destructed backtrace arguments
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Vuln {
|
||||
public $a;
|
||||
public function __destruct() {
|
||||
unset($this->a);
|
||||
$backtrace = (new Exception)->getTrace();
|
||||
var_dump($backtrace);
|
||||
}
|
||||
}
|
||||
|
||||
function test($arg) {
|
||||
$arg = str_shuffle(str_repeat('A', 79));
|
||||
$vuln = new Vuln();
|
||||
$vuln->a = $arg;
|
||||
}
|
||||
|
||||
function test2($arg) {
|
||||
$$arg = 1; // Trigger symbol table
|
||||
$arg = str_shuffle(str_repeat('A', 79));
|
||||
$vuln = new Vuln();
|
||||
$vuln->a = $arg;
|
||||
}
|
||||
|
||||
test('x');
|
||||
test2('x');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
["file"]=>
|
||||
string(%d) "%s"
|
||||
["line"]=>
|
||||
int(%d)
|
||||
["function"]=>
|
||||
string(10) "__destruct"
|
||||
["class"]=>
|
||||
string(4) "Vuln"
|
||||
["type"]=>
|
||||
string(2) "->"
|
||||
["args"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
["file"]=>
|
||||
string(%d) "%s"
|
||||
["line"]=>
|
||||
int(%d)
|
||||
["function"]=>
|
||||
string(10) "__destruct"
|
||||
["class"]=>
|
||||
string(4) "Vuln"
|
||||
["type"]=>
|
||||
string(2) "->"
|
||||
["args"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
BUG #77589 (Core dump using parse_ini_string with numeric sections)
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(
|
||||
parse_ini_string(<<<INI
|
||||
[0]
|
||||
a = 1
|
||||
b = on
|
||||
c = true
|
||||
|
||||
["true"]
|
||||
a = 100
|
||||
b = null
|
||||
c = yes
|
||||
INI
|
||||
, TRUE, INI_SCANNER_TYPED));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
["a"]=>
|
||||
int(1)
|
||||
["b"]=>
|
||||
bool(true)
|
||||
["c"]=>
|
||||
bool(true)
|
||||
}
|
||||
["true"]=>
|
||||
array(3) {
|
||||
["a"]=>
|
||||
int(100)
|
||||
["b"]=>
|
||||
NULL
|
||||
["c"]=>
|
||||
bool(true)
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77922: Double release of doc comment on inherited shadow property
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
/** Foo */
|
||||
private $prop;
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
}
|
||||
|
||||
class C extends B {
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78335: Static properties/variables containing cycles report as leak
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public static $test;
|
||||
|
||||
public static function method() {
|
||||
static $foo;
|
||||
$foo = [&$foo];
|
||||
}
|
||||
}
|
||||
|
||||
function test() {
|
||||
static $foo;
|
||||
$foo = [&$foo];
|
||||
}
|
||||
|
||||
$foo = [&$foo];
|
||||
Test::$test = $foo;
|
||||
test();
|
||||
Test::method();
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78335: Static properties containing cycles report as leak (internal class variant)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("zend-test")) die("skip requires zend-test"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$foo = [&$foo];
|
||||
_ZendTestClass::$_StaticProp = $foo;
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78379 (Cast to object confuses GC, causes crash)
|
||||
--INI--
|
||||
opcache.enable=0
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
public function __construct() {
|
||||
$this->p = (object)["x" => [1]];
|
||||
}
|
||||
}
|
||||
class E {
|
||||
}
|
||||
$e = new E;
|
||||
$e->f = new E;
|
||||
$e->f->e = $e;
|
||||
$e->a = new C;
|
||||
$e = null;
|
||||
gc_collect_cycles();
|
||||
var_dump(new C);
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(C)#%d (1) {
|
||||
["p"]=>
|
||||
object(stdClass)#%d (1) {
|
||||
["x"]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78379.2 (Cast to object confuses GC, causes crash)
|
||||
--FILE--
|
||||
<?php
|
||||
class E {}
|
||||
function f() {
|
||||
$e1 = new E;
|
||||
$e2 = new E;
|
||||
$a = ['e2' => $e2];
|
||||
$e1->a = (object)$a;
|
||||
$e2->e1 = $e1;
|
||||
$e2->a = (object)$a;
|
||||
}
|
||||
f();
|
||||
gc_collect_cycles();
|
||||
echo "End\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
End
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78396: Second file_put_contents in Shutdown hangs script
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
register_shutdown_function(function () {
|
||||
file_put_contents(__DIR__ . '/bug78396.txt', '1', FILE_APPEND | LOCK_EX);
|
||||
file_put_contents(__DIR__ . '/bug78396.txt', '2', FILE_APPEND | LOCK_EX);
|
||||
echo "Done\n";
|
||||
});
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink(__DIR__ . '/bug78396.txt');
|
||||
?>
|
||||
--EXPECT--
|
||||
Done
|
||||
@@ -1,44 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78406: Broken file includes with user-defined stream filters
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
echo "bug\n"; // Should be transformed by filter on second include
|
||||
|
||||
if (!class_exists(SampleFilter::class)) {
|
||||
class SampleFilter extends php_user_filter
|
||||
{
|
||||
private $data = '';
|
||||
|
||||
public function filter($in, $out, &$consumed, $closing)
|
||||
{
|
||||
while ($bucket = stream_bucket_make_writeable($in))
|
||||
{
|
||||
$this->data .= $bucket->data;
|
||||
}
|
||||
|
||||
if ($closing || feof($this->stream))
|
||||
{
|
||||
$consumed = strlen($this->data);
|
||||
|
||||
$this->data = str_replace('bug', 'feature', $this->data);
|
||||
|
||||
$bucket = stream_bucket_new($this->stream, $this->data);
|
||||
stream_bucket_append($out, $bucket);
|
||||
|
||||
return PSFS_PASS_ON;
|
||||
}
|
||||
|
||||
return PSFS_FEED_ME;
|
||||
}
|
||||
}
|
||||
stream_filter_register('sample.filter', SampleFilter::class);
|
||||
$uri = 'php://filter/read=sample.filter/resource='. __FILE__;
|
||||
|
||||
include $uri; // We expect one more "feature" output at line 3
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bug
|
||||
feature
|
||||
@@ -1,7 +0,0 @@
|
||||
--TEST--
|
||||
Invalid consecutive numeric separators after hex literal
|
||||
--FILE--
|
||||
<?php
|
||||
0x0__F;
|
||||
--EXPECTF--
|
||||
Parse error: syntax error, unexpected '__F' (T_STRING) in %s on line %d
|
||||
@@ -1,7 +0,0 @@
|
||||
--TEST--
|
||||
Invalid consecutive numeric separators after binary literal
|
||||
--FILE--
|
||||
<?php
|
||||
0b0__1
|
||||
--EXPECTF--
|
||||
Parse error: syntax error, unexpected '__1' (T_STRING) in %s on line %d
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78502: Incorrect stack size calculation for indirectly recursive function call
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$tree = [
|
||||
'name' => 'a',
|
||||
'quant' => 1,
|
||||
'children' => [
|
||||
['name' => 'b', 'quant' => 1],
|
||||
['name' => 'c', 'quant' => 1, 'children' => [
|
||||
['name' => 'd', 'quant' => 1],
|
||||
]],
|
||||
],
|
||||
];
|
||||
|
||||
function tree_map($tree, $recursive_attr, closure $callback){
|
||||
if(isset($tree[$recursive_attr])){
|
||||
$tree[$recursive_attr] = array_map(function($c) use($recursive_attr, $callback){
|
||||
return tree_map($c, $recursive_attr, $callback);
|
||||
}, $tree[$recursive_attr]);
|
||||
}
|
||||
return $callback($tree);
|
||||
}
|
||||
|
||||
tree_map($tree, 'children', function ($node) {});
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78531 (Crash when using undefined variable as object)
|
||||
--FILE--
|
||||
<?php
|
||||
@$u1->a += 5;
|
||||
var_dump($u1->a);
|
||||
@$x = ++$u2->a;
|
||||
var_dump($u2->a);
|
||||
@$x = $u3->a++;
|
||||
var_dump($u3->a);
|
||||
@$u4->a->a += 5;
|
||||
var_dump($u4->a->a);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(5)
|
||||
int(1)
|
||||
int(1)
|
||||
int(5)
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78589: Memory leak with GC + __destruct()
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public function __destruct() {}
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
$test->foo = [&$test->foo];
|
||||
$ary = [&$ary, $test];
|
||||
unset($ary, $test);
|
||||
gc_collect_cycles();
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -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,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78644: SEGFAULT in ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = new stdClass;
|
||||
unset($a->b->c->d);
|
||||
unset($a->b->c['d']);
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (1) {
|
||||
["b"]=>
|
||||
NULL
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78658: Memory corruption using Closure::bindTo()
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$c = function(){};
|
||||
|
||||
$scope = "AAAA";
|
||||
$scope = "{$scope}BBBB";
|
||||
$c->bindTo(new stdClass, $scope);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Class 'AAAABBBB' not found in %s on line %d
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78689: Closure::fromCallable() doesn't handle [Closure, '__invoke']
|
||||
--FILE--
|
||||
<?php
|
||||
$a = [function () { echo "123\n"; }, '__invoke'];
|
||||
$a();
|
||||
|
||||
$b = Closure::fromCallable($a);
|
||||
$b();
|
||||
?>
|
||||
--EXPECT--
|
||||
123
|
||||
123
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78752: Segfault if GC triggered while generator stack frame is being destroyed
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen(&$gen) {
|
||||
$a = new stdClass;
|
||||
$a->a = $a;
|
||||
$b = new stdClass;
|
||||
$b->b = $b;
|
||||
yield 1;
|
||||
}
|
||||
|
||||
$gen = gen($gen);
|
||||
var_dump($gen->current());
|
||||
for ($i = 0; $i < 9999; $i++) {
|
||||
$a = new stdClass;
|
||||
$a->a = $a;
|
||||
}
|
||||
$gen->next();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78776: Abstract method implementation from trait does not check "static"
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
abstract class A
|
||||
{
|
||||
abstract public function createApp();
|
||||
}
|
||||
|
||||
class B extends A
|
||||
{
|
||||
use C;
|
||||
}
|
||||
|
||||
trait C
|
||||
{
|
||||
public static function createApp()
|
||||
{
|
||||
echo "You should not be here\n";
|
||||
}
|
||||
}
|
||||
|
||||
B::createApp();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot make non static method A::createApp() static in class C in %s on line %d
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78787: Segfault with trait overriding inherited private shadow property
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait T {
|
||||
private $prop;
|
||||
}
|
||||
class C1 {
|
||||
/** Doc comment */
|
||||
private $prop;
|
||||
}
|
||||
class C2 extends C1 {
|
||||
}
|
||||
class C3 extends C2 {
|
||||
use T;
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78810: RW fetches do not throw "uninitialized property" exception
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public int $i;
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
try {
|
||||
$test->i++;
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
$test->i += 1;
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Typed property Test::$i must not be accessed before initialization
|
||||
Typed property Test::$i must not be accessed before initialization
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78868: Calling __autoload() with incorrect EG(fake_scope) value
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
private $private = 1;
|
||||
|
||||
function foo() {
|
||||
$this->private++; //fails with EG(fake_scope) != NULL && EG(fake_scope) != "C"
|
||||
}
|
||||
}
|
||||
|
||||
class A {
|
||||
static $foo = B::foo; //not resolved on include()
|
||||
}
|
||||
|
||||
function main_autoload($class_name) {
|
||||
$c = new C;
|
||||
$c->foo();
|
||||
//doesn't affect the error
|
||||
eval("class B {const foo = 1;}");
|
||||
}
|
||||
|
||||
spl_autoload_register('main_autoload', false);
|
||||
|
||||
$classA = new ReflectionClass("A");
|
||||
$props = $classA->getProperties();
|
||||
$props[0]->setValue(2); //causes constant resolving, which runs autoload, all with EG(fake_scope) == "A"
|
||||
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,34 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78898: call_user_func(['parent', ...]) fails while other succeed
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A
|
||||
{
|
||||
protected function _x()
|
||||
{
|
||||
echo "a";
|
||||
}
|
||||
|
||||
public function __call($methodName, array $arguments)
|
||||
{
|
||||
throw new Exception("Unknown method.");
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A
|
||||
{
|
||||
public function x()
|
||||
{
|
||||
parent::_x();
|
||||
call_user_func('parent::_x');
|
||||
call_user_func(['parent', '_x']);
|
||||
}
|
||||
}
|
||||
|
||||
$b = new B;
|
||||
$b->x();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
aaa
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78921: When Reflection triggers class load, property visibility is incorrect
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($className) {
|
||||
if ($className == 'PrivateStatic') {
|
||||
class PrivateStatic
|
||||
{
|
||||
const SOME_CONST = 13;
|
||||
private static $privateStaticVarArray = ['a', 'b', 'c'];
|
||||
private static $otherStatic;
|
||||
public static function init()
|
||||
{
|
||||
self::$otherStatic = self::$privateStaticVarArray;
|
||||
}
|
||||
}
|
||||
PrivateStatic::init();
|
||||
}
|
||||
});
|
||||
|
||||
class OtherClass
|
||||
{
|
||||
const MY_CONST = PrivateStatic::SOME_CONST;
|
||||
public static $prop = 'my property';
|
||||
}
|
||||
|
||||
$reflectionClass = new ReflectionClass('OtherClass');
|
||||
$reflectionProperty = $reflectionClass->getProperty('prop');
|
||||
$reflectionProperty->setAccessible(true);
|
||||
$value = $reflectionProperty->getValue();
|
||||
echo "Value is $value\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Value is my property
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78926: Segmentation fault on Symfony cache:clear
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($class) {
|
||||
for ($i = 0; $i < 100; $i++) {
|
||||
eval("class C$i {}");
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
class B extends A {}
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
var_dump(class_exists('B', false));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Class 'A' not found
|
||||
bool(false)
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78973: Destructor during CV freeing causes segfault if opline never saved
|
||||
--INI--
|
||||
opcache.optimization_level=0
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test($x) {
|
||||
}
|
||||
test(new class {
|
||||
public function __destruct() {
|
||||
debug_print_backtrace();
|
||||
}
|
||||
});
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 class@anonymous->__destruct() called at [%s:%d]
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78999 (Cycle leak when using function result as temporary)
|
||||
--FILE--
|
||||
<?php
|
||||
function get() {
|
||||
$t = new stdClass;
|
||||
$t->prop = $t;
|
||||
return $t;
|
||||
}
|
||||
var_dump(get());
|
||||
var_dump(gc_collect_cycles());
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (1) {
|
||||
["prop"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
int(1)
|
||||
@@ -1,39 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79022 (class_exists returns True for classes that are not ready to be used)
|
||||
--FILE--
|
||||
<?php
|
||||
function my_autoloader($class) {
|
||||
if (class_exists('Foo', 0)) {
|
||||
new Foo();
|
||||
}
|
||||
if ($class == 'Foo') {
|
||||
eval("class Foo extends Bar{}");
|
||||
}
|
||||
|
||||
if ($class == 'Bar') {
|
||||
eval("class Bar {}");
|
||||
}
|
||||
|
||||
if ($class == 'Dummy') {
|
||||
eval ("class Dummy implements iFoo {}");
|
||||
}
|
||||
|
||||
|
||||
if (interface_exists('iFoo', 0)) {
|
||||
new Dummy();
|
||||
}
|
||||
if ($class == 'iFoo') {
|
||||
eval ("interface iFoo extends iBar {}");
|
||||
}
|
||||
|
||||
if ($class == 'iBar') {
|
||||
eval ("interface iBar {}");
|
||||
}
|
||||
}
|
||||
spl_autoload_register('my_autoloader');
|
||||
new Foo();
|
||||
new Dummy();
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79155: Property nullability lost when using multiple property definition
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
public ?string $a, $b;
|
||||
public ?stdClass $c, $d;
|
||||
}
|
||||
|
||||
$t = new Foo;
|
||||
$t->a = "str";
|
||||
$t->b = "str";
|
||||
$t->c = new stdClass;
|
||||
$t->d = new stdClass;
|
||||
|
||||
var_dump($t->a, $t->b, $t->c, $t->d);
|
||||
|
||||
$t->a = null;
|
||||
$t->b = null;
|
||||
$t->c = null;
|
||||
$t->d = null;
|
||||
var_dump($t->a, $t->b, $t->c, $t->d);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "str"
|
||||
string(3) "str"
|
||||
object(stdClass)#2 (0) {
|
||||
}
|
||||
object(stdClass)#3 (0) {
|
||||
}
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
@@ -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"
|
||||
}
|
||||
Loaded 100 of 2207 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user