Doc #80639 [NEW]: Sample code getting error

From: Date: Mon, 18 Jan 2021 08:55:40 +0000
Subject: Doc #80639 [NEW]: Sample code getting error
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18416@lists.php.net to get a copy of this message
From: guvenacar at hotmail dot com Operating system: windows PHP version: 8.0.1 Package: *Spelling functions Bug Type: Documentation Problem Bug description:Sample code getting error 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 bug report at https://bugs.php.net/bug.php?id=80639&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80639&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80639&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80639&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80639&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80639&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80639&r=support Expected behavior: https://bugs.php.net/fix.php?id=80639&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80639&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80639&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80639&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80639&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80639&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80639&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80639&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80639&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80639&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80639&r=mysqlcfg

« previous php.doc.bugs (#18416) next »