Bug #73104 [Opn->Nab]: next causes fatal error on constant array

From: Date: Sun, 18 Sep 2016 16:14:07 +0000
Subject: Bug #73104 [Opn->Nab]: next causes fatal error on constant array
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204114@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73104&edit=1 ID: 73104 Updated by: cmb@php.net Reported by: jerry at jmweb dot net Summary: next causes fatal error on constant array -Status: Open +Status: Not a bug Type: Bug Package: Arrays related Operating System: Windows 7 Pro 64bit PHP Version: 5.6.26 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php next() is supposed to change the array internally, but constant array can't be changed. Previous Comments: ------------------------------------------------------------------------ [2016-09-18 08:03:24] jerry at jmweb dot net Description: ------------ When creating an array constant, the next() function generates a fatal error. The key() and current() functions work as expected. Test script: --------------- const ARRAY_BUG = [ 1, 2 ]; var_dump( key( ARRAY_BUG ), current( ARRAY_BUG ), next( ARRAY_BUG ) ); Expected result: ---------------- int(0) int(1) int(2) Actual result: -------------- Fatal error: Only variables can be passed by reference in ... ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73104&edit=1

« previous php.bugs (#204114) next »