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
3 changes: 3 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ PHP 8.6 UPGRADE NOTES
. EAI_INTR.
. EAI_IDN_ENCODE.

- Standard
. ARRAY_FILTER_USE_KEY.

========================================
11. Changes to INI File Handling
========================================
Expand Down
20 changes: 20 additions & 0 deletions Zend/tests/gh20628_005.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--TEST--
Failed assertion for assignment in expression context
--CREDITS--
Matteo Beccati (mbeccati)
--FILE--
<?php

function foo() {
return ['bar' => 'baz'];
}

var_dump(($v = foo())['bar'], $v);

?>
--EXPECT--
string(3) "baz"
array(1) {
["bar"]=>
string(3) "baz"
}
1 change: 0 additions & 1 deletion Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -12303,7 +12303,6 @@ static zend_op *zend_compile_var_inner(znode *result, zend_ast *ast, uint32_t ty
zend_compile_assign_ref(result, ast, type);
return NULL;
case ZEND_AST_ASSIGN:
ZEND_ASSERT(ast->child[0]->kind == ZEND_AST_ARRAY && zend_propagate_list_refs(ast->child[0]));
zend_compile_assign(result, ast, false, type);
return NULL;
default:
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/basic_functions.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,7 @@ function array_product(array $array): int|float {}

function array_reduce(array $array, callable $callback, mixed $initial = null): mixed {}

function array_filter(array $array, ?callable $callback = null, int $mode = 0): array {}
function array_filter(array $array, ?callable $callback = null, int $mode = ARRAY_FILTER_USE_KEY): array {}

function array_find(array $array, callable $callback): mixed {}

Expand Down
4 changes: 2 additions & 2 deletions ext/standard/basic_functions_arginfo.h

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