|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-12-30 19:36 UTC] aharvey@php.net
-Status: Open
+Status: Assigned
-Package: Arrays related
+Package: Scripting Engine problem
-Assigned To:
+Assigned To: aharvey
[2016-12-30 19:36 UTC] aharvey@php.net
[2016-12-30 19:57 UTC] aharvey@php.net
[2016-12-30 19:58 UTC] aharvey@php.net
-Status: Assigned
+Status: Closed
[2016-12-30 19:58 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 04:00:01 2025 UTC |
Description: ------------ The following code works fine under earlier PHP versions including PHP 7.0.x, however it results in fatal error "Cannot use lexical variable $variable as a parameter name inside array_walk()" under PHP 7.1 Test script: --------------- $value = 'b'; $checkbox_values = ['a' => 'Aaa', 'b' => 'Bbb', 'c' => 'Ccc']; array_walk($checkbox_values, function(&$value, $key) use($value) { $value = (int)(strval($key) === $value); }); print_r($checkbox_values); Expected result: ---------------- Array ( [a] => 0 [b] => 1 [c] => 0 ) Actual result: -------------- Fatal error: Cannot use lexical variable $value as a parameter name in / on line 4