Re: Whacky increment/assignment logic with $foo++ vs ++$foo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrea Giammarchi wrote:


if used properly, could avoid recursion, and speed up operations ... there is nothing wrong with goto, everything we write on lowest level is a jump in the memory (as goto is a jump in the code flow)

++goto ... and not goto++

I forgot, I have always used goto in Batch script, which indeed can emulates functions, except there is no recursion problem. I have a couple of batches online if interesting, and from performances point of view, ask yourself why on earth PHP core developers have introduced goto and actually somebody is using it ;-)

Uh, I forgot I live in microoptimization land ... lol

If you read the archives for PHP Internals you can view the discussion that went into the final decision to include GOTO. It happened 2 or 3 years ago and I was certainly on the side arguing in its favour. The GOTO used in languages such as C and now PHP, is not the bastard GOTO of BASIC yesteryear. There are certainly use cases where the use of GOTO makes far more sense than other constructs. Finite state machines (often used in parsing) are one such place. In fact if you grep for goto on any major open source project's C code, you will probably find multiple occurrences. PHP, MySQL, and Apache all use goto.

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux