Function Array Dereferencing in PHP 5.4

In my previous post i have discussed new features of PHP 5.4 such as concept of Traits and shorter syntax of array.

In this post i’ll discuss the concept of function array dereferencing which is introduced in PHP 5.4. In simple words function array dereference means when array is returned, pick the value directly from it.

Most Used Array Functions in PHP

Subscribe Our Tutorials

Get Latest Updates on Facebook

Function Array Dereferencing

Let’s understand through example.

In previous version of PHP, to dereference array temporary variable is used. We can’t directly array dereference the result of a function.

But in PHP 5.4 you can do this thing directly without storing the value in another variable.

Let’s take another example.

Learn PHP through Video Tutorials

List of new release features in PHP 5.4.

WebRewrite

About WebRewrite

I am technology lover who loves to keep updated with latest technology. My interest field is Web Development.
Tagged , , , . Bookmark the permalink.
  • rowild

    The example you give picks the –3rd– element, not the 2nd, as you write!

    • rajkumar9788

      Thanks Corrected.