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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: guvenacar at hotmail dot com
New email:
PHP Version: OS:

 

 [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

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
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Mar 06 14:01:22 2021 UTC