Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 26 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ PHP NEWS
(iliaal, Xuyang Zhang)
. Fixed grapheme_str_split() treating UBRK_DONE as a byte index. (iliaal)

- Opcache:
. Fixed a tracing JIT crash when compiling a side trace for a method of a
class that could not be stored in the inheritance cache. (GH-21710)
(Arnaud, iliaal)

- PDO:
. Fixed a leak when a persistent connection failed a liveness check
with no other live PDO handle. (iliaal)
Expand Down Expand Up @@ -79,13 +84,34 @@ PHP NEWS
(lazerg)
. SessionHandler::validateId() is now implemented, so
session.use_strict_mode applies to the built-in handler. (Girgias)
. It is now deprecated to pass an object that does not implement the
create_sid() and validateId() methods. (Girgias)
. A deprecation is now emitted when implementing SessionHandlerInterface on a
class which doesn't define the create_sid() or validateId() methods, as
those will be moved from SessionUpdateTimestampHandlerInterface and
SessionIdInterface to SessionHandlerInterface. (Girgias)

- SNMP:
. It is now possible to use the AES192, AES192C, AES256, and AES256C as
SNMPv3 security protocols if the underlying library supports them.
(eskyuu)
. It is now possible to reset the MIB tree using the new snmp_read_mib()
function. (eskyuu)
. Additional MIB parsing and output control functionality has been exposed
via the snmp_set_mib_option(), snmp_set_output_option(),
snmp_set_string_output_format() functions, the $numeric_index,
$numeric_timeticks, $extended_index, $dont_print_units, $escape_quotes,
$print_hex_text SNMP properties, and the SNMP::setOidOutputFormat(),
SNMP::setStringOutputFormat() methods. (eskyuu)

- Sodium:
. Fixed incorrect parameter name in sodium_add(), sodium_memcmp(), and
sodium_compare() length-mismatch error messages. (lacatoire)

- Standard:
. Fixed incorrect parameter name in convert_uudecode() warning. (lacatoire)
. Added support for the "<" and ">" endianness modifiers in pack() and
unpack() format codes. (alexandre-daubois)

