News Feed
Jobs Feed
Sections




News Archive
feed this:

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

Gonzalo Ayuso's Blog:
New features in PHP5.4 alpha1
July 04, 2011 @ 14:36:10

In a new post Gonzalo Ayuso talks about some of the new features in the recently released PHP 5.4 alpha, including some code examples.

We already have the php5.4 alpha ready for testing. This new release has a few features that I really like. The lack of those features gave me problems in the past. Because of that, I'm very excited waiting for the new stable release of PHP 5.4.

There's several features included in the release, but he spotlights some of the major ones - support for array dereferencing, indirect method calls through arrays, reintroduction of using "$this" in closures and traits support.

0 comments voice your opinion now!
alpha release language feature array dereference function traits


Freek Lijten's Blog:
Currently on PHP's internals...
June 16, 2011 @ 08:57:16

Freek Lijten has a recent post looking at some of the types of discussions that happen on the php-internals mailing list.

The internals list is the place to be to hear about the current state of PHP. It is one of PHP's many mailing lists, but this is the one where (core) developers discuss new features, current bugs and wild ideas. If you want to keep up with things it is a good idea to sign up, it is not an extremely high volume list and if you ignore the noise it is quite informative. In this article I would like to share examples of stuff typically discussed on the list.

He mentions feature requests in general and, more specifically things like traits support (multiple inheritance), array dereferencing, callable arrays and the debate over the short array syntax.

0 comments voice your opinion now!
phpinternals mailing list traits array dereference callable short syntax


Luc de Brouwer's Blog:
Stop waiting, start array dereferencing in PHP now!
September 07, 2010 @ 13:37:09

In this recent post to his blog Luc de Brouwer makes a recommendation about dereferencing your arrays - start thinking about it now even before the feature's added to the stable release!

Ever since I started programming object oriented PHP I've been using function chaining and function dereferencing. But there is another thing I'd like to be able to do that was added to the PHP trunk over 8 months ago that still hasn't made it to the current release. The function I'm referring to is array dereferencing.

The trick of dereferencing arrays is that you can pull out a value from a returned array without having to use another line of code (i.e. "foo()['a']"). His suggestion is that you start thinking that way now, but use a sort of hack function to pull it off - one that takes the array and a key and returns that value. There's other suggestions in the comments on how to do things differently though.

0 comments voice your opinion now!
array dereference function example


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



Community Events











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


unittest opinion code package overview hhvm facebook podcast component symfony2 introduction release framework language example application security composer install hack

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