#23920 [Opn->Bgs]: array index of function result does not parse: func()[10]

From: Date: Mon, 03 Apr 2006 10:51:37 +0000
Subject: #23920 [Opn->Bgs]: array index of function result does not parse: func()[10]
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-95258@lists.php.net to get a copy of this message
ID: 23920 Updated by: tony2001@php.net Reported By: dustin+php at cs dot uchicago dot edu -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: Solaris, Linux PHP Version: 4.3.1 New Comment: Duplicate of bug #23022. Previous Comments: ------------------------------------------------------------------------ [2003-05-31 07:44:40] dustin+php at cs dot uchicago dot edu 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 this bug report at http://bugs.php.net/?id=23920&edit=1

« previous php.bugs (#95258) next »