Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Andi Gutmans
At 04:55 PM 7/29/2004 -0700, Sara Golemon wrote: Ack! Gods no Andi is already winding up to rip me a new one for prematurely committing the patch earlier today, don't push him over the edge by suggesting das uberevil ini options, even in jest! ;) -Sara P.S. - Andi: Ya know I love ya more than m

Re: [PHP-DEV] Sorting Bug / Wrong behavior?

2004-07-29 Thread Andi Gutmans
I talked to John about this yesterday. I'll take a closer look at this within the coming days to see if this makes sense and how it affects BC in general (if at all). At 09:45 PM 7/27/2004 +0200, Marcus Boerger wrote: Hello John, Tuesday, July 27, 2004, 9:48:28 PM, you wrote: > Consider the foll

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Jan Dittmer
Andrey Hristov wrote: Robert Cummings wrote: Unmaintainable because of the ability to write cryptic code. There's nothing cryptic about: ...code goto cleanup: ...code cleanup: do { .code... if (something) break; ...code } while (0); ...cleanup code... This works for o

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Sara Golemon
> > I think we should add an INI option: > > > > php_newbie true|false > > > > ;) > > > better make it : > > enable_goto = on|off > of course making the code non-portable :) > Ack! Gods no Andi is already winding up to rip me a new one for prematurely committing the patch earlier today, d

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Andrey Hristov
Ilia Alshanetsky wrote: On July 29, 2004 09:13 pm, Andrey Hristov wrote: Ok, I surrender. Go for it :) I will pray and let God save me from ever maintaining spaghetti goto code :) Andrey, Well, you already have a list of goto enabled languages to avoid, what's one more? :-) What should I do then?

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Ilia Alshanetsky
On July 29, 2004 09:13 pm, Andrey Hristov wrote: > Ok, I surrender. Go for it :) > I will pray and let God save me from ever maintaining spaghetti goto code > :) Andrey, Well, you already have a list of goto enabled languages to avoid, what's one more? :-) Ilia -- PHP Internals - PHP Runtime

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Andrey Hristov
Frank M. Kromann wrote: [snip] The average Joe may not need goto in some case but he will find that it simplifies his job (but making code clumsy, something what he does not realize). It is not because I don't like the power of goto, I would like not to be given in the hands of the newbie. andrey

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Frank M. Kromann
We were all newbies at some point and most of us (not including myself) learned how to handle the language, and so will the newbies of today, even if GOTO is a part of the language. I don't see a need to make this an ini-option. It is allready an option - use t or leave it alone. - Frank > Hello,

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Frank M. Kromann
[snip] > The average Joe may not need goto in some case but he will find that it simplifies > his job (but making code clumsy, something what he does not realize). > It is not because I don't like the power of goto, I would like not to be given in the > hands of the newbie. > > andrey > PHP has

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Andrey Hristov
Jason Garber wrote: Hello, I think we should add an INI option: php_newbie true|false ;) better make it : enable_goto = on|off of course making the code non-portable :) andrey p.s. ok guys and ladies, i am going to sleep a little bit (i need recharging). probably without me the ML will be qui

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Paul G
- Original Message - From: "Jason Garber" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 29, 2004 7:08 PM Subject: Re: [PHP-DEV] GOTO operator > Hello, > > I think we should add an INI option: > > php_newbie true|false i'm +1 on a -DI_KNOW_WHAT_IM_DOING paul

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Jason Garber
Hello, I think we should add an INI option: php_newbie true|false ;) -- Best regards, Jasonmailto:[EMAIL PROTECTED] Thursday, July 29, 2004, 8:54:34 PM, you wrote: AH> Sara Golemon wrote: >>>do { >>> .code... >>> if (something) break; >>> ...code.

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Paul G
- Original Message - From: <[EMAIL PROTECTED]> To: "Paul G" <[EMAIL PROTECTED]> Sent: Thursday, July 29, 2004 6:56 PM Subject: Re: [PHP-DEV] GOTO operator --- snip --- > a simple throw & catch will do the same. structures with function pointers in pure C do basically the same thing as

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Jason Garber
Hello, After thinking about it for a bit, I'm convinced. If goto can be implemented so that it is fast, and does not adversely affect other parts of PHP, by all means, do it. Andrey, you've been very clear why you would not use it, but why do you want me not to use it? I can think of

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Andrey Hristov
Sara Golemon wrote: do { .code... if (something) break; ...code } while (0); ...cleanup code... Are you suggesting a hack is better than the real thing? -Sara The "hack" is working. The manual says : " Advanced C users may be familiar with a different usage of the do..while loop, to a

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Paul G
- Original Message - From: "Edin Kadribasic" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: "Paul G" <[EMAIL PROTECTED]> Sent: Thursday, July 29, 2004 6:55 PM Subject: Re: [PHP-DEV] GOTO operator > On Friday 30 July 2004 00:43, Paul G wrote: > [snip] > > This is exactly the kind of cod

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Ilia Alshanetsky
On July 29, 2004 08:32 pm, Andrey Hristov wrote: > Ilia, my idea is that goto brings problems in most cases and I kind of > saving my donkey (and maybe the donkeys of other people) of some royal pain > when we are pushed to support badly written _legacy_ code. Andrey, Just ask and I'll show you o

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Edin Kadribasic
On Friday 30 July 2004 00:43, Paul G wrote: [snip] This is exactly the kind of code that makes me miss goto so much for error handling. Edin -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Andrey Hristov
Paul G wrote: - Original Message - From: "Andrey Hristov" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, July 29, 2004 8:00 PM Subject: Re: [PHP-DEV] GOTO operator --- snip --- Is the average Joe going to write parsers in the everydays work? Probably

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Sara Golemon
> do { >.code... >if (something) break; >...code > } while (0); > ...cleanup code... > Are you suggesting a hack is better than the real thing? -Sara -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Andrey Hristov
Robert Cummings wrote: Unmaintainable because of the ability to write cryptic code. There's nothing cryptic about: ...code goto cleanup: ...code cleanup: do { .code... if (something) break; ...code } while (0); ...cleanup code... Similar example in the PHP documentati

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Paul G
- Original Message - From: "Andrey Hristov" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, July 29, 2004 8:00 PM Subject: Re: [PHP-DEV] GOTO operator --- snip --- > Is the average Joe going to write parsers in the everydays work? Probably not. how

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Sara Golemon
> Is the average Joe going to write parsers in the everydays work? Probably not. > But give him the power of goto and (s)he is going to shoot him/her in the legs, > in the heart, in the head. And even not only himself because (s)he will create a > legacy code which someone else has to understand an

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Robert Cummings
On Thu, 2004-07-29 at 20:10, Andrey Hristov wrote: > Robert Cummings wrote: > > On Thu, 2004-07-29 at 17:25, Timm Friebe wrote: > > > >>On Thu, 2004-07-29 at 04:12, Sara Golemon wrote: > >> > >>>I wrote up a patch for implementing gotos in php scripts a couple months ago > >>>as an exercise in wor

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Andrey Hristov
Ilia Alshanetsky wrote: Andrey, Here are some more programming languages you may wish to discredit for their goto support. This made me smile :) Fortran, this : http://cvs.php.net/co.php/pecl/stats/dcdflib.c?r=1.1 nice code has been written firstly in Fortran and then converted to C. When I want t

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Ilia Alshanetsky
On July 29, 2004 05:25 pm, Timm Friebe wrote: > In the five or six year's I've been programming PHP, I haven't ever felt > the need to have "goto". Neither have I seen a newsgroup posting related > to it in the two years or so I followed the German PHP newsgroup, > de.comp.lang.php. I must admit t

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Ilia Alshanetsky
Andrey, Here are some more programming languages you may wish to discredit for their goto support. Fortran, C#, Cobol, Ada Ilia On July 29, 2004 08:10 pm, Andrey Hristov wrote: > Robert Cummings wrote: > > On Thu, 2004-07-29 at 17:25, Timm Friebe wrote: > >>On Thu, 2004-07-29 at 04:12, Sara G

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Andrey Hristov
Robert Cummings wrote: On Thu, 2004-07-29 at 17:25, Timm Friebe wrote: On Thu, 2004-07-29 at 04:12, Sara Golemon wrote: I wrote up a patch for implementing gotos in php scripts a couple months ago as an exercise in working with the Zend engine. [...] In the five or six year's I've been programming

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Ilia Alshanetsky
On July 29, 2004 08:00 pm, Andrey Hristov wrote: > Is the average Joe going to write parsers in the everydays work? Probably > not. But give him the power of goto and (s)he is going to shoot him/her in > the legs, in the heart, in the head. And even not only himself because > (s)he will create a le

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Robert Cummings
On Thu, 2004-07-29 at 17:25, Timm Friebe wrote: > On Thu, 2004-07-29 at 04:12, Sara Golemon wrote: > > I wrote up a patch for implementing gotos in php scripts a couple months ago > > as an exercise in working with the Zend engine. > [...] > > In the five or six year's I've been programming PHP, I

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Andrey Hristov
Ilia Alshanetsky wrote: PHP is a not a type strict language, far from it and it is unlikely it'll ever be such. It is also a not pure OOP language and I very much doubt it'll ever be one. While GOTO can be abused, so can any other language feature, such as OOP, or the ability to include remote f

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Timm Friebe
On Thu, 2004-07-29 at 04:12, Sara Golemon wrote: > I wrote up a patch for implementing gotos in php scripts a couple months ago > as an exercise in working with the Zend engine. [...] In the five or six year's I've been programming PHP, I haven't ever felt the need to have "goto". Neither have I s

