#23920 [NEW]: array index of function result does not parse: func()[10]

From: Date: Sat, 31 May 2003 12:44:40 +0000
Subject: #23920 [NEW]: array index of function result does not parse: func()[10]
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-40778@lists.php.net to get a copy of this message
From: dustin+php at cs dot uchicago dot edu Operating system: Solaris, Linux PHP version: 4.3.1 PHP Bug Type: Feature/Change Request Bug description: array index of function result does not parse: func()[10] Why can't I do this: $year = getdate($timestamp)['year']; (syntax error) while I can do this: $temp = getdate($timestamp); $year = $temp['year']; it seems that a complete parser should be able to parse the first line. Others have suggested writing a function to duplicate this functionality, but this can get pretty ugly. Still others have suggested eval(), but that's playing with fire when you're using data from the network. -- Edit bug report at http://bugs.php.net/?id=23920&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23920&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23920&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23920&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23920&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23920&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23920&r=support Expected behavior: http://bugs.php.net/fix.php?id=23920&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23920&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23920&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23920&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23920&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23920&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23920&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23920&r=gnused

« previous php.bugs (#40778) next »