Doc #80639 [PATCH]: [TR] foreach sample code getting error
Edit report at https://bugs.php.net/bug.php?id=80639&edit=1
ID: 80639
Patch added by: hallberg.kim@gmail.com
Reported by: guvenacar at hotmail dot com
Summary: [TR] foreach sample code getting error
Status: Verified
Type: Documentation Problem
Package: Translation problem
Operating System: windows
PHP Version: 8.0.1
Block user comment: N
Private report: N
New Comment:
The following pull request has been associated:
Patch Name: [80639] Fix foreach sample code error
On GitHub: https://github.com/php/doc-tr/pull/4
Patch: https://github.com/php/doc-tr/pull/4.patch
Previous Comments:
------------------------------------------------------------------------
[2021-01-18 08:55:40] guvenacar at hotmail dot com
Description:
------------
---
From manual page: https://php.net/control-structures.foreach
---
Below code that in Turkish page, getting error when testing
Parse error: syntax error, unexpected token "=" in C:\xampp\htdocs\VSCodeTest\index.php on
line 4
Test script:
---------------
<?php
$dizi = array("bir", "iki", "üç");
foreach ($arr as &$value) {
deÄer = deÄer * 2;
}
// $dizi Åimdi array(2, 4, 6, 8)
// unset($deÄer) olmaksızın, $deÄer hala son öÄeye gösterimli olur: $dizi[3]
foreach ($dizi as $key => $deÄer) {
// $dizi[3] artık $dizi içindeki her deÄerle güncellenecek
echo "{$key} => {$deÄer} ";
print_r($dizi);
}
// ...ikinciden son deÄere kadar son deÄere kopyalanacak.
// çıktı:
// 0 => 2 Array ( [0] => 2, [1] => 4, [2] => 6, [3] => 2 )
// 1 => 4 Array ( [0] => 2, [1] => 4, [2] => 6, [3] => 4 )
// 2 => 6 Array ( [0] => 2, [1] => 4, [2] => 6, [3] => 6 )
// 3 => 6 Array ( [0] => 2, [1] => 4, [2] => 6, [3] => 6 )
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80639&edit=1
Thread (4 messages)