Re: [PHP-DEV] Sorting Bug / Wrong behavior?

2004-07-29 Thread Marcus Boerger
Hello John, Tuesday, July 27, 2004, 9:48:28 PM, you wrote: > Consider the following: > 0, 'b'=>1, 'c'=>2); > sort($a); > print_r($a); ?>> > This produces a bogus output: > Array > ( > [0] => a > [1] => b > [2] => 0 > [3] => c > [4] => 1 > [5] => 2 > ) > N

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Robert Cummings
On Thu, 2004-07-29 at 11:04, Sara Golemon wrote: > > Note > > > > Goto jumping is O(1) if getting to the jump destination doesn't require > > a hash lookup due to "wuring" of the destination at compile time. If a > > hash lookup is required then it is probably something like O(lg n) which > >

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Sara Golemon
> Note > > Goto jumping is O(1) if getting to the jump destination doesn't require > a hash lookup due to "wuring" of the destination at compile time. If a > hash lookup is required then it is probably something like O(lg n) which > is still superior in efficiency to O(n). Additionally, while

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Robert Cummings
On Thu, 2004-07-29 at 10:17, Leonardo Pedretti wrote: > Goto is somewhat equivalent to 'case' combined with using 'continue' in loops. > More precisely, this 2 language constructions are the 'goto' implementation > with a different name so that Dijkstra does not get back from the grave to > puni

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Lukas Smith
Leonardo Pedretti wrote: Goto is somewhat equivalent to 'case' combined with using 'continue' in loops. More precisely, this 2 language constructions are the 'goto' implementation with a different name so that Dijkstra does not get back from the grave to punish us =D also with exceptions there a

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Ilia Alshanetsky
PHP is a not a type strict language, far from it and it is unlikely it'll ever be such. It is also a not pure OOP language and I very much doubt it'll ever be one. While GOTO can be abused, so can any other language feature, such as OOP, or the ability to include remote files. If we add this fea

