aRadiatedN00dle Posted September 16, 2014 Posted September 16, 2014 Hello ! I was just wondering how often you guys update PHP?I would like to be able to use function array dereferencing, but unfortunately that's a feature native to PHP 5.4+
wolstech Posted September 16, 2014 Posted September 16, 2014 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.
aRadiatedN00dle Posted September 16, 2014 Author Posted September 16, 2014 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 . 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.
wolstech Posted September 16, 2014 Posted September 16, 2014 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.
aRadiatedN00dle Posted September 18, 2014 Author Posted September 18, 2014 Hmm, I might actually do it that way as well. Thanks for the suggestion, and for your time as well !
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now