Array Dereferencing is really very good feature added in PHP 5.4. With this you can directly access an array object directly of a method a functions.
Now we can say that no more temporary variables in php now. This is becasue earlier we must have to take array in one variable then we can make further process on that array. Have a look at below example for what we were doing before PHP 5.4.
Now have a look at code block for how we can achieve this without temporary varibale:
Isn’t it really helpful??
No more temporary variables with arrays now!!!
Now have a look at be other benefetits of Array Dereferencing in PHP 5.4
As as above code you can deal with functions call also.
For full list of Features included in PHP 5.4, have a look at this article.
Avinash Zala currently working at a leading web development company as a Sr. PHP Web Developer. He is the founder of the Xpert Developer. He has completed B.E. in Information Technology. Born and brought up in Ahmedabad. He loves to code and coding is all about passion for him. Follow him on twitter at Avinash Zala & Xpert Developer.
View all posts by: Avinash