Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.hzend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phptbreak_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt

From: Date: Sun, 05 Mar 2006 11:21:56 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.hzend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phptbreak_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt
References: 1 2  Groups: php.zend-engine.cvs 
Request: Send a blank email to [email protected] to get a copy of this message
Hello Dmitry,

Sunday, March 5, 2006, 11:46:38 AM, you wrote:

> Guys,

> The committed patch was posted into @iternals and discussed at December or
> January. It is not based on PDM's decision, and have nothing common with
> goto semantic.

> THE PATCH REUSES JAVA SYNTAX AND SYMANTIC.

But we are not Java and we don't want to be and we share little Java syntax
semantics. Actually only the keywords 'interface' and 'final' and the fact
that one has to specify visibility for every member of a class. And all of
those are late additions to php in 5. For the rest of php we share c syntax
and semantics. Thus adding any of those strange java workarounds makes out
a very confusing php. Furthermore it means that when adding some java syntax
that exists in C/C++ in a different way we head in a wrong direction.

> I am already developing real goto patch, that will able to reuse same
> labels. And having two different syntaxes for label is stupid.

I see little to no sense for goto in php besides being able to write lexers
and parser - but do you really want that? And if so, who provides the code
generators? When having goto just for some laziness and easier eror handling
then the only thing we gain is support for writing unmaintainable spaghetti
code. (For my self i counted one of my projects i am currently working on,
it consists of close to 10 thousand lines of code by me and there is a
single goto and that is there only for lazyness).

However being able to break out of multiple loops is a nice think when
achivable by name aka label. If that requires goto i would hate it but
not prevent it. Confusing the syntax i will always avoid.

Best regards,
 Marcus


Thread (28 messages)

« previous php.zend-engine.cvs (#4670) next »