Re: [PHP-DEV] Spammer on Bugs page

2004-07-29 Thread Jakub Vrana
Derick Rethans wrote: >> > Perhaps limiting the number of bug report by IP per day and/or limiting >> > the number of bugs with the same words should be implemented. >> I agree. No one likes "Write here the text from image". > IPs can be easily spoofed; we want a turing test. Will you agree with t

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Leonardo Pedretti
Goto is somewhat equivalent to 'case' combined with using 'continue' in loops. More precisely, this 2 language constructions are the 'goto' implementation with a different name so that Dijkstra does not get back from the grave to punish us =D It is true that goto is a little 'off-paradigm' in OO

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Alex Pagnoni
Alle 04:55, giovedì 29 luglio 2004, Ilia Alshanetsky ha scritto: > Goto is an extremely useful for parsers and makes life much easier when > dealing with complex error handling situations. Does a goto operator make sense in a language that wants to be more and more OOP oriented and that has just

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Georg Richter
Am Do, den 29.07.2004 schrieb Ilia Alshanetsky um 4:55: > Goto is an extremely useful for parsers and makes life much easier when > dealing with complex error handling situations. +1 /Georg -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Paul G
- Original Message - From: "Stefan Esser" <[EMAIL PROTECTED]> To: <"Sara Golemon"@utopia.rusko.us>; <[EMAIL PROTECTED]> Sent: Thursday, July 29, 2004 6:05 AM Subject: Re: [PHP-DEV] GOTO operator > Hi, > > > I wrote up a patch for implementing gotos in php scripts a couple months ago > >

Re: [PHP-DEV] TSRM clarifications

2004-07-29 Thread Stefan Esser
Hi, Do I have to worry about these macros in my own functions ? Do I have to worry about them when doing lookups in zend hash tables (which I do to get cookie- and request data) ? It's just annoying not knowing much about them =). TSRM macros are for accessing thread safe globals. If your code make

Re: [PHP-DEV] GOTO operator

2004-07-29 Thread Stefan Esser
Hi, I wrote up a patch for implementing gotos in php scripts a couple months ago as an exercise in working with the Zend engine. I put it aside assuming noone would actually want it, but Wez and Ilia convinced me to post it for consideration: I was really rolling on the floor when I saw this mail,

[PHP-DEV] TSRM clarifications

2004-07-29 Thread Øyvind Stegard
Hello, I recently posted a message to this mailing list with the subject "Overriding PHP file operations - Extended access control", and I got some good replies which helped, thank you for this. Also, as I mentioned in that mail, the PHP source code is new to me. Now that I am actively working