note 92860 deleted from functions.returning-values by danbrown

From: Date: Wed, 12 Aug 2009 16:47:32 +0000
Subject: note 92860 deleted from functions.returning-values by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-159386@lists.php.net to get a copy of this message
Note Submitter: Tristan Laurillard ---- Coming from a javascript background, I am surprised that: <?PHP function a() { return array('alpha', 'beta', 'gamma'); } $b = a(); echo $b[0]; // returns: alpha // BUT: echo a()[0]; // returns an error ! ?> Or is there perhaps a good reason for this?

« previous php.notes (#159386) next »