Doc #75901 [NEW]: (Chinese,zh)Example Diff with Other language, And Error
| From: | zhangshulin2008 at live dot cn | Date: | Thu, 01 Feb 2018 03:36:26 +0000 |
| Subject: | Doc #75901 [NEW]: (Chinese,zh)Example Diff with Other language, And Error | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-15399@lists.php.net to get a copy of this message | ||
From: zhangshulin2008 at live dot cn
Operating system: All
PHP version: 7.2Git-2018-02-01 (snap)
Package: Translation problem
Bug Type: Documentation Problem
Bug description:(Chinese,zh)Example Diff with Other language, And Error
Description:
------------
Documentation "New Features in 7.1" translation for Chinese:
No.3 Symmetric array destructuring
http://php.net/manual/zh/migration71.new-features.php
In Chinese:
Zh:
çæ°ç»è¯æ³ï¼[]ï¼ç°å¨å¯ä»¥ç¨äºå°æ°ç»çå¼èµç»ä¸äºåéï¼å
æ¬å¨foreachä¸ï¼ã
è¿ç§æ¹å¼ä½¿ä»æ°ç»ä¸æåå¼å徿´ä¸ºå®¹æã
<?php
$data = [
['id' => 1, 'name' => 'Tom'],
['id' => 2, 'name' => 'Fred'],
];
while (['id' => $id, 'name' => $name] = $data) {
// logic here with $id and $name
}
http://php.net/manual/en/migration71.new-features.php
In Other:
En:
Symmetric array destructuring ¶
The shorthand array syntax ([]) may now be used to destructure arrays
for assignments (including within foreach), as an alternative to the
existing list() syntax, which is still supported.
<?php
$data = [
[1, 'Tom'],
[2, 'Fred'],
];
// list() style
list($id1, $name1) = $data[0];
// [] style
[$id1, $name1] = $data[0];
// list() style
foreach ($data as list($id, $name)) {
// logic here with $id and $name
}
// [] style
foreach ($data as [$id, $name]) {
// logic here with $id and $name
}
JA:
é
åã®çç¸®æ§æ ([]) ã使ã£ã¦ã
代å
¥ç¨ã«é
åã®å¤ãåãåºããããã«ãªãã¾ãã
(foreach ã§ã使ãã¾ã)ã ããã¯ãlist()
ã®ä»£æ¿ã¨ãã¦ä½¿ãã¾ã (list()
ãã¾ã 使ãã¾ã)ã
<?php
$data = [
[1, 'Tom'],
[2, 'Fred'],
];
// list() å½¢å¼
list($id1, $name1) = $data[0];
// [] å½¢å¼
[$id1, $name1] = $data[0];
// list() å½¢å¼
foreach ($data as list($id, $name)) {
// $id 㨠$name
ã使ãå¦çãããã«æ¸ãã¾ã
}
// [] å½¢å¼
foreach ($data as [$id, $name]) {
// $id 㨠$name
ã使ãå¦çãããã«æ¸ãã¾ã
}
Test script:
---------------
/
Expected result:
----------------
/
Actual result:
--------------
/
--
Edit bug report at https://bugs.php.net/bug.php?id=75901&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75901&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75901&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75901&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75901&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75901&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75901&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75901&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75901&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75901&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75901&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75901&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75901&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75901&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75901&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75901&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75901&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75901&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75901&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75901&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75901&r=mysqlcfg