php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80639 [TR] foreach sample code getting error
Submitted: 2021-01-18 08:55 UTC Modified: 2021-01-18 09:04 UTC
From: guvenacar at hotmail dot com Assigned:
Status: Verified Package: Translation problem
PHP Version: 8.0.1 OS: windows
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2021-01-18 08:55 UTC] 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 )
?>


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-01-18 09:04 UTC] requinix@php.net
-Summary: Sample code getting error +Summary: [TR] foreach sample code getting error -Status: Open +Status: Verified -Package: *Spelling functions +Package: Translation problem
 [2021-05-26 11:31 UTC] hallberg dot kim at gmail dot com
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
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 23:01:29 2024 UTC