Array dereferencing support in PHP 5.4.0

A new nice improvement in PHP 5.4 As you can see in the news list they added array dereferencing support. What this actually means?

If a method of your class returns an array, then to use a specific element you will need another variable.

Example:

If you want to display ‘myvalue’, you should do something like

In the new PHP version you can do just:

 

One thought on “Array dereferencing support in PHP 5.4.0

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.