Features in PHP trunk: Array dereferencing
Trackbacks
Array dereferencing nun endlich in PHP!
Es wird nun bald endlich möglich sein, auf Array Rückgaben einer Methode direkt anhand eines Schlüssels eine Auswahl zu treffen, ohne den Wert zunächst in eine temporäre Variable zu schreiben:
Es wird nun bald endlich möglich sein, auf Array Rückgaben einer Methode direkt anhand eines Schlüssels eine Auswahl zu treffen, ohne den Wert zunächst in eine temporäre Variable zu schreiben:
Weblog: Julian Pustkuchen
Tracked: Aug 03, 10:00
Tracked: Aug 03, 10:00
[PHP]Array dereferencing(??????????)?php-trunk???
おお。。。 I was writing about new features in the upcoming PHP version (5.4, 6.0?) before. Today’s topic reads like this in the NEWS file: - Added array dereferencing support. (Felipe) Features in PHP trunk: Array dereferencing - Johannes Schl
おお。。。 I was writing about new features in the upcoming PHP version (5.4, 6.0?) before. Today’s topic reads like this in the NEWS file: - Added array dereferencing support. (Felipe) Features in PHP trunk: Array dereferencing - Johannes Schl
Weblog: Do You PHP ???
Tracked: Aug 03, 17:04
Tracked: Aug 03, 17:04
PHP 5.4 Alpha 1
Recently PHP 5.4.0 Alpha 1 was released and the PHP development team is asking every PHP user to test it. In this blog I have some articles about upcoming features in that version. Now is a good time to test 5.4 in combination with your applications spot
Recently PHP 5.4.0 Alpha 1 was released and the PHP development team is asking every PHP user to test it. In this blog I have some articles about upcoming features in that version. Now is a good time to test 5.4 in combination with your applications spot
Weblog: Johannes Schlüter
Tracked: Jul 02, 02:24
Tracked: Jul 02, 02:24
Saturday, July 31. 2010 at 14:47 (Reply)
Saturday, July 31. 2010 at 14:47 (Link) (Reply)
Saturday, July 31. 2010 at 15:51 (Link) (Reply)
Saturday, July 31. 2010 at 16:15 (Reply)
Saturday, July 31. 2010 at 21:03 (Link) (Reply)
Monday, August 2. 2010 at 06:52 (Link) (Reply)
Monday, August 2. 2010 at 09:46 (Link) (Reply)
Monday, August 2. 2010 at 19:11 (Link) (Reply)
Tuesday, August 3. 2010 at 08:39 (Link) (Reply)
[geshi lang=php]get_data()[2] = 'I';[/geshi]
a method that is prefixed with get, that actually sets a variable, seriously? Although this is just a "stupid" example as you say, I'm afraid that this improvement will actually be used like this. So for me, usefull improvement? I actually don't think so, wonderfull? Not at all.
Tuesday, August 3. 2010 at 08:45 (Link) (Reply)
Agreed, in some situations I did wish a feature like this would exist, but in most cases I was just being lazy and should have used a temporary variable, with a descriptive name, anyway.
But most scripters already are having huge difficulties writing maintainable code, and this will not help.
Tuesday, August 3. 2010 at 08:52 (Link) (Reply)
Array dereferencing, namespaces and closures are making PHP behave more and more like java(script) which i think is a good thing, i love javascript
Tuesday, August 3. 2010 at 09:53 (Link) (Reply)
Thank you for the information and big thx to the guy who implemented and evaluated this.
Tuesday, August 3. 2010 at 16:34 (Link) (Reply)
Concerning the critics, all the features that make php flexible can be misused. This is a feature that just feels naturally, after having object dereferencing.
Great work!
Tuesday, August 3. 2010 at 17:49 (Reply)
Tuesday, August 3. 2010 at 21:43 (Reply)
Tuesday, August 3. 2010 at 23:01 (Link) (Reply)
Tuesday, August 3. 2010 at 23:38 (Link) (Reply)
Wednesday, August 4. 2010 at 01:12 (Reply)
Saturday, August 7. 2010 at 21:25 (Reply)
Previously you had to pollute code with stupid temporary variables, eg.
$tmp = $obj->getCall();
if($tmp['result'] == 2) {
etc.
Tuesday, August 10. 2010 at 22:26 (Reply)
Wednesday, August 11. 2010 at 21:06 (Link) (Reply)
With that you can now remove stupid var, however this not save memory (because PHP is based on Copy on Write method).
Another good feature will be like :
echo false || 'ok'; // print ok
This will be very great with closure
Tuesday, August 24. 2010 at 20:43 (Link) (Reply)
PHP is rather easy language, which provokes even non-educated people to try it out. This would be fine if the very same people try to educate and become more advanced developers. Unfortunately, this is not the case and putting more power to their hands is a disaster.
Wednesday, September 8. 2010 at 16:53 (Reply)
function s() {
return "abc";
}
echo s()[2];
Saturday, September 17. 2011 at 17:39 (Reply)
For example will in work:
echo explode(",", $someString)[0];
???
Wednesday, October 12. 2011 at 17:39 (Reply)
echo false ?: 'ok'; // print ok