Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3a14ce1
Fix stubs of DateTimeZone->getTransitions (#17992)
marc-mabe Jun 4, 2025
6820a4d
Fix GH-18579: --libdir option default value
remicollet May 19, 2025
690cde6
UPGRADING: minor typo fixes
Ayesh Jun 1, 2025
f46f42b
Implement request #55503: Extend __getTypes to support enumerations (…
ndossche Jun 4, 2025
2f5ef4d
Use custom OpenSSL libctx in md and cipher handling code (#18516)
bukka Jun 4, 2025
111072a
Fix GH-18744: PHP 8.4 classList works not correctly if copy HTMLEleme…
ndossche Jun 3, 2025
307ff3b
Merge branch 'PHP-8.4'
ndossche Jun 4, 2025
2b38384
Fix handling of references in zval_try_get_long()
ndossche Jun 4, 2025
be17e9e
Merge branch 'PHP-8.4'
ndossche Jun 4, 2025
e13ba36
ext/tidy: anticipate tidyOptIsReadOnly retirement.
devnexen Jun 4, 2025
ecc9393
Merge branch 'PHP-8.3' into PHP-8.4
devnexen Jun 4, 2025
1aae2ad
Merge branch 'PHP-8.4'
devnexen Jun 4, 2025
7f91462
Remove nonsensical code from odbc_execute() (#18767)
ndossche Jun 4, 2025
42f6c15
Fix bug #74796: Requests through http proxy set peer name
bukka Feb 21, 2025
086a470
Merge branch 'PHP-8.3' into PHP-8.4
bukka Jun 5, 2025
9ae5b4e
Merge branch 'PHP-8.4'
bukka Jun 5, 2025
91becb3
ext/tidy: config options checks strengthening.
devnexen Jun 3, 2025
444cc78
Skip OpenSSL proxy test for bug #74796 on Windows
bukka Jun 5, 2025
d15e119
Use cheaper functions to get member name in PDO (#18769)
ndossche Jun 5, 2025
7a15d2a
Merge branch 'PHP-8.3' into PHP-8.4
bukka Jun 5, 2025
688fed3
Merge branch 'PHP-8.4'
bukka Jun 5, 2025
d40e320
ext/tidy: Use uint32_t and bool types instead of unsigned int type
Girgias Jun 5, 2025
b7db5c8
ext/tidy: Remove TIDY_SET_CONTEXT macro
Girgias Jun 5, 2025
4fd91c6
ext/tidy: Use RETURN_THROWS() macro
Girgias Jun 5, 2025
bf3d7d1
ext/tidy: Use RETURN_STR() instead of RETVAL_STR() + return;
Girgias Jun 5, 2025
2505781
ext/tidy: Use RETURN_BOOL() where possible
Girgias Jun 5, 2025
feff538
ext/tidy: Reduce scope of variable and rename to prevent variable sha…
Girgias Jun 5, 2025
d97a90a
ext/tidy: Use zend_result type instead of int type
Girgias Jun 5, 2025
19b1173
ext/tidy: Add some const qualifiers
Girgias Jun 5, 2025
4162c20
Fix compile without ZEND_MM_STORAGE
ndossche Jun 5, 2025
976143e
Merge branch 'PHP-8.3' into PHP-8.4
ndossche Jun 5, 2025
99d5624
Merge branch 'PHP-8.4'
ndossche Jun 5, 2025
8f3cdf6
gen_stub: Add support for attributes on constants in stubs (#18735)
DanielEScherzer Jun 5, 2025
2751064
use XSSE for bcmath (#18770)
SakiTakamachi Jun 5, 2025
e549ccb
ext/pdo_pgsql: Delete unused constants
vrana Apr 19, 2025
cc1f1c6
[skip ci] giving proper credits to last changes in ext/pdo_pgsql
devnexen Jun 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ PHP NEWS
. Implement GH-15387 Pdo\Pgsql::setAttribute(PDO::ATTR_PREFETCH, 0) or
Pdo\Pgsql::prepare(…, [ PDO::ATTR_PREFETCH => 0 ]) make fetch() lazy
instead of storing the whole result set in memory (Guillaume Outters)
. Removed unused constants Pdo\Pgsql::TRANSACTION_* (vrana).

- PDO_SQLITE:
. throw on null bytes / resolve GH-13952 (divinity76).
Expand Down Expand Up @@ -190,6 +191,8 @@ PHP NEWS
. Fix namespace handling of WSDL and XML schema in SOAP,
fixing at least GH-16320 and bug #68576. (nielsdos)
. Fixed bug #70951 (Segmentation fault on invalid WSDL cache). (nielsdos)
. Implement request #55503 (Extend __getTypes to support enumerations).
(nielsdos, datibbaw)

- Sockets:
. Added IPPROTO_ICMP/IPPROTO_ICMPV6 to create raw socket for ICMP usage.
Expand Down Expand Up @@ -242,6 +245,10 @@ PHP NEWS
- Tests:
. Allow to shuffle tests even in non-parallell mode. (dhuang00)

- Tidy:
. tidy::__construct/parseFile/parseString methods throw an exception if
the configuration argument is invalid. (David Carlier)

- Windows:
. Fixed bug GH-10992 (Improper long path support for relative paths). (cmb,
nielsdos)
Expand Down
36 changes: 24 additions & 12 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ PHP 8.5 UPGRADE NOTES
have run and the output handlers have been cleaned up.
This is a consequence of fixing GH-18033.
. Traits are now bound before the parent class. This is a subtle behavioral
change, but should closer match user expectations, demonstrated by GH-15753
and GH-16198.
change, but should more closely match user expectations, demonstrated by
GH-15753 and GH-16198.

- FileInfo:
. finfo_file() and finfo::file() now throws a ValueError instead of a
Expand Down Expand Up @@ -91,7 +91,7 @@ PHP 8.5 UPGRADE NOTES
argument when fetching into an object, will now throw an Error.
. The value of the constants PDO::FETCH_GROUP, PDO::FETCH_UNIQUE,
PDO::FETCH_CLASSTYPE, PDO::FETCH_PROPS_LATE, and PDO::FETCH_SERIALIZE
has changed.
have changed.
. A ValueError is now thrown if PDO::FETCH_PROPS_LATE is used with a fetch
mode different than PDO::FETCH_CLASS, consistent with other fetch flags.
. A ValueError is now thrown if PDO::FETCH_INTO is used as a fetch mode in
Expand All @@ -101,6 +101,9 @@ PHP 8.5 UPGRADE NOTES
. A ValueError is now thrown when trying to set a cursor name that is too
long on a PDOStatement resulting from the Firebird driver.

- PDO_PGSQL:
. Removed unused constants Pdo\Pgsql::TRANSACTION_*.

- Session:
. Attempting to write session data where $_SESSION has a key containing
the pipe character will now emit a warning instead of silently failing.
Expand Down Expand Up @@ -158,7 +161,7 @@ PHP 8.5 UPGRADE NOTES
CURLINFO_USED_PROXY gets zero set if no proxy was used in the
previous transfer or a non-zero value if a proxy was used.
CURLINFO_HTTPAUTH_USED and CURLINFO_PROXYAUTH_USED get bitmasks
indicating the http and proxy authentication methods that were
indicating the HTTP and proxy authentication methods that were
used in the previous request. See CURLAUTH_* constants for
possible values.
. Added CURLOPT_INFILESIZE_LARGE Curl option, which is a safe
Expand All @@ -168,10 +171,10 @@ PHP 8.5 UPGRADE NOTES
accepts the largest integer value the system can handle.
. Added CURLFOLLOW_OBEYCODE, CURLFOLLOW_FIRSTONLY and CURLFOLLOW_ALL values for
CURLOPT_FOLLOWLOCATION curl_easy_setopt option.
CURLFOLLOW_OBEYCODE to follow more strictly in regard of redirect
CURLFOLLOW_OBEYCODE to follow more strictly in regard to redirect
if they are allowed. CURLFOLLOW_FIRSTONLY to follow only the
first redirect thus if there any follow up redirect, it won't go
any further. CURLFOLLOW_ALL is equivalent to set CURLOPT_FOLLOWLOCATION
first redirect thus if there is any follow up redirect, it won't go
any further. CURLFOLLOW_ALL is equivalent to setting CURLOPT_FOLLOWLOCATION
to true.

- DOM:
Expand All @@ -187,13 +190,16 @@ PHP 8.5 UPGRADE NOTES
number formats.
. Added Locale::addLikelySubtags and Locale::minimizeSubtags to
handle likely tags on a given locale.
. Added IntlListFormatter class to format, order, punctuates
. Added IntlListFormatter class to format, order, and punctuate
a list of items with a given locale, IntlListFormatter::TYPE_AND,
IntlListFormatter::TYPE_OR, IntlListFormatter::TYPE_UNITS operands and
IntlListFormatter::WIDTH_WIDE, IntlListFormatter::WIDTH_SHORT and
IntlListFormatter::WIDTH_NARROW widths.
It is supported from icu 67.

- SOAP:
. Enumeration cases are now dumped in __getTypes().

- XSL:
. The $namespace argument of XSLTProcessor::getParameter(),
XSLTProcessor::setParameter() and XSLTProcessor::removeParameter()
Expand Down Expand Up @@ -247,7 +253,7 @@ PHP 8.5 UPGRADE NOTES
was actually never possible.

- LDAP:
. ldap_get_option() now accept a NULL connection, as ldap_set_option(),
. ldap_get_option() now accepts a NULL connection, as ldap_set_option(),
to allow retrieval of global options.

- libxml:
Expand All @@ -260,7 +266,7 @@ PHP 8.5 UPGRADE NOTES
. PDO::pgsqlCopyFromArray also supports inputs as Iterable.
. Pdo\Pgsql::setAttribute and Pdo\Pgsql::prepare supports
PDO::ATTR_PREFETCH sets to 0 which set to lazy fetch mode.
In this mode, statements cannot be run parallely.
In this mode, statements cannot be run in parallel.

- PDO_SQLITE:
. SQLite PDO::quote() will now throw an exception or emit a warning,
Expand All @@ -287,7 +293,7 @@ PHP 8.5 UPGRADE NOTES
are enum cases rather than normal class constants.

- Session:
. session_start is stricter in regard of the option argument.
. session_start is stricter in regard to the option argument.
It throws a ValueError if the whole is not a hashmap or
a TypeError if read_on_close value is not a valid type
compatible with int.
Expand All @@ -304,7 +310,7 @@ PHP 8.5 UPGRADE NOTES
ValueError if the port is lower than 0 or greater than 65535,
also if any of the hints array entry is indexes numerically.
. socket_addrinfo_lookup throws a TypeError if any of the hints
values cannot be cast to a int and can throw a ValueError if
values cannot be cast to int and can throw a ValueError if
any of these values overflow.
. socket_set_option with MCAST_LEAVE_GROUP/MCAST_LEAVE_SOURCE_GROUP
options will throw an exception if the value isn't a valid object
Expand All @@ -313,6 +319,12 @@ PHP 8.5 UPGRADE NOTES
. socket_getsockname gets the interface index and its string
representation with AF_PACKET socket.

- Tidy:
. tidy::__construct/parseFile/parseString now throws a ValueError
if the configuration contains an invalid or set a read-only
internal entry, a TypeError contains, at least, one element
when the key is not a string.

- Zlib:
. The "use_include_path" argument for the
gzfile, gzopen and readgzfile functions had been changed
Expand Down
4 changes: 4 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ PHP 8.5 INTERNALS UPGRADE NOTES
without duplicate build rules. It is up to the SAPI maintainers to ensure
that appropriate build rules are created.

- Linux build system changes
. libdir is properly set when --libdir (ex: /usr/lib64) and --with-libdir (ex lib64)
configure options are used to ${libdir}/php (ex: /usr/lib64/php)

========================
3. Module changes
========================
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/e_strict-deprecated.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ var_dump(E_STRICT);
--EXPECTF--
int(30719)

Deprecated: Constant E_STRICT is deprecated in %s on line %d
Deprecated: Constant E_STRICT is deprecated since 8.4, the error level was removed in %s on line %d
int(2048)
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ class MyDateTimeZone extends DateTimeZone
}
?>
--EXPECTF--
Fatal error: Declaration of MyDateTimeZone::getTransitions(): array|false must be compatible with DateTimeZone::getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX): array|false in %s on line %d
Fatal error: Declaration of MyDateTimeZone::getTransitions(): array|false must be compatible with DateTimeZone::getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = 2147483647): array|false in %s on line %d
2 changes: 1 addition & 1 deletion Zend/zend_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3417,7 +3417,7 @@ ZEND_API zend_mm_storage *zend_mm_get_storage(zend_mm_heap *heap)
#if ZEND_MM_STORAGE
return heap->storage;
#else
return NULL
return NULL;
#endif
}

Expand Down
7 changes: 7 additions & 0 deletions Zend/zend_attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define ZEND_ATTRIBUTES_H

#include "zend_compile.h"
#include "zend_constants.h"

#define ZEND_ATTRIBUTE_TARGET_CLASS (1<<0)
#define ZEND_ATTRIBUTE_TARGET_FUNCTION (1<<1)
Expand Down Expand Up @@ -126,6 +127,12 @@ static zend_always_inline zend_attribute *zend_add_class_constant_attribute(zend
return zend_add_attribute(&c->attributes, name, argc, flags, 0, 0);
}

static zend_always_inline zend_attribute *zend_add_global_constant_attribute(zend_constant *c, zend_string *name, uint32_t argc)
{
uint32_t flags = ZEND_CONSTANT_MODULE_NUMBER(c) == PHP_USER_CONSTANT ? 0 : ZEND_ATTRIBUTE_PERSISTENT;
return zend_add_attribute(&c->attributes, name, argc, flags, 0, 0);
}

void zend_register_attribute_ce(void);
void zend_attributes_shutdown(void);

Expand Down
3 changes: 2 additions & 1 deletion Zend/zend_constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ static void copy_zend_constant(zval *zv)
c->filename = zend_string_copy(c->filename);
}
if (c->attributes != NULL) {
c->attributes = zend_array_dup(c->attributes);
// Use the same attributes table
GC_ADDREF(c->attributes);
}
if (Z_TYPE(c->value) == IS_STRING) {
Z_STR(c->value) = zend_string_dup(Z_STR(c->value), 1);
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_constants.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
/**
* @var int
* @cvalue E_STRICT
* @deprecated
* @todo Remove in PHP 9.0
*/
#[\Deprecated(since: '8.4', message: 'the error level was removed')]
const E_STRICT = UNKNOWN;

/**
Expand Down
16 changes: 15 additions & 1 deletion Zend/zend_constants_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Zend/zend_operators.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ static zend_always_inline zend_result zendi_try_convert_scalar_to_number(zval *o
static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(const zval *op, bool *failed) /* {{{ */
{
*failed = 0;
try_again:
switch (Z_TYPE_P(op)) {
case IS_NULL:
case IS_FALSE:
Expand Down Expand Up @@ -448,6 +449,14 @@ static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(const zval *
case IS_ARRAY:
*failed = 1;
return 0;
case IS_REFERENCE:
op = Z_REFVAL_P(op);
if (Z_TYPE_P(op) == IS_LONG) {
return Z_LVAL_P(op);
} else {
goto try_again;
}
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
}
Expand Down
68 changes: 58 additions & 10 deletions build/gen_stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -2622,6 +2622,13 @@ public function __construct(
?ExposedDocComment $exposedDocComment,
bool $isFileCacheAllowed
) {
foreach ($attributes as $attr) {
if ($attr->class === "Deprecated") {
$isDeprecated = true;
break;
}
}

$this->name = $name;
$this->value = $value;
$this->valueString = $valueString;
Expand Down Expand Up @@ -2915,17 +2922,11 @@ protected function getFlagsByPhpVersion(): array
{
$flags = parent::getFlagsByPhpVersion();

// $this->isDeprecated also accounts for any #[\Deprecated] attributes
if ($this->isDeprecated) {
$flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_DEPRECATED", PHP_80_VERSION_ID);
}

foreach ($this->attributes as $attr) {
if ($attr->class === "Deprecated") {
$flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_DEPRECATED", PHP_80_VERSION_ID);
break;
}
}

if ($this->flags & Modifiers::FINAL) {
$flags = $this->addFlagForVersionsAbove($flags, "ZEND_ACC_FINAL", PHP_81_VERSION_ID);
}
Expand Down Expand Up @@ -4340,7 +4341,7 @@ private function handleStatements(array $stmts, PrettyPrinterAbstract $prettyPri
$cond,
$this->isUndocumentable,
$this->getMinimumPhpVersionIdCompatibility(),
[]
AttributeInfo::createFromGroups($stmt->attrGroups)
);
}
continue;
Expand Down Expand Up @@ -5177,7 +5178,9 @@ static function (FuncInfo $funcInfo) use ($fileInfo, &$generatedFunctionDeclarat
$php80MinimumCompatibility = $fileInfo->getMinimumPhpVersionIdCompatibility() === null || $fileInfo->getMinimumPhpVersionIdCompatibility() >= PHP_80_VERSION_ID;

if ($fileInfo->generateClassEntries) {
if ($attributeInitializationCode = generateFunctionAttributeInitialization($fileInfo->funcInfos, $allConstInfos, $fileInfo->getMinimumPhpVersionIdCompatibility(), null)) {
$attributeInitializationCode = generateFunctionAttributeInitialization($fileInfo->funcInfos, $allConstInfos, $fileInfo->getMinimumPhpVersionIdCompatibility(), null);
$attributeInitializationCode .= generateGlobalConstantAttributeInitialization($fileInfo->constInfos, $allConstInfos, $fileInfo->getMinimumPhpVersionIdCompatibility(), null);
if ($attributeInitializationCode) {
if (!$php80MinimumCompatibility) {
$attributeInitializationCode = "\n#if (PHP_VERSION_ID >= " . PHP_80_VERSION_ID . ")" . $attributeInitializationCode . "#endif\n";
}
Expand Down Expand Up @@ -5289,6 +5292,51 @@ static function (FuncInfo $funcInfo) use ($allConstInfos, $phpVersionIdMinimumCo
);
}

/**
* @param iterable<ConstInfo> $constInfos
* @param array<string, ConstInfo> $allConstInfos
*/
function generateGlobalConstantAttributeInitialization(
iterable $constInfos,
array $allConstInfos,
?int $phpVersionIdMinimumCompatibility,
?string $parentCond = null
): string {
$isConditional = false;
if ($phpVersionIdMinimumCompatibility !== null && $phpVersionIdMinimumCompatibility < PHP_85_VERSION_ID) {
$isConditional = true;
$phpVersionIdMinimumCompatibility = PHP_85_VERSION_ID;
}
$code = generateCodeWithConditions(
$constInfos,
"",
static function (ConstInfo $constInfo) use ($allConstInfos, $phpVersionIdMinimumCompatibility) {
if ($constInfo->attributes === []) {
return null;
}
$constName = str_replace('\\', '\\\\', $constInfo->name->__toString());
$constVarName = 'const_' . $constName;

$code .= "\tzend_constant *$constVarName = zend_hash_str_find_ptr(EG(zend_constants), \"" . $constName . "\", sizeof(\"" . $constName . "\") - 1);\n";
foreach ($constInfo->attributes as $key => $attribute) {
$code .= $attribute->generateCode(
"zend_add_global_constant_attribute($constVarName",
$constVarName . "_$key",
$allConstInfos,
$phpVersionIdMinimumCompatibility
);
}

return $code;
},
$parentCond
);
if ($code && $isConditional) {
return "\n#if (PHP_VERSION_ID >= " . PHP_85_VERSION_ID . ")\n" . $code . "#endif\n";
}
return $code;
}

/**
* @param iterable<ConstInfo> $constInfos
* @param array<string, ConstInfo> $allConstInfos
Expand Down Expand Up @@ -6030,7 +6078,7 @@ function initPhpParser() {
}

$isInitialized = true;
$version = "5.3.1";
$version = "5.5.0";
$phpParserDir = __DIR__ . "/PHP-Parser-$version";
if (!is_dir($phpParserDir)) {
installPhpParser($version, $phpParserDir);
Expand Down
Loading