News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Johannes Schluter's Blog:
Features in PHP trunk Array dereferencing
August 02, 2010 @ 10:41:09

In a recent post to his blog Johannes Schluter talks about a new feature that's just been added to the PHP project's trunk - array dereferencing.

Now you might wonder what this typical short entry means. when doing OO-style PHP you might make use of a syntax feature which one might call "object dereferencing". [...] So one can chain method calls or property access. Now for a long time people requested the same thing for array offset access. This was often rejected due to uncertainties about memory issues, as we don't like memory leaks. But after proper evaluation Felipe committed the patch.

This new feature allows you to return an array from a method and reference it in a new way outside the call - foo()[2] - where the array is like "array(1,2,3)". Johannes includes a few other examples, including how to set the information in an array (using referneces) inside a method.

6 comments voice your opinion now!
array dereference trunk patch snapshot


blog comments powered by Disqus

Similar Posts

Felix Geisendorfer's Blog: Model::save() now returns an array!

Nikita Popov's Blog: Understanding PHP's internal array implementation (Part 4)

PHP.net: PHP 5.3.5 and 5.2.17 Released!

Expirmentalworks.net: Inofficial PHP GIT repositories - Importing large trees

Wez Furlong: OpenID (and TypeKey) using native OpenSSL functions in PHP


Community Events











Don't see your event here?
Let us know!


hhvm package application language podcast release composer performance framework component install facebook hack introduction unittest database project symfony2 security example

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework