Compare commits

..
Author SHA1 Message Date
Sara Golemon f4f03ae115 Update versions for PHP 8.0.0beta2 2020-08-18 13:44:29 +00:00
3527 changed files with 180581 additions and 261957 deletions

No files matched your search

+3 -7
View File
@@ -1,7 +1,7 @@
git:
quiet: true
dist: bionic
dist: xenial
language: c
os: linux
addons:
@@ -70,16 +70,12 @@ jobs:
include:
- env: ENABLE_ZTS=0 ENABLE_DEBUG=0
arch: amd64
if: type = cron
- env: ENABLE_ZTS=1 ENABLE_DEBUG=1
arch: amd64
if: type = cron
- env: ENABLE_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 ARM64=1
arch: arm64
if: type = cron
- env: ENABLE_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 S390X=1
arch: s390x
if: type = cron
#- env: ENABLE_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 S390X=1
# arch: s390x
before_script:
- ccache --version
+1 -1
View File
@@ -293,7 +293,7 @@ SINCE: 7.4.0
-------------------------------------------------------------------------------
EXTENSION: fileinfo
PRIMARY MAINTAINER: Derick Rethans <derick@php.net> (2004 - 2008)
Anatol Belski <ab@php.net> (2012 - 2020)
Anatol Belski <ab@php.net> (2012 - 2019)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.3
+139 -312
View File
@@ -1,268 +1,147 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.0.2RC1
07 Jan 2021, PHP 8.0.1
17 Dec 2020, PHP 8.0.1RC1
- Core:
. Fixed bug #80345 (PHPIZE configuration has outdated PHP_RELEASE_VERSION).
(cmb)
. Fixed bug #72964 (White space not unfolded for CC/Bcc headers). (cmb)
. Fixed bug #80391 (Iterable not covariant to mixed). (Nikita)
. Fixed bug #80393 (Build of PHP extension fails due to configuration gap
with libtool). (kir dot morozov at gmail dot com)
. Fixed bug #77069 (stream filter loses final block of data). (cmb)
- Fileinfo:
. Fixed bug #77961 (finfo_open crafted magic parsing SIGABRT). (cmb)
- FPM:
. Fixed bug #69625 (FPM returns 200 status on request without
SCRIPT_FILENAME env). (Jakub Zelenka)
- IMAP
. Fixed bug #80438 (imap_msgno() incorrectly warns and return false on valid UIDs in PHP 8.0.0). (girgias)
. Fix a regression with valid UIDs in imap_savebody() (girgias)
. Make warnings for invalid message numbers/UIDs between functions consistent (girgias)
- Intl:
. Fixed bug #80425 (MessageFormatAdapter::getArgTypeList redefined). (Nikita)
- Opcache:
. Fixed bug #80404 (Incorrect range inference result when division results
in float). (Nikita)
. Fixed bug #80377 (Opcache misses executor_globals). (Nikita)
. Fixed bug #80433 (Unable to disable the use of the AVX command when using
JIT). (Nikita)
. Fixed bug #80447 (Strange out of memory error when running with JIT).
(Dmitry)
. Fixed bug #80480 (Segmentation fault with JIT enabled). (Dmitry)
. Fixed bug #80506 (Immediate SIGSEGV upon ini_set("opcache.jit_debug", 1)).
(Dmitry)
- OpenSSL:
. Fixed bug #80368 (OpenSSL extension fails to build against LibreSSL due to
lack of OCB support). (Nikita)
- PDO MySQL:
. Fixed bug #80458 (PDOStatement::fetchAll() throws for upsert queries).
(Kamil Tekiela)
. Fixed bug #63185 (nextRowset() ignores MySQL errors with native prepared
statements). (Nikita)
. Fixed bug #78152 (PDO::exec() - Bad error handling with multiple commands).
(Nikita)
. Fixed bug #66878 (Multiple rowsets not returned unless PDO statement object
is unset()). (Nikita)
. Fixed bug #70066 (Unexpected "Cannot execute queries while other unbuffered
queries"). (Nikita)
. Fixed bug #71145 (Multiple statements in init command triggers unbuffered
query error). (Nikita)
. Fixed bug #76815 (PDOStatement cannot be GCed/closeCursor-ed when a
PROCEDURE resultset SIGNAL). (Nikita)
. Fixed bug #79872 (Can't execute query with pending result sets). (Nikita)
. Fixed bug #79131 (PDO does not throw an exception when parameter values are
missing). (Nikita)
. Fixed bug #72368 (PdoStatement->execute() fails but does not throw an
exception). (Nikita)
. Fixed bug #62889 (LOAD DATA INFILE broken). (Nikita)
. Fixed bug #67004 (Executing PDOStatement::fetch() more than once prevents
releasing resultset). (Nikita)
. Fixed bug #79132 (PDO re-uses parameter values from earlier calls to
execute()). (Nikita)
- Phar:
. Fixed bug #73809 (Phar Zip parse crash - mmap fail). (cmb)
. Fixed bug #75102 (`PharData` says invalid checksum for valid tar). (cmb)
. Fixed bug #77322 (PharData::addEmptyDir('/') Possible integer overflow).
(cmb)
- Phpdbg:
. Fixed bug #76813 (Access violation near NULL on source operand). (cmb)
20 Aug 2020, PHP 8.0.0beta2
- SPL:
. Fixed #62004 (SplFileObject: fgets after seek returns wrong line). (cmb)
. Fixed bug #79987 (Memory leak in SplFileInfo because of missing
zend_restore_error_handling()). (Dmitry)
- Standard:
. Fixed bug #80366 (Return Value of zend_fstat() not Checked). (sagpant, cmb)
. Fixed bug #77423 (FILTER_VALIDATE_URL accepts URLs with invalid userinfo).
(CVE-2020-7071) (cmb)
- Tidy:
. Fixed bug #77594 (ob_tidyhandler is never reset). (cmb)
- Tokenizer:
. Fixed bug #80462 (Nullsafe operator tokenize with TOKEN_PARSE flag fails).
(Nikita)
- XML:
. XmlParser opaque object renamed to XMLParser for consistency with other XML objects. (girgias)
- Zlib:
. Fixed #48725 (Support for flushing in zlib stream). (cmb)
26 Nov 2020, PHP 8.0.0
- BZ2:
. Fixed bug #71263 (fread() does not report bzip2.decompress errors). (cmb)
- CLI:
. Allow debug server binding to an ephemeral port via `-S localhost:0`. (Sara)
- COM:
. Fixed bug #55847 (DOTNET .NET 4.0 GAC new location). (cmb)
. Fixed bug #62474 (com_event_sink crashes on certain arguments). (cmb)
- Calendar:
. Fixed bug #80007 (Potential type confusion in unixtojd() parameter parsing).
(Andy Postnikov)
06 Aug 2020, PHP 8.0.0beta1
- Core:
. Fixed bug #36365 (scandir duplicates file name at every 65535th file).
. Fixed bug #78236 (convert error on receiving variables when duplicate [).
(cmb)
. Fixed bug #49555 (Fatal error "Function must be a string" message should be
renamed). (Nikita)
. Fixed bug #62294 (register_shutdown_function() does not correctly handle
exit code). (Nikita)
. Fixed bug #62609 (Allow implementing Traversable on abstract classes).
. Fixed bug #79108 (Referencing argument in a function makes it a reference
in the stack trace). (Nikita)
. Fixed bug #79897 (Promoted constructor params with attribs cause crash).
(Deus Kane)
. Fixed bug #79946 (Build fails due to undeclared UINT32_C). (Nikita)
. Fixed bug #77561 (Shebang line not stripped for non-primary script).
(Nikita)
. Fixed bug #65274 (Enhance undefined class constant error with class name).
. Fixed bug #79948 (Exit in auto-prepended file does not abort PHP execution).
(Nikita)
. Fixed bug #65275 (Calling exit() in a shutdown function does not change the
exit value in CLI). (Nikita)
. Fixed bug #69084 (Unclear error message when not implementing a renamed
abstract trait function). (Nikita)
. Fixed bug #70839 (Converting optional argument to variadic forbidden by LSP
checks). (Nikita)
. Fixed bug #74558 (Can't rebind closure returned by Closure::fromCallable()).
(cmb)
. Fixed bug #77561 (Shebang line not stripped for non-primary script).
(Nikita)
. Fixed bug #77619 (Wrong reflection on MultipleIterator::__construct).
(Fabien Villepinte)
. Fixed bug #77966 (Cannot alias a method named "namespace"). (Nikita)
. Fixed bug #78236 (convert error on receiving variables when duplicate [).
(cmb)
. Fixed bug #62294 (register_shutdown_function() does not correctly handle
exit code). (Nikita)
. Fixed bug #79927 (Generator doesn't throw exception after multiple yield
from iterable). (Nikita)
. Fixed bug #78770 (Incorrect callability check inside internal methods).
(Nikita)
. Fixed bug #79108 (Referencing argument in a function makes it a reference
in the stack trace). (Nikita)
. Fixed bug #79368 ("Unexpected end of file" is not an acceptable error
message). (Alex Dowad)
. Fixed bug #79462 (method_exists and property_exists incoherent behavior).
(cmb)
. Fixed bug #79467 (data:// wrappers are writable). (cmb)
. Fixed bug #79521 (Check __set_state structure). (carusogabriel)
- Date:
. Fixed bug #60302 (DateTime::createFromFormat should new static(), not new
self()). (Derick)
. Implemented FR #79903 (datetime: new format "p", same as "P" but returning
"Z" for UTC). (gharlan)
- JIT:
. Fixed bug #79864 (JIT segfault in Symfony OptionsResolver). (Dmitry)
. Fixed bug #79888 (Incorrect execution with JIT enabled). (Dmitry)
- LDAP:
. Fixed memory leaks. (ptomulik)
- OCI8:
. Modernized oci_register_taf_callback() callable argument parsing
implementation. (girgias)
23 Jul 2020, PHP 8.0.0alpha3
- Core:
. Fixed bug #79790 ("Illegal offset type" exception during AST evaluation
not handled properly). (Nikita)
. Fixed bug #79791 (Assertion failure when unsetting variable during binary
op). (Nikita)
. Fixed bug #79828 (Segfault when trying to access non-existing variable).
(Nikita)
. Fixed bug #79841 (Syntax error in configure / unescaped "[]" in php.m4).
(Nikita)
. Fixed bug #79828 (Segfault when trying to access non-existing variable).
(Nikita)
. Fixed bug #79852 (count(DOMNodeList) doesn't match
count(IteratorIterator(DOMNodeList))). (Nikita)
. Fixed bug #79867 (Promoted untyped properties should get null default
value). (Nikita)
. Fixed bug #79897 (Promoted constructor params with attribs cause crash).
(Deus Kane)
. Fixed bug #79927 (Generator doesn't throw exception after multiple yield
from iterable). (Nikita)
. Fixed bug #79946 (Build fails due to undeclared UINT32_C). (Nikita)
. Fixed bug #79948 (Exit in auto-prepended file does not abort PHP execution).
- Standard:
. Fixed bug #79868 (Sorting with array_unique gives unwanted result). (Nikita)
09 Jul 2020, PHP 8.0.0alpha2
- FFI:
. Fixed bug #79749 (Converting FFI instances to bool fails). (cmb)
- JIT:
. Fixed bug #79743 (Fatal error when assigning to array property
with JIT enabled). (Laruence)
- PCRE:
. Updated to PCRE2 10.35. (cmb)
25 Jun 2020, PHP 8.0.0alpha1
- Core:
. Removed the pdo_odbc.db2_instance_name php.ini directive. (Kalle)
. Fixed bug #77619 (Wrong reflection on MultipleIterator::__construct).
(Fabien Villepinte)
. Fixed bug #65274 (Enhance undefined class constant error with class name).
(Nikita)
. Fixed bug #80045 (memleak after two set_exception_handler calls with
__call). (Nikita)
. Fixed bug #80096 (Segmentation fault with named arguments in nested call).
. Fixed bug #49555 (Fatal error "Function must be a string" message should be
renamed). (Nikita)
. Fixed bug #70839 (Converting optional argument to variadic forbidden by LSP
checks). (Nikita)
. Fixed bug #69084 (Unclear error message when not implementing a renamed
abstract trait function). (Nikita)
. Fixed bug #62609 (Allow implementing Traversable on abstract classes).
(Nikita)
. Fixed bug #80109 (Cannot skip arguments when extended debug is enabled).
(Nikita)
. Fixed bug #80225 (broken namespace usage in eval code). (Nikita)
. Fixed bug #80258 (Windows Deduplication Enabled, randon permission errors).
. Fixed bug #79462 (method_exists and property_exists incoherent behavior).
(cmb)
. Fixed bug #80280 (ADD_EXTENSION_DEP() fails for ext/standard and ext/date).
. Fixed bug #79368 ("Unexpected end of file" is not an acceptable error
message). (Alex Dowad)
. Fixed bug #36365 (scandir duplicates file name at every 65535th file).
(cmb)
. Fixed bug #80334 (assert() vs named parameters - confusing error). (Nikita)
. Fixed bug #80055 (Abstract trait methods returning "self" cannot be
fulfilled by traits). (Nikita)
. Fixed faulty generator cleanup with yield from. (Bob)
. Implement #[Attr] Attribute syntax as per final vote in RFC
https://wiki.php.net/rfc/shorter_attribute_syntax_change
. Use SSE2 instructions do locale independent strtolower. (Laruence)
. Fixed bug #79521 (Check __set_state structure). (carusogabriel)
. Fixed bug #79467 (data:// wrappers are writable). (cmb)
. Implemented FR #47074 (phpinfo() reports "On" as 1 for the some
extensions). (cmb)
. Implemented FR #72089 (require() throws fatal error instead of exception).
(Nikita)
. Removed the pdo_odbc.db2_instance_name php.ini directive. (Kalle)
. Use SSE2 instructions do locale independent strtolower. (Laruence)
. Fixed bug #77966 (Cannot alias a method named "namespace"). (Nikita)
- Curl:
- BZ2:
. Fixed bug #71263 (fread() does not report bzip2.decompress errors). (cmb)
- CURL:
. Bumped required libcurl version to 7.29.0. (cmb)
. Fixed bug #80121 (Null pointer deref if CurlHandle directly instantiated).
(Nikita)
- Date:
. Fixed bug #65547 (Default value for sunrise/sunset zenith still wrong).
(cmb)
. Fixed bug #69044 (discrepancy between time and microtime). (krakjoe)
- DOM:
. Add property DOMXPath::$registerNodeNamespaces and constructor argument
that allow global flag to configure query() or evaluate() calls.
. Fixed bug #79968 (DOMChildNode API crash on unattached nodes). (Benjamin)
. Fixed bug #80268 (loadHTML() truncates at NUL bytes). (cmb)
- Date:
. Fixed bug #60302 (DateTime::createFromFormat should new static(), not new
self()). (Derick)
. Fixed bug #65547 (Default value for sunrise/sunset zenith still wrong).
(cmb)
. Fixed bug #69044 (discrepancy between time and microtime). (krakjoe)
. Fixed bug #80057 (DateTimeImmutable::createFromFormat() does not populate
time). (Derick)
. Implemented FR #79903 (datetime: new format "p", same as "P" but returning
"Z" for UTC). (gharlan)
- Enchant:
. Add LIBENCHANT_VERSION macro.
. Add enchant_dict_add and enchant_dict_is_added functions.
. Deprecate enchant_broker_set_dict_path, enchant_broker_get_dict_path,
enchant_dict_add_to_personal and enchant_dict_is_in_session.
. Add enchant_dict_add and enchant_dict_is_added functions.
. Use libenchant-2 when available.
- FFI:
. Added FFI\CType::getName() method. (chopins)
. Fixed bug #79177 (FFI doesn't handle well PHP exceptions within callback).
(cmb, Dmitry, Nikita)
. Fixed bug #79749 (Converting FFI instances to bool fails). (cmb)
- FPM:
. Fixed bug #64865 (Search for .user.ini files from script dir up to
CONTEXT_DOCUMENT_ROOT). (Will Bender)
. Add pm.status_listen option. (Jakub Zelenka)
- Fileinfo:
. Upgrade to libmagic 5.39. (Anatol)
- GD:
. Added imagegetinterpolation(). (cmb)
. Fixed bug #55005 (imagepolygon num_points requirement). (cmb)
. Replaced gd resources with objects. (Mark Randall)
. Made the $num_points parameter of php_imagepolygon optional. (cmb)
. Removed deprecated image2wbmp(). (cmb)
. Removed deprecated png2wbmp() and jpeg2wbmp(). (cmb)
. Replaced gd resources with objects. (Mark Randall)
- IMAP:
. Fixed bug #64076 (imap_sort() does not return FALSE on failure). (cmb)
. Fixed bug #76618 (segfault on imap_reopen). (girgias)
. Fixed bug #80213 (imap_mail_compose() segfaults on certain $bodies). (cmb)
. Fixed bug #80215 (imap_mail_compose() may modify by-val parameters). (cmb)
. Fixed bug #80216 (imap_mail_compose() does not validate types/encodings).
(cmb)
. Fixed bug #80220 (imap_mail_compose() may leak memory). (cmb)
. Fixed bug #80223 (imap_mail_compose() leaks envelope on malformed bodies).
(cmb)
. Fixed bug #80226 (imap_sort() leaks sortpgm memory). (cmb)
. Fixed bug #80239 (imap_rfc822_write_address() leaks memory). (cmb)
. Fixed bug #80242 (imap_mail_compose() segfaults for multipart with rfc822).
(cmb)
. Fixed minor regression caused by fixing bug #80220. (cmb)
. Added imagegetinterpolation(). (cmb)
- Iconv:
. Dropped support for iconv without proper errno setting. (cmb)
@@ -271,22 +150,17 @@ PHP NEWS
. Removed deprecated INTL_IDNA_VARIANT_2003. (cmb)
- JIT:
. Fixed bug #79582 (Crash seen when opcache.jit=1235 and
opcache.jit_debug=2). (Laruence)
. Fixed bug #77857 (Wrong result if executed with JIT). (Laruence)
. Fixed bug #79255 (PHP cannot be compiled with enable JIT).
(Laruence, Dmitry)
. Fixed bug #79582 (Crash seen when opcache.jit=1235 and
opcache.jit_debug=2). (Laruence)
. Fixed bug #79743 (Fatal error when assigning to array property
with JIT enabled). (Laruence)
. Fixed bug #79864 (JIT segfault in Symfony OptionsResolver). (Dmitry)
. Fixed bug #79888 (Incorrect execution with JIT enabled). (Dmitry)
- JSON:
. The JSON extension is now an integral part of PHP and cannot be disabled
as per RFC: https://wiki.php.net/rfc/always_enable_json (tandre)
- LDAP:
. Fixed memory leaks. (ptomulik)
. Removed deprecated ldap_sort. (mcmic)
- MBString:
@@ -297,48 +171,34 @@ PHP NEWS
. Fixed bug #76809 (SSL settings aren't respected when persistent connections
are used). (fabiomsouto)
- Mysqlnd:
- mysqlnd:
. Fixed #60594 (mysqlnd exposes 160 lines of stats in phpinfo). (PeeHaa)
- OCI8:
. Deprecated old OCI8 function aliases. (Jens de Nies)
. Modernized oci_register_taf_callback() callable argument parsing
implementation. (girgias)
. Removed obsolete no-op function oci_internal_debug(). (Jens de Nies)
- ODBC:
. Fixed bug #22986 (odbc_connect() may reuse persistent connection). (cmb)
. Fixed bug #44618 (Fetching may rely on uninitialized data). (cmb)
- Opcache:
. Fixed bug #76535 (Opcache does not replay compile-time warnings). (Nikita)
- OpCache:
. Fixed bug #78654 (Incorrectly computed opcache checksum on files with
non-ascii characters). (mhagstrand)
. Fixed bug #76535 (Opcache does not replay compile-time warnings). (Nikita)
. Fixed bug #79665 (ini_get() and opcache_get_configuration() inconsistency).
(cmb)
. Fixed bug #80030 (Optimizer segfault with isset on static property with
undef dynamic class name). (Nikita)
. Fixed bug #80175 (PHP8 RC1 - JIT Buffer not working). (cmb)
. Fixed bug #80184 (Complex expression in while / if statements resolves to
false incorrectly). (Nikita)
. Fixed bug #80255 (Opcache bug (bad condition result) in 8.0.0rc1). (Nikita)
. Fixed run-time binding of preloaded dynamically declared function. (Dmitry)
- OpenSSL:
. Added Cryptographic Message Syntax (CMS) support. (Eliot Lear)
- PCRE:
. Don't ignore invalid escape sequences. (sjon)
. Updated to PCRE2 10.35. (cmb)
- PGSQL:
. Bumped required libpq version to 9.1. (cmb)
- PDO:
. Changed default PDO error mode to exceptions. (AllenJB)
. Fixed bug #77849 (Disable cloning of PDO handle/connection objects).
(camporter)
- PDO_Firebird:
. Fixed bug #64937 (Firebird PDO preprocessing sql). (Simonov Denis)
- PDO_OCI:
. Added support for setting and getting the oracle OCI 18c call timeout.
(camporter)
@@ -346,10 +206,7 @@ PHP NEWS
- PDO_PGSQL:
. Bumped required libpq version to 9.1. (cmb)
- PGSQL:
. Bumped required libpq version to 9.1. (cmb)
- Phpdbg:
- phpdbg:
. Fixed bug #76596 (phpdbg support for display_errors=stderr). (kabel)
. Fixed bug #76801 (too many open files). (alekitto)
. Fixed bug #77800 (phpdbg segfaults on listing some conditional breakpoints).
@@ -357,90 +214,62 @@ PHP NEWS
. Fixed bug #77805 (phpdbg build fails when readline is shared). (krakjoe)
- Reflection:
. Fixed bug #78697 (ReflectionClass::implementsInterface - inaccurate error
message with traits). (villfa)
. Implement ReflectionProperty::hasDefaultValue and
Reflection::getDefaultValue (beberlei)
. Fixed bug #64592 (ReflectionClass::getMethods() returns methods out of
scope). (Nikita)
. Fixed bug #77325 (ReflectionClassConstant::$class returns wrong class when
extending). (Nikita)
. Fixed bug #69180 (Reflection does not honor trait conflict resolution /
method aliasing). (Nikita)
. Fixed bug #74939 (Nested traits' aliased methods are lowercased). (Nikita)
. Fixed bug #77325 (ReflectionClassConstant::$class returns wrong class when
extending). (Nikita)
. Fixed bug #78697 (ReflectionClass::implementsInterface - inaccurate error
message with traits). (villfa)
. Fixed bug #80190 (ReflectionMethod::getReturnType() does not handle static
as part of union type). (Nikita)
. Fixed bug #80299 (ReflectionFunction->invokeArgs confused in arguments).
(Nikita)
. Fixed bug #80370 (getAttributes segfault on dynamic properties). (Benjamin
Eberlei)
. Implement #79628 (Add $filter parameter for ReflectionClass::getConstants
and ReflectionClass::getReflectionConstants) (carusogabriel)
. Implement ReflectionProperty::hasDefaultValue and
Reflection::getDefaultValue (beberlei)
- SNMP:
. Fixed bug #70461 (disable md5 code when it is not supported in net-snmp).
(Alexander Bergmann, cmb)
- SPL:
. Fixed bug #65006 (spl_autoload_register fails with multiple callables using
self, same method). (Nikita)
. Fixed bug #65387 (Circular references in SPL iterators are not garbage
collected). (Nikita)
. Fixed bug #71236 (Second call of spl_autoload_register() does nothing if it
has no arguments). (Nikita)
. Fixed bug #79987 (Memory leak in SplFileInfo because of missing
zend_restore_error_handling()). (Dmitry)
. SplFixedArray is now IteratorAggregate rather than Iterator. (alexdowad)
- SQLite3:
. Added SQLite3::setAuthorizer() and respective class constants. (bohwaz)
- Session:
. Fixed bug #73529 (session_decode() silently fails on wrong input). (cmb)
. Fixed bug #78624 (session_gc return value for user defined session
handlers). (bshaffer)
. Fixed bug #73529 (session_decode() silently fails on wrong input). (cmb)
- Shmop:
. Converted shmop resources to objects. (cmb)
- SimpleXML:
. Fixed bug #63575 (Root elements are not properly cloned). (cmb)
. Fixed bug #75245 (Don't set content of elements with only whitespaces).
(eriklundin)
. Fixed bug #63575 (Root elements are not properly cloned). (cmb)
- Sodium:
- sodium:
. Fixed bug #77646 (sign_detached() strings not terminated). (Frank)
- SQLite3:
. Added SQLite3::setAuthorizer() and respective class constants. (bohwaz)
- SPL:
. Fixed bug #71236 (Second call of spl_autoload_register() does nothing if it
has no arguments). (Nikita)
. Fixed bug #65006 (spl_autoload_register fails with multiple callables using
self, same method). (Nikita)
- Standard:
. Don't force rebuild of symbol table, when populating $http_response_header
variable by the HTTP stream wrapper. (Dmitry)
. Fixed bug #47983 (mixed LF and CRLF line endings in mail()). (cmb)
. Fixed bug #64060 (lstat_stat_variation7.phpt fails on certain file systems).
(M. Voelker, cmb)
. Fixed bug #75902 (str_replace should warn when misused with nested arrays).
(Nikita)
. Fixed bug #76859 (stream_get_line skips data if used with data-generating
filter). (kkopachev)
. Implemented FR #78638 (__PHP_Incomplete_Class should be final). (Laruence)
. Fixed bug #77204 (getimagesize(): Read error! should mention file path).
(peter279k)
. Fixed bug #76859 (stream_get_line skips data if used with data-generating
filter). (kkopachev)
. Fixed bug #78385 (parse_url() does not include 'query' when question mark
is the last char). (Islam Israfilov)
. Fixed bug #79868 (Sorting with array_unique gives unwanted result). (Nikita)
. Fixed bug #80256 (file_get_contents strip first line with chunked encoding
redirect). (Nikita)
. Fixed bug #80266 (parse_url silently drops port number 0). (cmb, Nikita)
. Fixed bug #80290 (Double free when ASSERT_CALLBACK is used with a dynamic
message). (Nikita)
. Implemented FR #78638 (__PHP_Incomplete_Class should be final). (Laruence)
. Fixed bug #75902 (str_replace should warn when misused with nested arrays).
(Nikita)
. Fixed bug #47983 (mixed LF and CRLF line endings in mail()). (cmb)
. Made quoting of cmd execution functions consistent. (cmb)
- Tidy:
- tidy:
. Removed the unused $use_include_path parameter from tidy_repair_string().
(cmb)
- Tokenizer:
. Fixed bug #80328 (PhpToken::getAll() confusing name). (Nikita)
- XML:
. Fixed bug #76874 (xml_parser_free() should never leak memory). (Nikita)
@@ -449,32 +278,30 @@ PHP NEWS
(cmb)
. Implemented FR #79344 (xmlwriter_write_attribute_ns: $prefix should be
nullable). (cmb)
. Removed return types from XMLWriter stubs. (cmb)
- Zip:
. Add "flags" options to ZipArchive::addGlob and addPattern methods
keeping previous behavior having FL_OVERWRITE by default. (Remi)
. Add ZipArchive::EM_UNKNOWN and ZipArchive::EM_TRAD_PKWARE constants. (Remi)
. Add ZipArchive::isCompressionMethodSupported() and
ZipArchive::isEncryptionMethodSupported() method (libzip 1.7.0). (Remi)
. Add ZipArchive::replaceFile() method. (Remi)
. Add ZipArchive::setCancelCallback method (since libzip 1.6.0). (Remi)
. Fixed bug #72374 (remove_path strips first char of filename). (tyage, Remi)
. Add ZipArchive::setMtimeName and ZipArchive::setMtimeIndex methods. (Remi)
. Add ZipArchive::setProgressCallback method (since libzip 1.3.0). (Remi)
. Add lastId property to ZipArchive. (Remi)
. Add ZipArchive::setCancelCallback method (since libzip 1.6.0). (Remi)
. Add optional "flags" parameter to ZipArchive::addEmptyDir, addFile and
addFromString methods. (Remi)
. Fixed bug #50678 (files extracted by ZipArchive class lost their
original modified time). (Remi)
. Fixed bug #72374 (remove_path strips first char of filename). (tyage, Remi)
. Implemented FR #77960 (add compression / encryption options for
ZipArchive::addGlob and ZipArchive::addPattern). (Remi)
. Add "flags" options to ZipArchive::addGlob and addPattern methods
keeping previous behavior having FL_OVERWRITE by default. (Remi)
. Add ZipArchive::replaceFile() method. (Remi)
. Add lastId property to ZipArchive. (Remi)
. ZipArchive::status and ZipArchive::statusSys properties and
ZipArchive::getStatusString() method stay valid after the archive
is closed. (Remi)
. Fixed bug #50678 (files extracted by ZipArchive class lost their
original modified time). (Remi)
. Implemented FR #77960 (add compression / encryption options for
ZipArchive::addGlob and ZipArchive::addPattern). (Remi)
. Add ZipArchive::EM_UNKNOWN and ZipArchive::EM_TRAD_PKWARE constants. (Remi)
. Add ZipArchive::isCompressionMethodSupported() and
ZipArchive::isEncryptionMethodSupported() method (libzip 1.7.0). (Remi)
- Zlib:
. Fixed bug #71417 (fread() does not report zlib.inflate errors). (cmb)
. Fixed bug #78792 (zlib.output_compression disabled by Content-Type: image/).
(cmb)
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
+23 -102
View File
@@ -27,9 +27,6 @@ PHP 8.0 UPGRADE NOTES
. Methods with the same name as the class are no longer interpreted as
constructors. The __construct() method should be used instead.
. Removed ability to call non-static methods statically.
Thus `is_callable` will fail when checking for a non-static method with a
classname (must check with an object instance).
. Removed (real) cast.
. Removed (unset) cast.
. Removed track_errors ini directive. This means that $php_errormsg is no
longer available. The error_get_last() function may be used instead.
@@ -84,10 +81,10 @@ PHP 8.0 UPGRADE NOTES
Additionally, care should be taken that error messages are not displayed in
production environments, which can result in information leaks. Please
ensure that display_errors=Off is used in conjunction with error logging.
. Following the hash comment operator # immediately with an opening bracket
is not supported as a comment anymore since this syntax is now used for
attributes.
RFC: https://wiki.php.net/rfc/shorter_attribute_syntax_change
. Adding more than one @ operator to an expression is no longer supported,
since this syntax is now used for attributes (previously extra @ operators
had no effect).
RFC: https://wiki.php.net/rfc/shorter_attribute_syntax
. Inheritance errors due to incompatible method signatures (LSP violations)
will now always generate a fatal error. Previously a warning was generated
in some cases.
@@ -138,10 +135,10 @@ PHP 8.0 UPGRADE NOTES
. Uncaught exceptions now go through "clean shutdown", which means that
destructors will be called after an uncaught exception.
. Compile time fatal error "Only variables can be passed by reference" has
been delayed until runtime and converted to "Argument cannot be passed by
been delayed until runtime and converted to "Cannot pass parameter by
reference" exception.
. Some "Only variables should be passed by reference" notices have been
converted to "Argument cannot be passed by reference" exception.
converted to "Cannot pass parameter by reference" exception.
. The generated name for anonymous classes has changed. It will now include
the name of the first parent or interface:
@@ -152,7 +149,7 @@ PHP 8.0 UPGRADE NOTES
new class {};
// -> class@anonymous
The name shown above is still followed by a null byte and a unique
The name shown above is still followed by a null byte and and a unique
suffix.
. Non-absolute trait method references in trait alias adaptations are now
required to be unambiguous:
@@ -165,7 +162,7 @@ PHP 8.0 UPGRADE NOTES
}
If both T1::func() and T2::func() exist, this code was previously silently
accepted, and func was assumed to refer to T1::func. Now it will generate a
accepted, and func as assumed to refer to T1::func. Now it will generate a
fatal error instead, and either T1::func or T2::func needs to be written
explicitly.
. The signature of abstract methods defined in traits is now checked against
@@ -257,8 +254,6 @@ PHP 8.0 UPGRADE NOTES
__wakeup(): void
RFC: https://wiki.php.net/rfc/magic-methods-signature
. call_user_func_array() array keys will now be interpreted as parameter names,
instead of being silently ignored.
- COM:
. Removed the ability to import case-insensitive constants from type
@@ -312,12 +307,9 @@ PHP 8.0 UPGRADE NOTES
warning.
- GD:
. The GD extension now uses a GdImage objects as the underlying data structure
for images, rather than resources. These objects are completely opaque, i.e.
they don't have any methods. Return value checks using is_resource() should
be replaced with checks for `false`. The imagedestroy() function no longer
has an effect, instead the GdImage instance is automatically destroyed if
it is no longer referenced.
. The GD extension now uses objects as the underlying data structure for
images, rather than resources. These objects are completely opaque, i.e.
they don't have any methods.
. The deprecated function image2wbmp() has been removed.
RFC: https://wiki.php.net/rfc/image2wbmp
. The deprecated functions png2wbmp() and jpeg2wbmp() have been removed.
@@ -333,10 +325,6 @@ PHP 8.0 UPGRADE NOTES
. iconv() implementations which do not properly set errno in case of errors
are no longer supported.
- IMAP:
. The unused default_host argument of imap_headerinfo() has been removed.
. The imap_header() function which is an alias of imap_headerinfo() has been removed.
- Intl:
. The deprecated constant INTL_IDNA_VARIANT_2003 has been removed.
RFC: https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003
@@ -347,8 +335,6 @@ PHP 8.0 UPGRADE NOTES
- LDAP:
. The deprecated function ldap_sort has been removed.
. The deprecated function ldap_control_paged_result has been removed.
. The deprecated function ldap_control_paged_result_response has been removed.
. The interface of ldap_set_rebind_proc has changed; the $callback parameter
does not accept empty string anymore; null value shall be used instead.
@@ -393,21 +379,11 @@ PHP 8.0 UPGRADE NOTES
aliases for better interoperability with the iconv extension. The mbregex
ISO 8859 aliases with underscores (ISO_8859_* and ISO8859_*) have also been
removed.
. mb_ereg() and mb_eregi() will now return boolean true on a successful
match. Previously they returned integer 1 if $matches was not passed, or
max(1, strlen($reg[0])) is $matches was passed.
- OCI8:
. The OCI-Lob class is now called OCILob, and the OCI-Collection class is now
called OCICollection for name compliance enforced by PHP 8 arginfo
type annotation tooling.
. Several alias functions have been marked as deprecated.
. oci_internal_debug() and its alias ociinternaldebug() have been removed.
- ODBC:
. odbc_connect() no longer reuses persistent connections.
. The unused flags parameter of odbc_exec() has been removed.
- OpenSSL:
. openssl_x509_read() and openssl_csr_sign() will now return an
OpenSSLCertificate object rather than a resource. Return value checks using
@@ -424,8 +400,6 @@ PHP 8.0 UPGRADE NOTES
. The openssl_pkey_free() function is deprecated and no longer has an effect,
instead the OpenSSLAsymmetricKey instance is automatically destroyed if it is no
longer referenced.
. openssl_seal() and openssl_open() now require $method to be passed, as the
previous default of "RC4" is considered insecure.
- PCRE:
. When passing invalid escape sequences they are no longer interpreted as
@@ -443,24 +417,9 @@ PHP 8.0 UPGRADE NOTES
string $statement, ?int $fetch_mode = null, ...$fetch_mode_args)
PDOStatement::setFetchMode(int $mode, ...$params)
- PDO MySQL:
. PDO::inTransaction() now reports the actual transaction state of the
connection, rather than an approximation maintained by PDO. If a query that
is subject to "implicit commit" is executed, PDO::inTransaction() will
subsequently return false, as a transaction is no longer active.
- PDO_ODBC:
. The php.ini directive pdo_odbc.db2_instance_name has been removed
- pgsql:
. The deprecated pg_connect() syntax using multiple parameters instead of a
connection string is no longer supported.
. The deprecated pg_lo_import() and pg_lo_export() signature that passes the
connection as the last argument is no longer supported. The connection
should be passed as first argument instead.
. pg_fetch_all() will now return an empty array instead of false for result
sets with zero rows.
- Phar:
. Metadata associated with a phar will no longer be automatically unserialized,
to fix potential security vulnerabilities due to object instantiation, autoloading, etc.
@@ -516,8 +475,6 @@ PHP 8.0 UPGRADE NOTES
- SPL:
. SplFileObject::fgetss() has been removed.
. SplFileObject::seek() now always seeks to the beginning of the line.
Previously, positions >=1 sought to the beginning of the next line.
. SplHeap::compare($a, $b) now specifies a method signature. Inheriting
classes implementing this method will now have to use a compatible
method signature.
@@ -527,12 +484,6 @@ PHP 8.0 UPGRADE NOTES
. spl_autoload_register() will now always throw a TypeError on invalid
arguments, therefore the second argument $do_throw is ignored and a
notice will be emitted if it is set to false.
. SplFixedArray is now an IteratorAggregate and not an Iterator.
SplFixedArray::rewind(), ::current(), ::key(), ::next(), and ::valid()
have been removed. In their place, SplFixedArray::getIterator() has been
added. Any code which uses explicit iteration over SplFixedArray must now
obtain an Iterator through SplFixedArray::getIterator(). This means that
SplFixedArray is now safe to use in nested loops.
- Standard:
. assert() will no longer evaluate string arguments, instead they will be
@@ -569,7 +520,7 @@ PHP 8.0 UPGRADE NOTES
. money_format() has been removed.
. ezmlm_hash() has been removed.
. restore_include_path() has been removed.
. get_magic_quotes_gpc() and get_magic_quotes_runtime() has been removed.
. get_magic_quotes_gpc() and get_magic_quotes_gpc_runtime() has been removed.
. FILTER_SANITIZE_MAGIC_QUOTES has been removed.
. Calling implode() with parameters in a reverse order ($pieces, $glue) is no
longer supported.
@@ -597,7 +548,7 @@ PHP 8.0 UPGRADE NOTES
. Removed deprecated DES fallback in crypt(). If an unknown salt format is
passed to crypt(), the function will fail with *0 instead of falling back
to a weak DES hash now.
. Specifying out of range rounds for sha256/sha512 crypt() will now fail with
. Specifying out of range rounds for sha256/sha526 crypt() will now fail with
*0 instead of clamping to the closest limit. This matches glibc behavior.
. The result of sorting functions may have changed, if the array contains
elements that compare as equal.
@@ -622,14 +573,6 @@ PHP 8.0 UPGRADE NOTES
$ctx = stream_context_create(['http' => ['protocol_version' => '1.0']]);
echo file_get_contents('http://example.org', false, $ctx);
. Calling crypt() without an explicit salt is no longer supported. If you
would like to produce a strong hash with an auto-generated salt, use
password_hash() instead.
. substr(), mb_substr(), iconv_substr() and grapheme_substr() now consistently
clamp out-of-bounds offsets to the string boundary. Previously, false was
returned instead of the empty string in some cases.
. Populating $http_response_header variable by the HTTP stream wrapper
doesn't force rebuilding of symbol table anymore.
- Sysvmsg:
. msg_get_queue() will now return an SysvMessageQueue object rather than a
@@ -640,8 +583,6 @@ PHP 8.0 UPGRADE NOTES
. sem_get() will now return an SysvSemaphore object rather than a resource.
Return value checks using is_resource() should be replaced with checks
for `false`.
. The $auto_release parameter of sem_get() was changed to accept bool values
rather than int.
- Sysvshm:
. shm_attach() will now return an SysvSharedMemory object rather than a resource.
@@ -651,7 +592,6 @@ PHP 8.0 UPGRADE NOTES
- tidy:
. The $use_include_path parameter, which was not used internally, has been
removed from tidy_repair_string().
. tidy::repairString() and tidy::repairFile() became static methods
- Tokenizer:
. T_COMMENT tokens will no longer include a trailing newline. The newline will
@@ -665,17 +605,12 @@ PHP 8.0 UPGRADE NOTES
RFC: https://wiki.php.net/rfc/namespaced_names_as_token
- XML:
. xml_parser_create(_ns) will now return an XMLParser object rather than a
. xml_parser_create(_ns) will now return an XmlParser object rather than a
resource. Return value checks using is_resource() should be replaced with
checks for `false`. The xml_parser_free() function no longer has an effect,
instead the XMLParser instance is automatically destroyed if it is no longer
instead the XmlParser instance is automatically destroyed if it is no longer
referenced.
- XMLReader:
. XMLReader::open() and XMLReader::xml() are now static methods. They still
can be called dynamically, though, but inheriting classes need to declare
them as static if they override these methods.
- XMLWriter:
. The XMLWriter functions now accept and return, respectively, XMLWriter
objects instead of resources.
@@ -692,8 +627,6 @@ PHP 8.0 UPGRADE NOTES
. deflate_init() will now return a DeflateContext object rather than a
resource. Return value checks using is_resource() should be replaced with
checks for `false`.
. zlib.output_compression is no longer automatically disabled for
Content-Type: image/*.
========================================
2. New Features
@@ -751,7 +684,6 @@ PHP 8.0 UPGRADE NOTES
RFC: https://wiki.php.net/rfc/attributes_v2
RFC: https://wiki.php.net/rfc/attribute_amendments
RFC: https://wiki.php.net/rfc/shorter_attribute_syntax
RFC: https://wiki.php.net/rfc/shorter_attribute_syntax_change
. Added support for constructor property promotion (declaring properties in
the constructor signature).
RFC: https://wiki.php.net/rfc/constructor_promotion
@@ -830,19 +762,9 @@ PHP 8.0 UPGRADE NOTES
. Sorting functions are now stable, which means that equal-comparing elements
will retain their original order.
RFC: https://wiki.php.net/rfc/stable_sorting
. array_diff(), array_intersect() and their variations can now be used with
a single array as argument. This means that usages like the following are
now possible:
// OK even if $excludes is empty.
array_diff($array, ...$excludes);
// OK even if $arrays only contains a single array.
array_intersect(...$arrays);
. The $flag parameter of ob_implicit_flush() was changed to accept bool
values rather than int.
- Zip:
. Extension updated to version 1.19.1
. Extension updated to version 1.19.0
. New ZipArchive::lastId property to get index value of last added entry.
. Error can be checked after an archive is closed using ZipArchive::status,
ZipArchive::statusSys properties or ZipArchive::getStatusString() method.
@@ -858,6 +780,10 @@ PHP 8.0 UPGRADE NOTES
- Apache:
. The PHP module has been renamed from php7_module to php_module.
- CGI and FPM will now use CONTEXT_DOCUMENT_ROOT to scan for .user.ini files,
if it is defined. Otherwise, DOCUMENT_ROOT will be used as before. This
improves support for Apache mod_userdir and mod_alias.
========================================
4. Deprecated Functionality
========================================
@@ -890,7 +816,6 @@ PHP 8.0 UPGRADE NOTES
- PGSQL / PDO PGSQL:
. The constant PG_VERSION_STR has now the same value as PG_VERSION, and thus
is deprecated.
. Function aliases in the pgsql extension have been deprecated.
- Zip:
. Using empty file as ZipArchive is deprecated. Libzip 1.6.0
@@ -990,8 +915,8 @@ PHP 8.0 UPGRADE NOTES
- Zip:
. ZipArchive::setMtimeName and ZipArchive::setMtimeIndex to set the
modification time of an entry.
. ZipArchive::registerProgressCallback to provide updates during archive close.
. ZipArchive::registerCancelCallback to allow cancellation during archive close.
. ZipArchive::setProgressCallback to provide updates during archive close.
. ZipArchive::setCancelCallback to allow cancellation during archive close.
. ZipArchive::replaceFile to replace an entry content.
. ZipArchive::isCompressionMethodSupported to check optional compression
features.
@@ -1080,7 +1005,7 @@ PHP 8.0 UPGRADE NOTES
- MySQLi / PDO MySQL:
. When mysqlnd is not used (which is the default and recommended option),
the minimum supported libmysqlclient version is now 5.5.
the minimum supported libmysqlclient version is now 5.1.
. mysqli_result now implements IteratorAggregate (instead of Traversable).
- PGSQL / PDO PGSQL:
@@ -1120,10 +1045,6 @@ PHP 8.0 UPGRADE NOTES
. New INI directive to set the maximum string length in an argument of a
stringified stack strace.
- com.dotnet_version
. New INI directive to choose the version of the .NET framework to use for
dotnet objects.
========================================
12. Windows Support
========================================
+6 -222
View File
@@ -22,9 +22,6 @@ PHP 8.0 INTERNALS UPGRADE NOTES
s. zend_fcall_info no_separation flag removed
t. Signature changes
u. Error Notification callbacks to replace zend_error_cb overwrite use-cases
v. Removed Zend APIs
w. Renamed Zend APIs
x. ZEND_EXT_NOP no longer emitted
2. Build system changes
a. Abstract
@@ -160,28 +157,6 @@ PHP 8.0 INTERNALS UPGRADE NOTES
- zend_fcall_info_argp()
- zend_fcall_info_argv()
- zend_fcall_info_argn()
- zend_startup()
- zend_set_memory_limit()
- pass_two()
- zend_startup_constants()
- zend_shutdown_constants()
- zend_startup_extensions_mechanism()
- zend_startup_extensions()
- zend_register_extension()
- highlight_string()
- zend_ini_startup()
- zend_ini_shutdown()
- zend_ini_global_shutdown()
- zend_ini_deactivate()
- zend_copy_ini_directives()
- zend_prepare_string_for_scanning()
- zend_init_rsrc_list()
- zend_list_close()
- zend_signal()
- zend_sigaction()
- zend_stack_init()
- zend_stack_del_top()
- zend_stack_destroy()
2. Argument int to uint32_t in Zend Engine 4.0:
- _zend_get_parameters_array_ex()
- zend_copy_parameters_array()
@@ -193,39 +168,8 @@ PHP 8.0 INTERNALS UPGRADE NOTES
- zend_wrong_parameter*()
- zend_wrong_callback_error()
- zend_parse_arg_class()
3. Argument int to bool in Zend Engine 4.0:
3. Argument int to zend_bool in Zend Engine 4.0:
- add_next_index_bool()
- zend_register_class_alias_ex()
- add_assoc_bool_ex()
- add_index_bool()
- zend_fcall_info_args_clear()
- zend_set_local_var()
- zend_set_local_var_str()
- zend_parse_arg_*()
- shutdown_memory_manager()
- zend_memory_usage()
- zend_memory_peak_usage()
- zend_mm_shutdown()
- zend_eval_string*()
- zend_set_timeout()
- _zend_hash_append_ex()
- _zend_hash_append_ptr_ex()
- zend_alter_ini_entry_ex()
- (*zend_encoding_list_parser) typedef
- zend_multibyte_parse_encoding_list()
- zend_safe_address()
- zend_string_tolower_ex()
- zend_string_alloc()
- zend_string_safe_alloc()
- zend_string_init()
- zend_string_dup()
- zend_string_realloc()
- zend_string_extend()
- zend_string_truncate()
- zend_string_safe_realloc()
- zend_string_release_ex()
- zend_ts_hash_merge()
- zend_ts_hash_sort()
4. Argument int to size_t in Zend Engine 4.0:
- zend_set_hash_symbol()
5. Argument zval* to zend_object* in Zend Engine 4.0:
@@ -240,174 +184,22 @@ PHP 8.0 INTERNALS UPGRADE NOTES
- zend_get_exception_base()
6. Argument zval* to zend_long in Zend Engine 4.0:
- _php_math_longtobase()
7. Return type from int to zend_result in Zend Engine 4.0:
- (*stream_open_function) in _zend_utility_functions
- (*zend_post_startup_cb)
- (*zend_preload_autoload)
- zend_execute_scripts()
- zend_post_startup()
- _zend_get_parameters_array_ex()
- zend_copy_parameters_array()
- zend_parse_parameters()
- zend_parse_parameters_ex()
- zend_parse_method_parameters()
- zend_parse_method_parameters_ex()
- zend_parse_method_parameters()
- zend_register_functions()
- zend_startup_module()
- zend_startup_module_ex()
- zend_register_class_alias_ex()
- zend_disable_function()
- zend_disable_class()
- zend_update_class_constants()
- zend_update_static_property*()
- object_init_ex()
- object_and_properties_init()
- add_index_zval()
- add_next_index_long_*()
- array_set_zval_key()
- _call_user_function_impl()
- zend_fcall_info_*()
- zend_call_function()
- zend_set_hash_symbol()
- zend_delete_global_variable()
- zend_set_local_var()
- zend_set_local_var_str()
- zend_forbid_dynamic_call()
- zend_get_default_from_internal_arg_info()
- zend_try_assign_typed_ref*()
- zend_ast_evaluate()
- zend_startup_builtin_functions()
- do_bind_function()
- do_bind_class()
- zend_unmangle_property_name_ex()
- zend_register_auto_global()
- zend_register_constant()
- zend_exception_error()
- zend_eval_string*()
- zend_undefined_offset_write()
- zend_undefined_index_write()
- zval_update_constant(_ex)()
- zend_load_extension()
- zend_load_extension_handle()
- zend_hash_del(_ind)()
- zend_hash_str_del(_ind)()
- zend_hash_index_del()
- zend_hash_move_forward_ex()
- zend_hash_move_backward_ex()
- zend_hash_get_current_key_ex()
- zend_hash_get_current_key_type_ex()
- zend_symtable_del(_ind)()
- zend_symtable_str_del(_ind)()
- highlight_file()
- zend_do_link_class()
- zend_alter_ini_entry*()
- zend_restore_ini_entry()
- zend_ini_register_displayer()
- zend_ini_open_file_for_scanning()
- zend_ini_prepare_string_for_scanning()
- zend_user_it_valid()
- zend_create_internal_iterator_zval()
- zend_multibyte_set_filter()
- zend_lex_tstring()
- _zend_module_entry module_startup_func, module_shutdown_func,
request_startup_func, request_shutdown_func, and post_deactivate_func function pointers
- (*zend_encoding_list_parser) typedef
- (*zend_encoding_internal_encoding_setter) typedef
- zend_multibyte_set_functions()
- zend_multibyte_set_script_encoding_by_string()
- add_function()
- sub_function()
- mul_function()
- pow_function()
- div_function()
- mod_function()
- boolean_xor_function()
- boolean_not_function()
- bitwise_not_function()
- bitwise_or_function()
- bitwise_and_function()
- bitwise_xor_function()
- shift_left_function()
- shift_right_function()
- concat_function()
- is_equal_function(
- is_identical_function()
- is_not_identical_function()
- is_not_equal_function()
- is_smaller_function()
- is_smaller_or_equal_function(zv
- increment_function()
- decrement_function()
- zend_stream_open()
- zend_stream_fixup()
- zend_ts_hash_del()
- zend_ts_hash_index_del()
8. Return type from int to bool in Zend Engine 4.0:
- zend_make_printable_zval()
- zend_parse_arg_*()
- is_zend_mm()
- is_zend_ptr()
- zend_mm_is_custom_heap()
- (*zend_mm_chunk_truncate_t)
- (*zend_mm_chunk_extend_t)
- zend_bitset_empty()
- zend_is_smart_branch()
- zend_check_arg_send_type()
- zend_verify_const_access()
- zend_gdb_register_code()
- zend_gdb_present()
- _zend_handle_numeric_str(_ex)()
- zend_hash_exists_ind()
- zend_hash_str_exists_ind()
- zend_symtable_exists(_ind)()
- zend_symtable_str_exists()
- (*zend_encoding_lexer_compatibility_checker)
- zend_object_is_true()
- i_zend_is_true()
- zendi_smart_streq()
- zend_stack_is_empty()
- zend_ts_hash_exists()
- zend_ts_hash_index_exists()
9. Argument void to const char* in Zend Engine 4.0:
- zend_get_op_array_extension_handle()
10. Argument zend_extension to const char* in Zend Engine 4.0:
- zend_get_resource_handle()
11. Argument const char * to HMODULE in Zend Engine 4.0:
- php_win32_image_compatible()
12. const char * argument dropped in Zend Engine 4.0:
- php_win32_crt_compatible()
u. Instead of overwriting zend_error_cb extensions with debugging, monitoring
use-cases catching Errors/Exceptions are strongly encouraged to use
the new error observer API instead.
the new error notification API instead.
Error observering callbacks are guaranteed to be called regardless of
Error notification callbacks are guaranteed to be called regardless of
the users error_reporting setting or userland error handler return values.
Register observer callbacks during MINIT of an extension:
Register notification callbacks during MINIT of an extension:
void my_error_observer_cb(int type,
void my_error_notify_cb(int type,
const char *error_filename,
uint32_t error_lineno,
zend_string *message) {
}
zend_observer_error_register(my_error_observer_cb);
v. The following APIs have been removed from the Zend Engine:
- zend_ts_hash_init_ex(), drop the last argument and use zend_ts_hash_init() instead
- zend_hash_init_ex(), drop the last argument and use zend_hash_init() instead
- zval_internal_dtor(), use zval_internal_ptr_dtor() instead
- zval_dtor_func(), use rc_dtor_func() instead
- zval_ptr_dtor_wrapper(), use zval_ptr_dtor() instead
- zval_internal_ptr_dtor_wrapper(), use zval_internal_ptr_dtor() instead
w. The following APIs have been renamed:
- _zend_ts_hash_init() to zend_ts_hash_init()
x. In COMPILE_EXTENDED_STMT mode, a ZEND_EXT_NOP opcode will no longer be
generated at the start of a function. Use the new observer APIs or hook
into zend_execute_ex instead.
zend_register_error_notify_callback(my_error_notify_cb);
========================
2. Build system changes
@@ -440,14 +232,6 @@ PHP 8.0 INTERNALS UPGRADE NOTES
2. The PHP_CHECK_GCC_ARG() m4 macro has been removed in favor of
AX_CHECK_COMPILE_FLAG().
3. The 6th argument of PHP_ADD_SOURCES_X has been removed.
4. The 'special-flags' (3rd) argument of PHP_ADD_SOURCES_X are
now appended instead of prepended to previous compiler flags.
This means compiler flags passed to PHP_NEW_EXTENSION and PHP_ADD_SOURCES
are now appended, this allows to disable compiler flags set by Zend/Zend.m4
(e.g. disable certain compiler flags enabled by -Wextra)
c. Windows build system changes
- The configuration option --enable-crt-debug has been removed. The VC
+12 -6
View File
@@ -163,16 +163,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])
@@ -190,6 +190,12 @@ dnl LIBZEND_OTHER_CHECKS
dnl
AC_DEFUN([LIBZEND_OTHER_CHECKS],[
AC_ARG_ENABLE([zts],
[AS_HELP_STRING([--enable-zts],
[Enable thread safety])],
[ZEND_ZTS=$enableval],
[ZEND_ZTS=no])
AC_MSG_CHECKING(whether to enable thread-safety)
AC_MSG_RESULT($ZEND_ZTS)
@@ -206,9 +212,9 @@ else
AC_DEFINE(ZEND_DEBUG,0,[ ])
fi
test -n "$GCC" && CFLAGS="-Wall -Wextra -Wno-strict-aliasing -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare $CFLAGS"
test -n "$GCC" && CFLAGS="$CFLAGS -Wall -Wextra -Wno-strict-aliasing -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare"
dnl Check if compiler supports -Wno-clobbered (only GCC)
AX_CHECK_COMPILE_FLAG([-Wno-clobbered], CFLAGS="-Wno-clobbered $CFLAGS", , [-Werror])
AX_CHECK_COMPILE_FLAG([-Wno-clobbered], CFLAGS="$CFLAGS -Wno-clobbered", , [-Werror])
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
@@ -262,7 +268,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`
+2 -2
View File
@@ -32,13 +32,13 @@ echo "Done\n";
--EXPECTF--
TypeError: define(): Argument #1 ($constant_name) must be of type string, array given
Warning: Constant TRUE already defined in %s on line %d
Notice: Constant TRUE already defined in %s on line %d
bool(false)
bool(true)
bool(true)
bool(true)
Warning: Constant test const already defined in %s on line %d
Notice: Constant test const already defined in %s on line %d
bool(false)
bool(true)
bool(true)
+5 -7
View File
@@ -26,11 +26,7 @@ $f2 = new foo2;
$f1->bar();
$f2->bar();
try {
var_dump(get_class());
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
var_dump(get_class());
try {
var_dump(get_class("qwerty"));
} catch (TypeError $e) {
@@ -44,10 +40,12 @@ $f1->testNull();
echo "Done\n";
?>
--EXPECT--
--EXPECTF--
string(3) "foo"
string(3) "foo"
get_class() without arguments must be called from within a class
Warning: get_class() called without object from outside a class in %s on line %d
bool(false)
get_class(): Argument #1 ($object) must be of type object, string given
string(3) "foo"
string(4) "foo2"
+5 -5
View File
@@ -75,10 +75,10 @@ bool(false)
string(3) "foo"
bool(false)
bool(false)
get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given
get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given
get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given
get_parent_class(): Argument #1 ($object_or_class) must be a valid class name or object, string given
get_parent_class(): Argument #1 ($object_or_class) must be a valid class name or object, string given
get_parent_class(): Argument #1 ($object_or_class) must be a valid class name or object, string given
bool(false)
get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given
get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given
get_parent_class(): Argument #1 ($object_or_class) must be a valid class name or object, array given
get_parent_class(): Argument #1 ($object_or_class) must be a valid class name or object, int given
Done
+2 -2
View File
@@ -23,8 +23,8 @@ var_dump(trigger_error("error", E_USER_DEPRECATED));
--EXPECTF--
Notice: error in %s on line %d
bool(true)
trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
trigger_error(): Argument #2 ($error_type) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
trigger_error(): Argument #2 ($error_type) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
Warning: error in %s on line %d
bool(true)
-63
View File
@@ -1,63 +0,0 @@
--TEST--
Test default value handling of ErrorException::__construct()
--FILE--
<?php
$e = new ErrorException();
var_dump($e->getMessage());
var_dump($e->getFile());
var_dump($e->getLine());
$e = new ErrorException("Second", 0, E_ERROR, null);
var_dump($e->getMessage());
var_dump($e->getFile());
var_dump($e->getLine());
$e = new ErrorException("Third", 0, E_ERROR, null, null);
var_dump($e->getMessage());
var_dump($e->getFile());
var_dump($e->getLine());
$e = new ErrorException("Forth", 0, E_ERROR, null, 123);
var_dump($e->getMessage());
var_dump($e->getFile());
var_dump($e->getLine());
$e = new ErrorException("Fifth", 0, E_ERROR, "abc.php");
var_dump($e->getMessage());
var_dump($e->getFile());
var_dump($e->getLine());
$e = new ErrorException("Sixth", 0, E_ERROR, "abc.php", null);
var_dump($e->getMessage());
var_dump($e->getFile());
var_dump($e->getLine());
$e = new ErrorException("Seventh", 0, E_ERROR, "abc.php", 123);
var_dump($e->getMessage());
var_dump($e->getFile());
var_dump($e->getLine());
?>
--EXPECTF--
string(0) ""
string(%d) "%sErrorException_construct.php"
int(3)
string(6) "Second"
string(%d) "%sErrorException_construct.php"
int(8)
string(5) "Third"
string(%d) "%sErrorException_construct.php"
int(13)
string(5) "Forth"
string(%d) "%sErrorException_construct.php"
int(123)
string(5) "Fifth"
string(7) "abc.php"
int(0)
string(5) "Sixth"
string(7) "abc.php"
int(0)
string(7) "Seventh"
string(7) "abc.php"
int(123)
-39
View File
@@ -1,39 +0,0 @@
<?php
function skipFunction($function): bool {
if (false
/* expect input / hang */
|| $function === 'readline'
|| $function === 'readline_read_history'
|| $function === 'readline_write_history'
/* intentionally violate invariants */
|| $function === 'zend_create_unterminated_string'
|| $function === 'zend_test_array_return'
|| $function === 'zend_leak_bytes'
/* mess with output */
|| (is_string($function) && str_starts_with($function, 'ob_'))
|| $function === 'output_add_rewrite_var'
|| $function === 'error_log'
/* may spend a lot of time waiting for connection timeouts */
|| (is_string($function) && str_contains($function, 'connect'))
|| (is_string($function) && str_starts_with($function, 'snmp'))
|| (is_array($function) && get_class($function[0]) === mysqli::class
&& in_array($function[1], ['__construct', 'connect', 'real_connect']))
/* misc */
|| $function === 'mail'
|| $function === 'mb_send_mail'
|| $function === 'pcntl_fork'
|| $function === 'posix_kill'
|| $function === 'posix_setrlimit'
|| $function === 'sapi_windows_generate_ctrl_event'
|| $function === 'imagegrabscreen'
) {
return true;
}
if ($function[0] instanceof SoapServer) {
/* TODO: Uses fatal errors */
return true;
}
return false;
}
+16 -51
View File
@@ -1,62 +1,13 @@
--TEST--
Test that there is no arginfo/zpp mismatch
--SKIPIF--
<?php
if (getenv('SKIP_MSAN')) die("skip msan misses interceptors for some functions");
?>
--FILE--
<?php
require __DIR__ . "/arginfo_zpp_mismatch.inc";
function test($function) {
if (skipFunction($function)) {
return;
}
ob_start();
if (is_string($function)) {
echo "Testing $function\n";
} else {
echo "Testing " . get_class($function[0]) . "::$function[1]\n";
}
try {
@$function();
} catch (Throwable) {
}
try {
@$function(null);
} catch (Throwable) {
}
try {
@$function(null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null, null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null, null, null, null, null);
} catch (Throwable) {
}
ob_end_clean();
}
foreach (get_defined_functions()["internal"] as $function) {
@@ -78,6 +29,20 @@ foreach (get_declared_classes() as $class) {
// var_dump() and debug_zval_dump() print all arguments
?>
===DONE===
--EXPECT--
===DONE===
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
@@ -1,85 +0,0 @@
--TEST--
Test that there is no arginfo/zpp mismatch in strict mode
--SKIPIF--
<?php
if (getenv('SKIP_MSAN')) die("skip msan misses interceptors for some functions");
?>
--FILE--
<?php
declare(strict_types=1);
require __DIR__ . "/arginfo_zpp_mismatch.inc";
function test($function) {
if (skipFunction($function)) {
return;
}
ob_start();
if (is_string($function)) {
echo "Testing $function\n";
} else {
echo "Testing " . get_class($function[0]) . "::$function[1]\n";
}
try {
@$function();
} catch (Throwable) {
}
try {
@$function(null);
} catch (Throwable) {
}
try {
@$function(null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null, null, null, null);
} catch (Throwable) {
}
try {
@$function(null, null, null, null, null, null, null, null);
} catch (Throwable) {
}
ob_end_clean();
}
foreach (get_defined_functions()["internal"] as $function) {
test($function);
}
foreach (get_declared_classes() as $class) {
try {
$rc = new ReflectionClass($class);
$obj = $rc->newInstanceWithoutConstructor();
} catch (Throwable) {
continue;
}
foreach (get_class_methods($class) as $method) {
test([$obj, $method]);
}
}
// var_dump() and debug_zval_dump() print all arguments
?>
===DONE===
--EXPECT--
===DONE===
-16
View File
@@ -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)
-10
View File
@@ -1,10 +0,0 @@
--TEST--
Add $GLOBALS to itself
--FILE--
<?php
$GLOBALS += $GLOBALS;
$x = $GLOBALS + $GLOBALS;
?>
===DONE===
--EXPECT--
===DONE===
+1 -1
View File
@@ -41,4 +41,4 @@ array(3) {
[2]=>
int(30)
}
{closure}(): Argument #2 must be of type ?int, string given, called in %s on line %d
{closure}(): Argument #2 ($args) must be of type ?int, string given, called in %s on line %d
@@ -1,13 +0,0 @@
--TEST--
Assign concat of array and empty string
--FILE--
<?php
$a = [0];
$a .= '';
var_dump($a);
?>
--EXPECTF--
Warning: Array to string conversion in %s on line %d
string(5) "Array"
+15 -15
View File
@@ -3,27 +3,27 @@ Attributes can be placed on all supported elements.
--FILE--
<?php
#[A1(1)]
@@A1(1)
class Foo
{
#[A1(2)]
@@A1(2)
public const FOO = 'foo';
#[A1(3)]
@@A1(3)
public $x;
#[A1(4)]
public function foo(#[A1(5)] $a, #[A1(6)] $b) { }
@@A1(4)
public function foo(@@A1(5) $a, @@A1(6) $b) { }
}
$object = new #[A1(7)] class () { };
$object = new @@A1(7) class () { };
#[A1(8)]
@@A1(8)
function f1() { }
$f2 = #[A1(9)] function () { };
$f2 = @@A1(9) function () { };
$f3 = #[A1(10)] fn () => 1;
$f3 = @@A1(10) fn () => 1;
$ref = new \ReflectionClass(Foo::class);
@@ -41,13 +41,13 @@ $sources = [
];
foreach ($sources as $r) {
$attr = $r->getAttributes();
var_dump(get_class($r), count($attr));
$attr = $r->getAttributes();
var_dump(get_class($r), count($attr));
foreach ($attr as $a) {
var_dump($a->getName(), $a->getArguments());
}
echo "\n";
}
+2 -2
View File
@@ -6,7 +6,7 @@ Attributes: Example from Attributes RFC
namespace My\Attributes {
use Attribute;
#[Attribute]
@@Attribute
class SingleArgument {
public $argumentValue;
@@ -19,7 +19,7 @@ namespace My\Attributes {
namespace {
use My\Attributes\SingleArgument;
#[SingleArgument("Hello World")]
@@SingleArgument("Hello World")
class Foo {
}
+13 -13
View File
@@ -5,10 +5,10 @@ Attributes can deal with AST nodes.
define('V1', strtoupper(php_sapi_name()));
#[A1([V1 => V1])]
@@A1([V1 => V1])
class C1
{
public const BAR = 'bar';
public const BAR = 'bar';
}
$ref = new \ReflectionClass(C1::class);
@@ -20,7 +20,7 @@ var_dump(count($args), $args[0][V1] === V1);
echo "\n";
#[A1(V1, 1 + 2, C1::class)]
@@A1(V1, 1 + 2, C1::class)
class C2 { }
$ref = new \ReflectionClass(C2::class);
@@ -35,10 +35,10 @@ var_dump($args[2] === C1::class);
echo "\n";
#[A1(self::FOO, C1::BAR)]
@@A1(self::FOO, C1::BAR)
class C3
{
private const FOO = 'foo';
private const FOO = 'foo';
}
$ref = new \ReflectionClass(C3::class);
@@ -52,33 +52,33 @@ var_dump($args[1] === C1::BAR);
echo "\n";
#[ExampleWithShift(4 >> 1)]
@@ExampleWithShift(4 >> 1)
class C4 {}
$ref = new \ReflectionClass(C4::class);
var_dump($ref->getAttributes()[0]->getArguments());
echo "\n";
#[Attribute]
@@Attribute
class C5
{
public function __construct() { }
public function __construct() { }
}
$ref = new \ReflectionFunction(#[C5(MissingClass::SOME_CONST)] function () { });
$ref = new \ReflectionFunction(@@C5(MissingClass::SOME_CONST) function () { });
$attr = $ref->getAttributes();
var_dump(count($attr));
try {
$attr[0]->getArguments();
$attr[0]->getArguments();
} catch (\Error $e) {
var_dump($e->getMessage());
var_dump($e->getMessage());
}
try {
$attr[0]->newInstance();
$attr[0]->newInstance();
} catch (\Error $e) {
var_dump($e->getMessage());
var_dump($e->getMessage());
}
?>
+10 -13
View File
@@ -2,15 +2,12 @@
Resolve attribute names
--FILE--
<?php
namespace {
function dump_attributes($attributes) {
$arr = [];
foreach ($attributes as $attribute) {
$arr[] = ['name' => $attribute->getName(), 'args' => $attribute->getArguments()];
}
var_dump($arr);
function dump_attributes($attributes) {
$arr = [];
foreach ($attributes as $attribute) {
$arr[] = ['name' => $attribute->getName(), 'args' => $attribute->getArguments()];
}
var_dump($arr);
}
namespace Doctrine\ORM\Mapping {
@@ -28,11 +25,11 @@ namespace Foo {
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Attributes;
#[Entity("imported class")]
#[ORM\Entity("imported namespace")]
#[\Doctrine\ORM\Mapping\Entity("absolute from namespace")]
#[\Entity("import absolute from global")]
#[Attributes\Table()]
@@Entity("imported class")
@@ORM\Entity("imported namespace")
@@\Doctrine\ORM\Mapping\Entity("absolute from namespace")
@@\Entity("import absolute from global")
@@Attributes\Table()
function foo() {
}
}
+35 -35
View File
@@ -3,109 +3,109 @@ Attributes can be converted into objects.
--FILE--
<?php
#[Attribute(Attribute::TARGET_FUNCTION)]
@@Attribute(Attribute::TARGET_FUNCTION)
class A1
{
public string $name;
public int $ttl;
public string $name;
public int $ttl;
public function __construct(string $name, int $ttl = 50)
{
$this->name = $name;
$this->ttl = $ttl;
}
public function __construct(string $name, int $ttl = 50)
{
$this->name = $name;
$this->ttl = $ttl;
}
}
$ref = new \ReflectionFunction(#[A1('test')] function () { });
$ref = new \ReflectionFunction(@@A1('test') function () { });
foreach ($ref->getAttributes() as $attr) {
$obj = $attr->newInstance();
$obj = $attr->newInstance();
var_dump(get_class($obj), $obj->name, $obj->ttl);
var_dump(get_class($obj), $obj->name, $obj->ttl);
}
echo "\n";
$ref = new \ReflectionFunction(#[A1] function () { });
$ref = new \ReflectionFunction(@@A1 function () { });
try {
$ref->getAttributes()[0]->newInstance();
$ref->getAttributes()[0]->newInstance();
} catch (\ArgumentCountError $e) {
var_dump('ERROR 1', $e->getMessage());
var_dump('ERROR 1', $e->getMessage());
}
echo "\n";
$ref = new \ReflectionFunction(#[A1([])] function () { });
$ref = new \ReflectionFunction(@@A1([]) function () { });
try {
$ref->getAttributes()[0]->newInstance();
$ref->getAttributes()[0]->newInstance();
} catch (\TypeError $e) {
var_dump('ERROR 2', $e->getMessage());
var_dump('ERROR 2', $e->getMessage());
}
echo "\n";
$ref = new \ReflectionFunction(#[A2] function () { });
$ref = new \ReflectionFunction(@@A2 function () { });
try {
$ref->getAttributes()[0]->newInstance();
$ref->getAttributes()[0]->newInstance();
} catch (\Error $e) {
var_dump('ERROR 3', $e->getMessage());
var_dump('ERROR 3', $e->getMessage());
}
echo "\n";
#[Attribute]
@@Attribute
class A3
{
private function __construct() { }
private function __construct() { }
}
$ref = new \ReflectionFunction(#[A3] function () { });
$ref = new \ReflectionFunction(@@A3 function () { });
try {
$ref->getAttributes()[0]->newInstance();
$ref->getAttributes()[0]->newInstance();
} catch (\Error $e) {
var_dump('ERROR 4', $e->getMessage());
var_dump('ERROR 4', $e->getMessage());
}
echo "\n";
#[Attribute]
@@Attribute
class A4 { }
$ref = new \ReflectionFunction(#[A4(1)] function () { });
$ref = new \ReflectionFunction(@@A4(1) function () { });
try {
$ref->getAttributes()[0]->newInstance();
$ref->getAttributes()[0]->newInstance();
} catch (\Error $e) {
var_dump('ERROR 5', $e->getMessage());
var_dump('ERROR 5', $e->getMessage());
}
echo "\n";
class A5 { }
$ref = new \ReflectionFunction(#[A5] function () { });
$ref = new \ReflectionFunction(@@A5 function () { });
try {
$ref->getAttributes()[0]->newInstance();
$ref->getAttributes()[0]->newInstance();
} catch (\Error $e) {
var_dump('ERROR 6', $e->getMessage());
var_dump('ERROR 6', $e->getMessage());
}
?>
--EXPECTF--
--EXPECT--
string(2) "A1"
string(4) "test"
int(50)
string(7) "ERROR 1"
string(%d) "Too few arguments to function A1::__construct(), 0 passed in %s005_objects.php on line 26 and at least 1 expected"
string(81) "Too few arguments to function A1::__construct(), 0 passed and at least 1 expected"
string(7) "ERROR 2"
string(%d) "A1::__construct(): Argument #1 ($name) must be of type string, array given, called in %s005_objects.php on line 36"
string(74) "A1::__construct(): Argument #1 ($name) must be of type string, array given"
string(7) "ERROR 3"
string(30) "Attribute class "A2" not found"
+12 -12
View File
@@ -3,17 +3,17 @@ Attributes can be filtered by name and base type.
--FILE--
<?php
$ref = new \ReflectionFunction(#[A1] #[A2] function () { });
$ref = new \ReflectionFunction(@@A1 @@A2 function () { });
$attr = $ref->getAttributes(A3::class);
var_dump(count($attr));
$ref = new \ReflectionFunction(#[A1] #[A2] function () { });
$ref = new \ReflectionFunction(@@A1 @@A2 function () { });
$attr = $ref->getAttributes(A2::class);
var_dump(count($attr), $attr[0]->getName());
$ref = new \ReflectionFunction(#[A1] #[A2] #[A2] function () { });
$ref = new \ReflectionFunction(@@A1 @@A2 @@A2 function () { });
$attr = $ref->getAttributes(A2::class);
var_dump(count($attr), $attr[0]->getName(), $attr[1]->getName());
@@ -25,27 +25,27 @@ class A1 implements Base { }
class A2 implements Base { }
class A3 extends A2 { }
$ref = new \ReflectionFunction(#[A1] #[A2] #[A5] function () { });
$ref = new \ReflectionFunction(@@A1 @@A2 @@A5 function () { });
$attr = $ref->getAttributes(\stdClass::class, \ReflectionAttribute::IS_INSTANCEOF);
var_dump(count($attr));
print_r(array_map(fn ($a) => $a->getName(), $attr));
$ref = new \ReflectionFunction(#[A1] #[A2] function () { });
$ref = new \ReflectionFunction(@@A1 @@A2 function () { });
$attr = $ref->getAttributes(A1::class, \ReflectionAttribute::IS_INSTANCEOF);
var_dump(count($attr));
print_r(array_map(fn ($a) => $a->getName(), $attr));
$ref = new \ReflectionFunction(#[A1] #[A2] function () { });
$ref = new \ReflectionFunction(@@A1 @@A2 function () { });
$attr = $ref->getAttributes(Base::class, \ReflectionAttribute::IS_INSTANCEOF);
var_dump(count($attr));
print_r(array_map(fn ($a) => $a->getName(), $attr));
$ref = new \ReflectionFunction(#[A1] #[A2] #[A3] function () { });
$ref = new \ReflectionFunction(@@A1 @@A2 @@A3 function () { });
$attr = $ref->getAttributes(A2::class, \ReflectionAttribute::IS_INSTANCEOF);
var_dump(count($attr));
print_r(array_map(fn ($a) => $a->getName(), $attr));
$ref = new \ReflectionFunction(#[A1] #[A2] #[A3] function () { });
$ref = new \ReflectionFunction(@@A1 @@A2 @@A3 function () { });
$attr = $ref->getAttributes(Base::class, \ReflectionAttribute::IS_INSTANCEOF);
var_dump(count($attr));
print_r(array_map(fn ($a) => $a->getName(), $attr));
@@ -55,17 +55,17 @@ echo "\n";
$ref = new \ReflectionFunction(function () { });
try {
$ref->getAttributes(A1::class, 3);
$ref->getAttributes(A1::class, 3);
} catch (\Error $e) {
var_dump('ERROR 1', $e->getMessage());
var_dump('ERROR 1', $e->getMessage());
}
$ref = new \ReflectionFunction(function () { });
try {
$ref->getAttributes(SomeMissingClass::class, \ReflectionAttribute::IS_INSTANCEOF);
$ref->getAttributes(SomeMissingClass::class, \ReflectionAttribute::IS_INSTANCEOF);
} catch (\Error $e) {
var_dump('ERROR 2', $e->getMessage());
var_dump('ERROR 2', $e->getMessage());
}
?>
@@ -3,7 +3,7 @@ Attributes: Prevent Attribute on non classes
--FILE--
<?php
#[Attribute]
@@Attribute
function foo() {}
?>
--EXPECTF--
@@ -25,22 +25,22 @@ namespace {
use Doctrine\ORM\Attributes as ORM;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity]
@@ORM\Entity
/** @ORM\Entity */
class User
{
/** @ORM\Id @ORM\Column(type="integer"*) @ORM\GeneratedValue */
#[ORM\Id]
#[ORM\Column("integer")]
#[ORM\GeneratedValue]
@@ORM\Id
@@ORM\Column("integer")
@@ORM\GeneratedValue
private $id;
/**
* @ORM\Column(type="string", unique=true)
* @Assert\Email(message="The email '{{ value }}' is not a valid email.")
*/
#[ORM\Column("string", ORM\Column::UNIQUE)]
#[Assert\Email(array("message" => "The email '{{ value }}' is not a valid email."))]
@@ORM\Column("string", ORM\Column::UNIQUE)
@@Assert\Email(array("message" => "The email '{{ value }}' is not a valid email."))
private $email;
/**
@@ -52,8 +52,8 @@ class User
* maxMessage = "You cannot be taller than {{ limit }}cm to enter"
* )
*/
#[Assert\Range(["min" => 120, "max" => 180, "minMessage" => "You must be at least {{ limit }}cm tall to enter"])]
#[ORM\Column(ORM\Column::T_INTEGER)]
@@Assert\Range(["min" => 120, "max" => 180, "minMessage" => "You must be at least {{ limit }}cm tall to enter"])
@@ORM\Column(ORM\Column::T_INTEGER)
protected $height;
/**
@@ -63,10 +63,10 @@ class User
* inverseJoinColumns={@ORM\JoinColumn(name="phonenumber_id", referencedColumnName="id", unique=true)}
* )
*/
#[ORM\ManyToMany(Phonenumber::class)]
#[ORM\JoinTable("users_phonenumbers")]
#[ORM\JoinColumn("user_id", "id")]
#[ORM\InverseJoinColumn("phonenumber_id", "id", ORM\JoinColumn::UNIQUE)]
@@ORM\ManyToMany(Phonenumber::class)
@@ORM\JoinTable("users_phonenumbers")
@@ORM\JoinColumn("user_id", "id")
@@ORM\InverseJoinColumn("phonenumber_id", "id", ORM\JoinColumn::UNIQUE)
private $phonenumbers;
}
@@ -3,7 +3,7 @@ Attribute arguments support only const expressions.
--FILE--
<?php
#[A1(foo())]
@@A1(foo())
class C1 { }
?>
+12 -12
View File
@@ -3,22 +3,22 @@ Attributes comply with inheritance rules.
--FILE--
<?php
#[A2]
@@A2
class C1
{
#[A1]
public function foo() { }
@@A1
public function foo() { }
}
class C2 extends C1
{
public function foo() { }
public function foo() { }
}
class C3 extends C1
{
#[A1]
public function bar() { }
@@A1
public function bar() { }
}
$ref = new \ReflectionClass(C1::class);
@@ -37,20 +37,20 @@ echo "\n";
trait T1
{
#[A2]
public $a;
@@A2
public $a;
}
class C4
{
use T1;
use T1;
}
class C5
{
use T1;
public $a;
use T1;
public $a;
}
$ref = new \ReflectionClass(T1::class);
+19 -19
View File
@@ -7,51 +7,51 @@ assert.warning=1
--FILE--
<?php
assert(0 && ($a = #[A1] #[A2] function ($a, #[A3(1)] $b) { }));
assert(0 && ($a = @@A1 @@A2 function ($a, @@A3(1) $b) { }));
assert(0 && ($a = #[A1(1, 2, 1 + 2)] fn () => 1));
assert(0 && ($a = @@A1(1, 2, 1 + 2) fn () => 1));
assert(0 && ($a = new #[A1] class() {
#[A1]#[A2] const FOO = 'foo';
#[A2] public $x;
#[A3] function a() { }
assert(0 && ($a = new @@A1 class() {
@@A1@@A2 const FOO = 'foo';
@@A2 public $x;
@@A3 function a() { }
}));
assert(0 && ($a = function () {
#[A1] class Test1 { }
#[A2] interface Test2 { }
#[A3] trait Test3 { }
@@A1 class Test1 { }
@@A2 interface Test2 { }
@@A3 trait Test3 { }
}));
?>
--EXPECTF--
Warning: assert(): assert(0 && ($a = #[A1] #[A2] function ($a, #[A3(1)] $b) {
Warning: assert(): assert(0 && ($a = @@A1 @@A2 function ($a, @@A3(1) $b) {
})) failed in %s on line %d
Warning: assert(): assert(0 && ($a = #[A1(1, 2, 1 + 2)] fn() => 1)) failed in %s on line %d
Warning: assert(): assert(0 && ($a = @@A1(1, 2, 1 + 2) fn() => 1)) failed in %s on line %d
Warning: assert(): assert(0 && ($a = new #[A1] class {
#[A1]
#[A2]
Warning: assert(): assert(0 && ($a = new @@A1 class {
@@A1
@@A2
public const FOO = 'foo';
#[A2]
@@A2
public $x;
#[A3]
@@A3
public function a() {
}
})) failed in %s on line %d
Warning: assert(): assert(0 && ($a = function () {
#[A1]
@@A1
class Test1 {
}
#[A2]
@@A2
interface Test2 {
}
#[A3]
@@A3
trait Test3 {
}
+21 -21
View File
@@ -3,17 +3,17 @@ Attributes make use of class scope.
--FILE--
<?php
#[A1(self::class, self::FOO)]
@@A1(self::class, self::FOO)
class C1
{
#[A1(self::class, self::FOO)]
private const FOO = 'foo';
@@A1(self::class, self::FOO)
private const FOO = 'foo';
#[A1(self::class, self::FOO)]
public $a;
@@A1(self::class, self::FOO)
public $a;
#[A1(self::class, self::FOO)]
public function bar(#[A1(self::class, self::FOO)] $p) { }
@@A1(self::class, self::FOO)
public function bar(@@A1(self::class, self::FOO) $p) { }
}
$ref = new \ReflectionClass(C1::class);
@@ -27,15 +27,15 @@ echo "\n";
trait T1
{
#[A1(self::class, self::FOO)]
public function foo() { }
@@A1(self::class, self::FOO)
public function foo() { }
}
class C2
{
use T1;
use T1;
private const FOO = 'bar';
private const FOO = 'bar';
}
$ref = new \ReflectionClass(C2::class);
@@ -45,7 +45,7 @@ $ref = new \ReflectionClass(T1::class);
$attr = $ref->getMethod('foo')->getAttributes()[0];
try {
$attr->getArguments();
$attr->getArguments();
} catch (\Error $e) {
var_dump('ERROR 1', $e->getMessage());
}
@@ -54,17 +54,17 @@ echo "\n";
class C3
{
private const FOO = 'foo';
private const FOO = 'foo';
public static function foo()
{
return new #[A1(self::class, self::FOO)] class() {
private const FOO = 'bar';
public static function foo()
{
return new @@A1(self::class, self::FOO) class() {
private const FOO = 'bar';
#[A1(self::class, self::FOO)]
public function bar() { }
};
}
@@A1(self::class, self::FOO)
public function bar() { }
};
}
}
$ref = new \ReflectionObject(C3::foo());
@@ -1,36 +1,14 @@
--TEST--
Attributes can be applied to groups of class constants
Attributes cannot be applied to groups of class constants.
--FILE--
<?php
class C
class C1
{
#[A(1, X)]
public const A = 1, B = 2;
@@A1
public const A = 1, B = 2;
}
const X = 2;
$rp1 = new ReflectionClassConstant('C', 'A');
$ra1 = $rp1->getAttributes()[0];
var_dump($ra1->getName(), $ra1->getArguments());
$rp2 = new ReflectionClassConstant('C', 'B');
$ra2 = $rp2->getAttributes()[0];
var_dump($ra2->getName(), $ra2->getArguments());
?>
--EXPECT--
string(1) "A"
array(2) {
[0]=>
int(1)
[1]=>
int(2)
}
string(1) "A"
array(2) {
[0]=>
int(1)
[1]=>
int(2)
}
--EXPECTF--
Fatal error: Cannot apply attributes to a group of constants in %s
+6 -28
View File
@@ -1,36 +1,14 @@
--TEST--
Attributes can be applied to groups of properties
Attributes cannot be applied to groups of properties.
--FILE--
<?php
class C
class C1
{
#[A(1, X)]
public $x, $y;
@@A1
public $x, $y;
}
const X = 2;
$rp1 = new ReflectionProperty('C', 'x');
$ra1 = $rp1->getAttributes()[0];
var_dump($ra1->getName(), $ra1->getArguments());
$rp2 = new ReflectionProperty('C', 'y');
$ra2 = $rp2->getAttributes()[0];
var_dump($ra2->getName(), $ra2->getArguments());
?>
--EXPECT--
string(1) "A"
array(2) {
[0]=>
int(1)
[1]=>
int(2)
}
string(1) "A"
array(2) {
[0]=>
int(1)
[1]=>
int(2)
}
--EXPECTF--
Fatal error: Cannot apply attributes to a group of properties in %s
@@ -8,9 +8,9 @@ if (!extension_loaded('zend-test')) {
--FILE--
<?php
#[ZendTestAttribute]
@@ZendTestAttribute
function foo() {
}
?>
--EXPECTF--
Fatal error: Only classes can be marked with #[ZendTestAttribute] in %s
Fatal error: Only classes can be marked with @@ZendTestAttribute in %s
+6 -6
View File
@@ -5,17 +5,17 @@ Attributes make use of closure scope.
class Test1
{
private const FOO = 'bar';
private const FOO = 'bar';
}
class C1
{
private const FOO = 'foo';
private const FOO = 'foo';
public static function foo()
{
return #[A1(self::class, self::FOO)] function (#[A1(self::class, self::FOO)] $p) { };
}
public static function foo()
{
return @@A1(self::class, self::FOO) function (@@A1(self::class, self::FOO) $p) { };
}
}
$ref = new \ReflectionFunction(C1::foo());
@@ -3,7 +3,7 @@ Don't free uninitialized memory if a fatal error occurs in an attribute argument
--FILE--
<?php
#[Attr(a->b::c)]
@@Attr(a->b::c)
function test() {}
?>
@@ -3,7 +3,7 @@ Attribute name cannot be a variable
--FILE--
<?php
#[$x]
@@$x
class A {}
?>
@@ -3,44 +3,44 @@ Attributes expose and verify target and repeatable data.
--FILE--
<?php
#[Attribute(Attribute::TARGET_FUNCTION | Attribute::TARGET_METHOD)]
@@Attribute(Attribute::TARGET_FUNCTION | Attribute::TARGET_METHOD)
class A1 { }
$ref = new \ReflectionFunction(#[A1] function () { });
$ref = new \ReflectionFunction(@@A1 function () { });
$attr = $ref->getAttributes()[0];
var_dump($attr->getName(), $attr->getTarget() == Attribute::TARGET_FUNCTION, $attr->isRepeated());
var_dump(get_class($attr->newInstance()));
echo "\n";
$ref = new \ReflectionObject(new #[A1] class() { });
$ref = new \ReflectionObject(new @@A1 class() { });
$attr = $ref->getAttributes()[0];
var_dump($attr->getName(), $attr->getTarget() == Attribute::TARGET_CLASS, $attr->isRepeated());
try {
$attr->newInstance();
$attr->newInstance();
} catch (\Throwable $e) {
var_dump('ERROR 1', $e->getMessage());
var_dump('ERROR 1', $e->getMessage());
}
echo "\n";
$ref = new \ReflectionFunction(#[A1] #[A1] function () { });
$ref = new \ReflectionFunction(@@A1 @@A1 function () { });
$attr = $ref->getAttributes()[0];
var_dump($attr->getName(), $attr->getTarget() == Attribute::TARGET_FUNCTION, $attr->isRepeated());
try {
$attr->newInstance();
$attr->newInstance();
} catch (\Throwable $e) {
var_dump('ERROR 2', $e->getMessage());
var_dump('ERROR 2', $e->getMessage());
}
echo "\n";
#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
@@Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)
class A2 { }
$ref = new \ReflectionObject(new #[A2] #[A2] class() { });
$ref = new \ReflectionObject(new @@A2 @@A2 class() { });
$attr = $ref->getAttributes()[0];
var_dump($attr->getName(), $attr->getTarget() == Attribute::TARGET_CLASS, $attr->isRepeated());
var_dump(get_class($attr->newInstance()));
@@ -3,7 +3,7 @@ Attribute flags type is validated.
--FILE--
<?php
#[Attribute("foo")]
@@Attribute("foo")
class A1 { }
?>
@@ -3,7 +3,7 @@ Attribute flags value is validated.
--FILE--
<?php
#[Attribute(-1)]
@@Attribute(-1)
class A1 { }
?>
@@ -3,7 +3,7 @@ Attribute flags value is validated.
--FILE--
<?php
#[Attribute(Foo::BAR)]
@@Attribute(Foo::BAR)
class A1 { }
?>
@@ -3,7 +3,7 @@ Internal attribute targets are validated.
--FILE--
<?php
#[Attribute]
@@Attribute
function a1() { }
?>
@@ -3,8 +3,8 @@ Internal attribute targets are validated.
--FILE--
<?php
#[Attribute]
#[Attribute]
@@Attribute
@@Attribute
class A1 { }
?>
@@ -3,7 +3,7 @@ Cannot use unpacking in attribute argument list
--FILE--
<?php
#[MyAttribute(...[1, 2, 3])]
@@MyAttribute(...[1, 2, 3])
class Foo { }
?>
@@ -3,12 +3,12 @@ Trailing comma in attribute argument list
--FILE--
<?php
#[MyAttribute(
"there",
"are",
"many",
"arguments",
)]
@@MyAttribute(
"there",
"are",
"many",
"arguments",
)
class Foo { }
$ref = new \ReflectionClass(Foo::class);
-55
View File
@@ -1,55 +0,0 @@
--TEST--
Attributes can be grouped
--FILE--
<?php
#[A1(1), A1(2), A2(3)]
class Foo
{
}
#[
A1(1),
A1(2),
A2(3)
]
function foo() {}
#[A1, A1, A2]
function bar() {}
$sources = [
new \ReflectionClass(Foo::class),
new \ReflectionFunction('foo'),
new \ReflectionFunction('bar'),
];
foreach ($sources as $ref) {
$attr = $ref->getAttributes();
var_dump(get_class($ref), count($attr));
foreach ($attr as $a) {
printf("%s(%s)\n", $a->getName(), implode(", ", $a->getArguments()));
}
echo "\n";
}
?>
--EXPECT--
string(15) "ReflectionClass"
int(3)
A1(1)
A1(2)
A2(3)
string(18) "ReflectionFunction"
int(3)
A1(1)
A1(2)
A2(3)
string(18) "ReflectionFunction"
int(3)
A1()
A1()
A2()
@@ -1,32 +0,0 @@
--TEST--
Reflect attributes on different kinds of internal symbols
--FILE--
<?php
$rf = new ReflectionFunction('unserialize');
var_dump($rf->getAttributes());
$rc = new ReflectionClass('DateTime');
var_dump($rc->getAttributes());
$rm = $rc->getMethod('__construct');
var_dump($rm->getAttributes());
$rcc = $rc->getReflectionConstant('ATOM');
var_dump($rcc->getAttributes());
$rp = new ReflectionProperty('Exception', 'message');
var_dump($rp->getAttributes());
?>
--EXPECT--
array(0) {
}
array(0) {
}
array(0) {
}
array(0) {
}
array(0) {
}
@@ -1,5 +0,0 @@
<?php
declare(strict_types=1);
#[MyAttribute("42")]
class TestStrict {}
@@ -1,31 +0,0 @@
--TEST--
strict_types=1 of the attribute use-site is respected
--FILE--
<?php
#[Attribute]
class MyAttribute {
public function __construct(public int $value) {}
}
#[MyAttribute("42")]
class TestWeak {}
require __DIR__ . '/030_strict_types.inc';
var_dump((new ReflectionClass(TestWeak::class))->getAttributes()[0]->newInstance());
var_dump((new ReflectionClass(TestStrict::class))->getAttributes()[0]->newInstance());
?>
--EXPECTF--
object(MyAttribute)#1 (1) {
["value"]=>
int(42)
}
Fatal error: Uncaught TypeError: MyAttribute::__construct(): Argument #1 ($value) must be of type int, string given, called in %s030_strict_types.inc on line 4 and defined in %s030_strict_types.php:5
Stack trace:
#0 %s030_strict_types.inc(4): MyAttribute->__construct('42')
#1 %s(%d): ReflectionAttribute->newInstance()
#2 {main}
thrown in %s on line %d
-97
View File
@@ -1,97 +0,0 @@
--TEST--
Backtrace during attribute instance creation
--FILE--
<?php
#[Attribute]
class MyAttribute {
public function __construct() {
debug_print_backtrace();
var_dump(debug_backtrace());
var_dump((new Exception)->getTrace());
}
}
#[MyAttribute]
class Test {}
(new ReflectionClass(Test::class))->getAttributes()[0]->newInstance();
?>
--EXPECTF--
#0 MyAttribute->__construct() called at [%s031_backtrace.php:12]
#1 ReflectionAttribute->newInstance() called at [%s:%d]
array(2) {
[0]=>
array(7) {
["file"]=>
string(%d) "%s031_backtrace.php"
["line"]=>
int(12)
["function"]=>
string(11) "__construct"
["class"]=>
string(11) "MyAttribute"
["object"]=>
object(MyAttribute)#1 (0) {
}
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
[1]=>
array(7) {
["file"]=>
string(%d) "%s"
["line"]=>
int(%d)
["function"]=>
string(11) "newInstance"
["class"]=>
string(19) "ReflectionAttribute"
["object"]=>
object(ReflectionAttribute)#2 (0) {
}
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
}
array(2) {
[0]=>
array(6) {
["file"]=>
string(%d) "%s031_backtrace.php"
["line"]=>
int(12)
["function"]=>
string(11) "__construct"
["class"]=>
string(11) "MyAttribute"
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
[1]=>
array(6) {
["file"]=>
string(%d) "%s"
["line"]=>
int(%d)
["function"]=>
string(11) "newInstance"
["class"]=>
string(19) "ReflectionAttribute"
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
}
@@ -1,9 +0,0 @@
--TEST--
Validation for "Attribute" does not use a scope when evaluating constant ASTs
--FILE--
<?php
#[Attribute(parent::x)]
class x extends y {}
?>
--EXPECTF--
Fatal error: Cannot access "parent" when no class scope is active in %s on line %d
+1 -1
View File
@@ -12,4 +12,4 @@ try {
?>
--EXPECTF--
Warning: Undefined variable $nonesuchvar in %s on line %d
array_walk(): Argument #2 ($callback) must be a valid callback, first array member is not a valid class name or object
array_walk(): Argument #2 ($funcname) must be a valid callback, first array member is not a valid class name or object
+2 -2
View File
@@ -23,8 +23,8 @@ object(Foo)#1 (1) {
string(3) "bat"
}
Warning: Object of class Foo could not be converted to int in %s on line %d
Notice: Object of class Foo could not be converted to int in %sbug33999.php on line 9
int(1)
Warning: Object of class Foo could not be converted to float in %s on line %d
Notice: Object of class Foo could not be converted to float in %sbug33999.php on line 12
float(1)
+1 -1
View File
@@ -6,7 +6,7 @@ memory_limit=8M
<?php
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
if ($zend_mm_enabled === "0") {
die("skip Zend MM disabled");
die("skip Zend MM disabled");
}
?>
--FILE--
+1 -1
View File
@@ -23,4 +23,4 @@ echo "Done\n";
--EXPECT--
Done
Fatal error: Registered shutdown function self::on_shutdown() cannot be called, function does not exist in Unknown on line 0
Warning: (Registered shutdown functions) Unable to call self::on_shutdown() - function does not exist in Unknown on line 0
+1 -1
View File
@@ -23,5 +23,5 @@ try {
?>
DONE
--EXPECT--
str_pad() expects at least 2 arguments, 1 given
str_pad() expects at least 2 parameters, 1 given
DONE
+5 -1
View File
@@ -22,8 +22,12 @@ C::s();
$c = new C();
$c->s();
get_called_class();
?>
--EXPECT--
--EXPECTF--
Called class: D
Called class: C
Called class: C
Warning: get_called_class() called from outside a class in %s on line %d
+1 -1
View File
@@ -16,7 +16,7 @@ register_shutdown_function('exploDe');
--EXPECT--
int(1)
Fatal error: Uncaught ArgumentCountError: explode() expects at least 2 arguments, 0 given in [no active file]:0
Fatal error: Uncaught ArgumentCountError: explode() expects at least 2 parameters, 0 given in [no active file]:0
Stack trace:
#0 [internal function]: explode()
#1 {main}
+2 -6
View File
@@ -10,15 +10,11 @@ $foo = -sin(0);
var_dump($foo);
try {
var_dump(1.0 / -0.0);
} catch (\DivisionByZeroError $e) {
echo $e->getMessage() . \PHP_EOL;
}
var_dump(@(1.0 / -0.0));
?>
--EXPECT--
float(-0)
float(-0)
float(-0)
Division by zero
float(-INF)
+1 -1
View File
@@ -14,6 +14,6 @@ var_dump(constant('__COMPILER_HALT_OFFSET__1'.chr(0)));
?>
--EXPECTF--
Warning: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d
Notice: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d
int(1)
int(4)
+1 -1
View File
@@ -6,7 +6,7 @@ memory_limit=8M
<?php
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
if ($zend_mm_enabled === "0") {
die("skip Zend MM disabled");
die("skip Zend MM disabled");
}
?>
--FILE--
+1 -1
View File
@@ -3,7 +3,7 @@ Bug #54547: wrong equality of string numbers near LONG_MAX with 64-bit longs
--SKIPIF--
<?php
if (PHP_INT_MAX !== 9223372036854775807)
die("skip for 64-bit long systems only");
die("skip for 64-bit long systems only");
--FILE--
<?php
var_dump("9223372036854775807" == "9223372036854775808");
+1 -1
View File
@@ -3,7 +3,7 @@ Bug #62097: fix for bug #54547 is wrong for 32-bit machines
--SKIPIF--
<?php
if (PHP_INT_MAX !== 2147483647)
die('skip for system with 32-bit wide longs only');
die('skip for system with 32-bit wide longs only');
--FILE--
<?php
var_dump("02147483647" == "2147483647",
+2
View File
@@ -1,5 +1,7 @@
--TEST--
Bug #69871 (Short-circuiting failure with smart_branch)
--INI--
opcache.enable=0
--FILE--
<?php
+7 -10
View File
@@ -60,26 +60,23 @@ try {
}
?>
--EXPECT--
Variable div
Type: DivisionByZeroError
Message: Division by zero
--EXPECTF--
Warning: Division by zero in %sbug69957.php on line %d
float(INF)
Variable mod
Type: DivisionByZeroError
Message: Modulo by zero
Literal div
Type: DivisionByZeroError
Message: Division by zero
Warning: Division by zero in %sbug69957.php on line %d
float(INF)
Literal mod
Type: DivisionByZeroError
Message: Modulo by zero
Double div
Type: DivisionByZeroError
Message: Division by zero
Warning: Division by zero in %sbug69957.php on line %d
float(INF)
Double mod
Type: DivisionByZeroError
+2
View File
@@ -1,5 +1,7 @@
--TEST--
Bug #70089 (segfault in PHP 7 at ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER ())
--INI--
opcache.enable=0
--FILE--
<?php
function dummy($a) {
+1 -1
View File
@@ -6,7 +6,7 @@ memory_limit=2M
<?php
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
if ($zend_mm_enabled === "0") {
die("skip Zend MM disabled");
die("skip Zend MM disabled");
}
?>
--FILE--
+1 -1
View File
@@ -7,4 +7,4 @@ $x = (new ReflectionFunction("substr"))->getClosure();
$x->call(new a);
?>
--EXPECTF--
Warning: Cannot rebind scope of closure created from function in %s on line %d
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
+1 -1
View File
@@ -18,5 +18,5 @@ var_dump($c);
Warning: Cannot bind method SplDoublyLinkedList::count() to object of class cls in %s on line %d
NULL
Warning: Cannot rebind scope of closure created from method in %s on line %d
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
NULL
+2 -2
View File
@@ -3,7 +3,7 @@ Bug #70914 zend_throw_or_error() format string vulnerability
--SKIPIF--
<?php
if (!extension_loaded("pdo_sqlite")) {
die("skip pdo_sqlite required");
die("skip pdo_sqlite required");
}
?>
--FILE--
@@ -18,4 +18,4 @@ try {
}
?>
--EXPECT--
PDOStatement::fetchObject(): Argument #1 ($class) must be a valid class name, %Z given
PDOStatement::fetchObject(): Argument #1 ($class_name) must be a valid class name, %Z given
+1
View File
@@ -1,6 +1,7 @@
--TEST--
Bug #71067 (Local object in class method stays in memory for each call)
--INI--
opcache.enable=0
error_reporting=0
--FILE--
<?php
+6 -18
View File
@@ -3,21 +3,9 @@ Bug #71841 (EG(error_zval) is not handled well)
--FILE--
<?php
$z = unserialize('O:1:"A":0:{}');
try {
var_dump($z->e.=0);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump(++$z->x);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump($z->y++);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
@var_dump($z->e.=0);
@var_dump(++$z->x);
@var_dump($z->y++);
$y = array(PHP_INT_MAX => 0);
try {
@@ -37,9 +25,9 @@ try {
}
?>
--EXPECT--
The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
NULL
NULL
NULL
Cannot add element to the array as the next element is already occupied
Cannot add element to the array as the next element is already occupied
Cannot add element to the array as the next element is already occupied
+12 -9
View File
@@ -6,18 +6,21 @@ Bug #72038 (Function calls with values to a by-ref parameter don't always throw
try {
test($foo = new stdClass);
var_dump($foo);
} catch (Error $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
try {
test($bar = 2);
var_dump($bar);
} catch (Error $e) {
echo $e->getMessage() . "\n";
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
try {
test($baz = &$bar);
var_dump($baz);
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
test($baz = &$bar);
var_dump($baz);
function test(&$param) {
$param = 1;
@@ -25,6 +28,6 @@ function test(&$param) {
?>
--EXPECT--
test(): Argument #1 ($param) cannot be passed by reference
test(): Argument #1 ($param) cannot be passed by reference
Exception: Cannot pass parameter 1 by reference
Exception: Cannot pass parameter 1 by reference
int(1)
+1 -1
View File
@@ -13,4 +13,4 @@ try {
}
?>
--EXPECT--
func_get_args() expects exactly 0 arguments, 4 given
func_get_args() expects exactly 0 parameters, 4 given
+2
View File
@@ -1,5 +1,7 @@
--TEST--
Bug #72594 (Calling an earlier instance of an included anonymous class fatals)
--INI--
opcache.enable=0
--FILE--
<?php
if (isset($runtime)) {
+1 -1
View File
@@ -12,7 +12,7 @@ change(list($val) = $array);
var_dump($array);
?>
--EXPECTF--
Fatal error: Uncaught Error: change(): Argument #1 ($ref) cannot be passed by reference in %s:%d
Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
+1 -1
View File
@@ -12,7 +12,7 @@ var_dump(function ($someThing) {});
object(Closure)#2 (1) {
["parameter"]=>
array(1) {
["$num"]=>
["$number"]=>
string(10) "<required>"
}
}
+15 -6
View File
@@ -16,14 +16,23 @@ class T {
}
$x = new T;
try {
$x->x = 1;
} catch (\DivisionByZeroError $e) {
echo $e->getMessage() . \PHP_EOL;
}
$x->x = 1;
?>
--EXPECTF--
Warning: Undefined variable $undefined in %s on line %d
Warning: Attempt to read property "1" on null in %s on line %d
Division by zero
Warning: Division by zero in %s on line %d
Warning: Undefined variable $undefined in %s on line %d
Warning: Attempt to read property "NAN" on null in %s on line %d
Warning: Division by zero in %s on line %d
Warning: Undefined variable $undefined in %s on line %d
Warning: Attempt to read property "NAN" on null in %s on line %d
Warning: Division by zero in %s on line %d
+3
View File
@@ -1,5 +1,8 @@
--TEST--
Bug #76754 (parent private constant in extends class memory leak)
--INI--
opcache.enable=0
opcache.enable_cli=0
--FILE--
<?php
+1 -1
View File
@@ -6,7 +6,7 @@ memory_limit=33M
<?php
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
if ($zend_mm_enabled === "0") {
die("skip Zend MM disabled");
die("skip Zend MM disabled");
}
?>
--FILE--
+2 -2
View File
@@ -22,5 +22,5 @@ namespace Foo {
?>
--EXPECT--
Exception: similar_text(): Argument #3 ($percent) cannot be passed by reference
Exception: similar_text(): Argument #3 ($percent) cannot be passed by reference
Exception: Cannot pass parameter 3 by reference
Exception: Cannot pass parameter 3 by reference
+2
View File
@@ -1,5 +1,7 @@
--TEST--
Bug #78379 (Cast to object confuses GC, causes crash)
--INI--
opcache.enable=0
--FILE--
<?php
class C {
+7 -7
View File
@@ -3,23 +3,23 @@ Bug #79599 (coredump in set_error_handler)
--FILE--
<?php
set_error_handler(function($code, $message){
throw new \Exception($message);
throw new \Exception($message);
});
function test1(){
$a[] = $b;
$a[] = $b;
}
function test2(){
$a[$c] = $b;
$a[$c] = $b;
}
try{
test1();
test1();
}catch(\Exception $e){
var_dump($e->getMessage());
var_dump($e->getMessage());
}
try{
test2();
test2();
}catch(\Exception $e){
var_dump($e->getMessage());
var_dump($e->getMessage());
}
?>
--EXPECT--
+1 -1
View File
@@ -5,7 +5,7 @@ Bug #79783: Segfault in php_str_replace_common
str_replace("a", "b", "c", strlen("d"));
?>
--EXPECTF--
Fatal error: Uncaught Error: str_replace(): Argument #4 ($count) cannot be passed by reference in %s:%d
Fatal error: Uncaught Error: Cannot pass parameter 4 by reference in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
+4 -10
View File
@@ -3,7 +3,7 @@ bug79897: Promoted constructor params with attribs cause crash
--FILE--
<?php
#[Attribute]
@@Attribute
class B {
public function __construct($value)
{
@@ -12,27 +12,21 @@ class B {
class A {
public function __construct(
#[B(12, X)] public $b
@@B(12) public $b
)
{
}
}
const X = 42;
var_dump((new ReflectionParameter(['A', '__construct'], 'b'))->getAttributes()[0]->getArguments());
var_dump((new ReflectionProperty('A', 'b'))->getAttributes()[0]->getArguments());
?>
--EXPECT--
array(2) {
array(1) {
[0]=>
int(12)
[1]=>
int(42)
}
array(2) {
array(1) {
[0]=>
int(12)
[1]=>
int(42)
}
-22
View File
@@ -1,22 +0,0 @@
--TEST--
Bug #79979 (passing value to by-ref param via CUF(A) crashes)
--FILE--
<?php
namespace Foo;
call_user_func_array("str_replace", ["a", "b", "c", new \stdClass]);
call_user_func_array("str_replace", ["a", "b", "c", "count" => new \stdClass]);
\call_user_func_array("str_replace", ["a", "b", "c", new \stdClass]);
\call_user_func_array("str_replace", ["a", "b", "c", "count" => new \stdClass]);
?>
--EXPECTF--
Warning: str_replace(): Argument #4 ($count) must be passed by reference, value given in %s on line %d
Warning: str_replace(): Argument #4 ($count) must be passed by reference, value given in %s on line %d
Warning: str_replace(): Argument #4 ($count) must be passed by reference, value given in %s on line %d
Warning: str_replace(): Argument #4 ($count) must be passed by reference, value given in %s on line %d
-19
View File
@@ -1,19 +0,0 @@
--TEST--
Bug #80030: Optimizer segfault with isset on static property with undef dynamic class name
--FILE--
<?php
function test() {
var_dump(isset($className::$test));
}
test();
?>
--EXPECTF--
Warning: Undefined variable $className in %s on line %d
Fatal error: Uncaught Error: Class name must be a valid object or a string in %s:%d
Stack trace:
#0 %s(%d): test()
#1 {main}
thrown in %s on line %d
-32
View File
@@ -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"
}
-22
View File
@@ -1,22 +0,0 @@
--TEST--
Bug #80045: memleak after two set_exception_handler calls with __call
--FILE--
<?php
class x {
public function __construct(){
set_exception_handler([$this, 'dummyExceptionHandler']);
set_exception_handler([$this, 'dummyExceptionHandler']);
set_error_handler([$this, 'dummyErrorHandler']);
set_error_handler([$this, 'dummyErrorHandler']);
}
public function __call($m, $p) {}
}
new x;
?>
===DONE===
--EXPECT--
===DONE===
-22
View File
@@ -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
-14
View File
@@ -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"
}
-24
View File
@@ -1,24 +0,0 @@
--TEST--
Bug #80055: Abstract trait methods returning "self" cannot be fulfilled by traits
--FILE--
<?php
trait AbstractTrait {
abstract public function selfReturner(): self;
}
trait ConcreteTrait {
public function selfReturner(): self {
return $this;
}
}
class Test {
use AbstractTrait;
use ConcreteTrait;
}
?>
===DONE===
--EXPECT--
===DONE===
-14
View File
@@ -1,14 +0,0 @@
--TEST--
Bug #80096: Segmentation fault with named arguments in nested call
--FILE--
<?php
function println($arg) {
echo $arg, "\n";
}
println(htmlentities("The < character is encoded as &lt;", double_encode: false));
?>
--EXPECT--
The &lt; character is encoded as &lt;
-23
View File
@@ -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===
-27
View File
@@ -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===
-20
View File
@@ -1,20 +0,0 @@
--TEST--
Bug #80184: Complex expression in while / if statements resolves to false incorrectly
--FILE--
<?php
$callbacks = [
function () { echo "First item!\n"; },
function () { echo "Second item!\n"; },
function () { echo "Third item!\n"; },
function () { echo "Fourth item!\n"; },
];
while ($callback = array_shift($callbacks) and ($callback() || true));
?>
--EXPECT--
First item!
Second item!
Third item!
Fourth item!
-22
View File
@@ -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) {
}
-24
View File
@@ -1,24 +0,0 @@
--TEST--
Bug #80255: Opcache bug (bad condition result) in 8.0.0rc1
--FILE--
<?php
function test($a, $b, $c) {
do {
if ($a && !$b) {
break;
} else if ($b) {
echo "foo\n";
}
echo "bar\n";
} while ($c);
echo "baz\n";
}
test(true, true, false);
?>
--EXPECT--
foo
bar
baz
-23
View File
@@ -1,23 +0,0 @@
--TEST--
Iterable not covariant to mixed
--FILE--
<?php
class A {
public function method1(): mixed {}
public function method2(): array|object {}
public function method3(iterable $x) {}
public function method4(iterable $x) {}
}
class B extends A {
public function method1(): iterable {}
public function method2(): iterable {}
public function method3(mixed $x) {}
public function method4(array|object $x) {}
}
?>
===DONE===
--EXPECT--
===DONE===
-11
View File
@@ -1,11 +0,0 @@
--TEST--
Bug #80404: Incorrect range inference result when division results in float
--FILE--
<?php
$n = 63;
var_dump((int) ($n / 120 * 100));
?>
--EXPECT--
int(52)
+2 -2
View File
@@ -37,5 +37,5 @@ namespace testing {
?>
--EXPECT--
string(6) "foobar"
call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access private method testing\foo::priv()
call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access protected method testing\foo::prot()
call_user_func(): Argument #1 ($function) must be a valid callback, cannot access private method testing\foo::priv()
call_user_func(): Argument #1 ($function) must be a valid callback, cannot access protected method testing\foo::prot()
Loaded 100 of 3527 files, more files were not shown because too many files have changed in this diff. Show more