Jump to content


Recommended Posts

Basically never. Others have asked for it, but it's likely that it won't happens for a while. When it finally does happen, it'll be updated on Johnny.


I've been here 3 years, and as far as i can remember, php has never been updated in any meaningful way.

Link to comment
Share on other sites

That's fair enough :) . Still learning a lot about php, and found out what to do if function array dereferencing isn't an option.


It's simple and probably obvious enough, but just incase someone stumbles upon this looking for info on what to do if function array dereferencing isn't available,


w/ FAD example:


return $this->results()[0];


w/o FAD example:


list($first_value) = $this->results();

return $first_value;



I hope those examples are enough to show the difference :P .


Also, if the above examples seem to be of any use, might a mod add tags to this thread equivalent to something like "Function" "Array" "Dereferencing" ? I don't see an option to do it myself.

Link to comment
Share on other sites

When I need to do something like that (returning value X of an array that comes from a function/method):


$aTemp = $this->results();

return $aTemp[0];


I do this because it saves the entire results() output in case you want to put code between the definition of $aTemp and return.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...