Doc #74064 [Fbk->NoF]: [ZH] è¿ä¸ªä¹è½é???
Edit report at https://bugs.php.net/bug.php?id=74064&edit=1
ID: 74064
Updated by: php-bugs@lists.php.net
Reported by: bhg at live dot it
Summary: [ZH] è¿ä¸ªä¹è½é???
-Status: Feedback
+Status: No Feedback
Type: Documentation Problem
Package: Translation problem
Operating System: Windows
PHP Version: 7.1.1
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2017-02-13 06:13:47] laruence@php.net
ä½ æ³è¯´åªééäº?
what the problem here?
thanks
------------------------------------------------------------------------
[2017-02-09 01:27:26] bhg at live dot it
Description:
------------
---
From manual page: http://php.net/manual/zh/migration71.new-features.php
---
Test script:
---------------
$data = [
['id' => 1, 'name' => 'Tom'],
['id' => 2, 'name' => 'Fred'],
];
while (['id' => $id, 'name' => $name] = $data) {
echo $id, $name;
// logic here with $id and $name
}
Expected result:
----------------
$data = [
["id" => 1, "name" => 'Tom'],
["id" => 2, "name" => 'Fred'],
];
// list() style
list("id" => $id1, "name" => $name1) = $data[0];
// [] style
["id" => $id1, "name" => $name1] = $data[0];
// list() style
foreach ($data as list("id" => $id, "name" => $name)) {
// logic here with $id and $name
}
// [] style
foreach ($data as ["id" => $id, "name" => $name]) {
// logic here with $id and $name
}
Actual result:
--------------
$data = [
['id' => 1, 'name' => 'Tom'],
['id' => 2, 'name' => 'Fred'],
];
while (['id' => $id, 'name' => $name] = $data) {
echo $id, $name;
// logic here with $id and $name
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74064&edit=1
Thread (3 messages)