- Zip:
. Fixed bug GH-17787 (ZipArchive stream stops reading early when the archive
Expand Down
45 changes: 45 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,29 @@ PHP 8.6 UPGRADE NOTES
influences the result of the phar buildFrom family of functions.
This makes it possible to override the timestamp and names of files.

- SNMP:
. It is now possible to use the AES192, AES192C, AES256, and AES256C as
SNMPv3 security protocols if the underlying library supports them.
RFC: https://wiki.php.net/rfc/snmp_improvements_2026#increase_the_number_of_snmpv3_security_protocols_supported
. It is now possible to reset the MIB tree using the new snmp_read_mib()
function.
RFC: https://wiki.php.net/rfc/snmp_improvements_2026#allow_the_snmp_mib_to_be_reset
. Additional MIB parsing and output control functionality has been exposed
via the snmp_set_mib_option(), snmp_set_output_option(),
snmp_set_string_output_format() functions, the $numeric_index,
$numeric_timeticks, $extended_index, $dont_print_units, $escape_quotes,
$print_hex_text SNMP properties, and the SNMP::setOidOutputFormat(),
SNMP::setStringOutputFormat() methods. (eskyuu)
RFC: https://wiki.php.net/rfc/snmp_improvements_2026#implement_more_mib_parsing_and_value_output_controls

- Standard:
. pack() and unpack() now accept the "<" and ">" endianness modifiers on
the signed and unsigned integer format codes.
RFC: https://wiki.php.net/rfc/pack-unpack-endianness-signed-integers-support
. pack() and unpack() now accept the "<" and ">" endianness modifiers on
the float and double format codes.
RFC: https://wiki.php.net/rfc/pack-unpack-float-endianness-modifier

- Streams:
. Added new stream errors API including new classes, enums, functions and
internal API. It is controlled using error_mode, error_store and
Expand Down Expand Up @@ -514,6 +537,16 @@ PHP 8.6 UPGRADE NOTES
an object and a static method is now deprecated.
RFC: https://wiki.php.net/rfc/deprecations_php_8_6#deprecate_reflectionmethodinvoke_and_reflectionmethodinvokeargs_with_objects_for_static_methods

- Session:
. It is now deprecated to pass an object that does not implement the
create_sid() and validateId() methods.
RFC: https://wiki.php.net/rfc/deprecations_php_8_6#deprecate_passing_a_sessionhandler_object_to_session_set_save_handler_which_does_not_contain_the_create_sid_and_validateid
. A deprecation is now emitted when implementing SessionHandlerInterface on a
class which doesn't define the create_sid() or validateId() methods, as
those will be moved from SessionUpdateTimestampHandlerInterface and
SessionIdInterface to SessionHandlerInterface.
RFC: https://wiki.php.net/rfc/deprecations_php_8_6#deprecate_passing_a_sessionhandler_object_to_session_set_save_handler_which_does_not_contain_the_create_sid_and_validateid

- SPL:
. The spl_classes() function is now deprecated, use
ReflectionExtension::getClassNames() instead.
Expand Down Expand Up @@ -660,6 +693,12 @@ PHP 8.6 UPGRADE NOTES
. ReflectionAttribute::getNamespaceName()
. ReflectionAttribute::getShortName()

- SNMP:
. snmp_init_mib()
. snmp_set_mib_option()
. snmp_set_output_option()
. snmp_set_string_output_format()

- Standard:
. clamp() returns the given value if in range, else return the nearest
bound.
Expand Down Expand Up @@ -697,6 +736,12 @@ PHP 8.6 UPGRADE NOTES
RFC: https://wiki.php.net/rfc/tls_session_resumption
. Openssl\Psk

- SNMP:
. enum: Snmp\Mib
. enum: Snmp\OidOutput
. enum: Snmp\Output
. enum: Snmp\StringOutput

- Standard:
. enum SortDirection
RFC: https://wiki.php.net/rfc/sort_direction_enum
Expand Down
5 changes: 5 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ PHP 8.6 INTERNALS UPGRADE NOTES
hand if there is one, E_WARNING for the severity, and
ZEND_ENUM_StreamErrorCode_Generic for the code. terminating should be true
only if the error aborts the operation.
. zend_create_closure(), zend_create_fake_closure() and
zend_create_partial_closure() now take the bound $this as a zend_object*
instead of a zval*. Accordingly, zend_get_closure_this_ptr() now returns
that zend_object*, or NULL when the closure is unbound, instead of a
zval* that is IS_UNDEF when the closure is unbound.

- Added:
. New zend_class_entry.ce_flags2 and zend_function.fn_flags2 fields were
Expand Down
47 changes: 47 additions & 0 deletions Zend/tests/partial_application/default_arg_scope.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
--TEST--
PFA default argument value scope
--ENV--
A=1
--FILE--
<?php

if (getenv('A')) {
/* Relative class references are never resolved at compile time on traits */
trait T {
static function f($a, $b = self::VAL) {
var_dump($b);
}
}
trait U {
static function g($a, $b = parent::VAL) {
var_dump($b);
}
}
}

class C {
const VAL = 'C';
use T;
}

class D extends C {
const VAL = 'D';
use U;
}

C::f(0);
D::f(0);
C::f(?, ...)(0);
D::f(?, ...)(0);

D::g(0);
D::g(?, ...)(0);

?>
--EXPECT--
string(1) "C"
string(1) "C"
string(1) "C"
string(1) "C"
string(1) "C"
string(1) "C"
2 changes: 1 addition & 1 deletion Zend/tests/partial_application/magic_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Closure [ <user> public method {closure:%s:%d} ] {
Parameter #0 [ <required> mixed $arguments0 ]
}
}
ArgumentCountError: Too few arguments to function Foo::{closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
ArgumentCountError: Too few arguments to function Closure::{closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
Foo::method
int(1)
Foo::method
Expand Down
6 changes: 3 additions & 3 deletions Zend/tests/partial_application/magic_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ echo (string) new ReflectionFunction($bar);
$bar(100);
?>
--EXPECTF--
Closure [ <user> static public method {closure:%s:%d} ] {
Closure [ <user> static function {closure:%s:%d} ] {
@@ %s 10 - 10

- Parameters [1] {
Expand All @@ -42,7 +42,7 @@ Foo::method
int(1)
Foo::method
int(1)
Closure [ <user> static public method {closure:%s:%d} ] {
Closure [ <user> static function {closure:%s:%d} ] {
@@ %s 17 - 17

- Parameters [2] {
Expand All @@ -55,7 +55,7 @@ int(10)
Foo::method
int(10)
int(20)
Closure [ <user> static public method {closure:%s:%d} ] {
Closure [ <user> static function {closure:%s:%d} ] {
@@ %s 24 - 24

- Bound Variables [1] {
Expand Down
49 changes: 49 additions & 0 deletions Zend/tests/partial_application/magic_scope.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
--TEST--
Magic method scope
--CREDITS--
Ryan @ Calif.io
--FILE--
<?php

class InstanceTarget
{
private function secret(string $value): void
{
echo "PRIVATE-INSTANCE:$value\n";
}

public function __call(string $name, array $arguments): void
{
echo "MAGIC-INSTANCE:$name:" . implode(',', $arguments) . "\n";
}
}

class StaticTarget
{
private static function secret(string $value): void
{
echo "PRIVATE-STATIC:$value\n";
}

public static function __callStatic(string $name, array $arguments): void
{
echo "MAGIC-STATIC:$name:" . implode(',', $arguments) . "\n";
}
}

$instance = new InstanceTarget();

$instance->secret('direct');
StaticTarget::secret('direct');

$instancePartial = $instance->secret(?);
$staticPartial = StaticTarget::secret(?);
$instancePartial('controlled');
$staticPartial('controlled');

?>
--EXPECT--
MAGIC-INSTANCE:secret:direct
MAGIC-STATIC:secret:direct
MAGIC-INSTANCE:secret:controlled
MAGIC-STATIC:secret:controlled
Loading
Loading