News 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:
Goto your Christmas presents with PHP 5.3
January 06, 2009 @ 10:20:56

Johannes Schluter recently looked at one of the new features coming with PHP 5.3 - the goto functionality:

Over the last few days I already mentioned a few hidden gems from PHP 5.3. Now at Christmas I wanted to take a look at some new language feature of the upcoming PHP version: Added "jump label" operator (limited "goto"). (Dmitry, Sara)

No, its not the sort of "goto" you're thinking of - its a bit more limited than that. Johannes mentions that it only allows you to jump within the same execution unit and you can't jump into loops. Used incorrectly, it can be bad but he points out two useful instances - one being a code generator and the other an instance where you might need to drop out of code but not kill off the script in the process (sample code is included for this second one).

0 comments voice your opinion now!
php5 goto new feature generate error handle


blog comments powered by Disqus

Similar Posts

Eirik Hoem's Blog: Book review: Expert PHP5 Tools

DevShed: Defining Public and Protected Methods with Member Visibility in PHP 5

WebReference.com: Access Control (in a PHP5 CMS)

Shantanu Goel's Blog: Migrating From PHP4 To PHP5: Solving WP-Cache (and maybe other) Issues

Greg Beaver's Blog: PHP_ParserGenerator and PHP_LexerGenerator


Community Events





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


series library package language laravel release interview install list opinion symfony bugfix voicesoftheelephpant introduction framework podcast api deployment tips community

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