Andrey Hristov | 1 Aug 2004 02:28

Re: [PHP-DEV] GOTO operator

Sara Golemon wrote:

> Thanks for the pointers, I at least see what I need to be exploring now
> (though I havn't sat down to unfold its meaning yet).  Cetainly the
> implementation given earlier needs work whether its to make it work as
> advertised or in the more limited fashion suggested in other posts.
> 
> I intend to put some work into it regardless of whether it'll be included or
> not.  As I mentioned originally, this entire effort was meant as a learning
> exercise, and it's doing that job.  If it's used: great.  If not, it'll just
> stay where it is and those who want it can still patch it in.
>

How does the GOTO implementation handle this
script1.php
<?php

do_some_stuff();
include script2.php;

label:
   echo "Hello"
?>

script2.php:
<?php
   declare_some_funcs();
    .... some code ...
    if (some_cond) {
       goto label;
(Continue reading)

Andi Gutmans | 1 Aug 2004 02:43
Favicon

[PHP-DEV] PHP 5.0.1

As I mentioned about a week ago, I'd like to roll 5.0.1 (mainly due to the 
auth bug) and some other fixes.
I was thinking of rolling this minor release tomorrow or Tuesday. If you 
have any bug fixes you'd like to make in, please let me know. There's no 
problem with delaying it somewhat more...
Andi

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Sara Golemon | 1 Aug 2004 02:44
Picon

Re: [PHP-DEV] GOTO operator

> How does the GOTO implementation handle this
> script1.php
> <?php
>
> do_some_stuff();
> include script2.php;
>
> label:
>    echo "Hello"
> ?>
>
> script2.php:
> <?php
>    declare_some_funcs();
>     .... some code ...
>     if (some_cond) {
>        goto label;
>      }
>     .... other code....
> ?>
>
Included files are actually separate execution scopes (even though they're
shared data scope).  So the implementation referenced originally would raise
an error saing that 'label' is an undefined label.

-Sara

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
(Continue reading)

Sterling Hughes | 1 Aug 2004 03:13
Picon

Re: [PHP-DEV] GOTO operator

i'm just piping up that i'm a strong +1 on goto, its immensely useful
for code generators, like for example a gui application that wanted to
generate some type of php code.

also, when you start quoting djikstra in a php context, you've lost.  

goto is fine, fight the power!

-sterling

On Sat, 31 Jul 2004 17:44:07 -0700, Sara Golemon <pollita <at> php.net> wrote:
> > How does the GOTO implementation handle this
> > script1.php
> > <?php
> >
> > do_some_stuff();
> > include script2.php;
> >
> > label:
> >    echo "Hello"
> > ?>
> >
> > script2.php:
> > <?php
> >    declare_some_funcs();
> >     .... some code ...
> >     if (some_cond) {
> >        goto label;
> >      }
> >     .... other code....
(Continue reading)

Michael Walter | 1 Aug 2004 03:24

Re: [PHP-DEV] GOTO operator

Paul G wrote:
> ----- Original Message ----- 
> From: "Michael Walter" <cm <at> leetspeak.org>
> To: "Paul G" <paul <at> rusko.us>; <internals <at> lists.php.net>
> Sent: Saturday, July 31, 2004 1:59 PM
> Subject: Re: [PHP-DEV] GOTO operator
> 
> 
> --- snip ---
> 
> 
>>>presumably, you see the need in C because it's the cleanest way to
> 
> free()
> 
>>>all you've malloc()ed along the way, regardless of where you've errored
> 
> out.
> 
>>>in PHP, you've got gc, which (again presumably) makes you think we don't
>>>need goto. i say that we alloc() stuff quite often, but it may be
> 
> objects,
> 
>>>resources, what have you instead of chunks.
>>
>>It's interesting that there is the desire for a low-level construct such
>>as "goto" in order to implement scoped deallocation/deconstruction. I
>>suppose something like C#' using() statement might help you in this
>>case, although suggesting it will surely lead to another discussion ;)
(Continue reading)

Andi Gutmans | 1 Aug 2004 03:31
Favicon

Re: [PHP-DEV] GOTO operator

I'm starting to like goto more and more :)
At least it's a simple concept as opposed to using/scoped which make me dizzy.

At 03:24 AM 8/1/2004 +0200, Michael Walter wrote:
>Paul G wrote:
>>----- Original Message ----- From: "Michael Walter" <cm <at> leetspeak.org>
>>To: "Paul G" <paul <at> rusko.us>; <internals <at> lists.php.net>
>>Sent: Saturday, July 31, 2004 1:59 PM
>>Subject: Re: [PHP-DEV] GOTO operator
>>
>>--- snip ---
>>
>>>>presumably, you see the need in C because it's the cleanest way to
>>free()
>>
>>>>all you've malloc()ed along the way, regardless of where you've errored
>>out.
>>
>>>>in PHP, you've got gc, which (again presumably) makes you think we don't
>>>>need goto. i say that we alloc() stuff quite often, but it may be
>>objects,
>>
>>>>resources, what have you instead of chunks.
>>>
>>>It's interesting that there is the desire for a low-level construct such
>>>as "goto" in order to implement scoped deallocation/deconstruction. I
>>>suppose something like C#' using() statement might help you in this
>>>case, although suggesting it will surely lead to another discussion ;)
>>
>>actually, alloc/dealloc was just used as an example. it could be anything -
(Continue reading)

Michael Walter | 1 Aug 2004 05:50

Re: [PHP-DEV] GOTO operator

Andi Gutmans wrote:
> I'm starting to like goto more and more :)
Good good :)

> At least it's a simple concept as opposed to using/scoped which make me 
> dizzy.
Hehe, I think scoped could be pretty useful, though.

Cheers,
Michael

> 
> At 03:24 AM 8/1/2004 +0200, Michael Walter wrote:
> 
>> Paul G wrote:
>>
>>> ----- Original Message ----- From: "Michael Walter" <cm <at> leetspeak.org>
>>> To: "Paul G" <paul <at> rusko.us>; <internals <at> lists.php.net>
>>> Sent: Saturday, July 31, 2004 1:59 PM
>>> Subject: Re: [PHP-DEV] GOTO operator
>>>
>>> --- snip ---
>>>
>>>>> presumably, you see the need in C because it's the cleanest way to
>>>
>>> free()
>>>
>>>>> all you've malloc()ed along the way, regardless of where you've 
>>>>> errored
>>>
(Continue reading)

Andi Gutmans | 1 Aug 2004 07:44
Favicon

Re: [PHP-DEV] GOTO operator

Well in general if you have an object and leave the function which 
instantiated it, it'll be destroyed (unless you hold a reference to it from 
some global, in which case you probably don't want it to be destroyed). I 
don't think it has to be more fine-grained than that.

At 05:50 AM 8/1/2004 +0200, Michael Walter wrote:
>Andi Gutmans wrote:
>>I'm starting to like goto more and more :)
>Good good :)
>
>>At least it's a simple concept as opposed to using/scoped which make me 
>>dizzy.
>Hehe, I think scoped could be pretty useful, though.
>
>Cheers,
>Michael
>
>>At 03:24 AM 8/1/2004 +0200, Michael Walter wrote:
>>
>>>Paul G wrote:
>>>
>>>>----- Original Message ----- From: "Michael Walter" <cm <at> leetspeak.org>
>>>>To: "Paul G" <paul <at> rusko.us>; <internals <at> lists.php.net>
>>>>Sent: Saturday, July 31, 2004 1:59 PM
>>>>Subject: Re: [PHP-DEV] GOTO operator
>>>>
>>>>--- snip ---
>>>>
>>>>>>presumably, you see the need in C because it's the cleanest way to
>>>>
(Continue reading)

Zeev Suraski | 1 Aug 2004 09:02
Favicon
Gravatar

Re: [PHP-DEV] GOTO operator

At 15:45 31/07/2004, Derick Rethans wrote:
>Exceptions are an OO thing, and it makes NO sense to use them in
>procedural code. Goto is a good thing here.

Can you explain why it makes no sense to use them in procedural code?  It 
makes perfect sense for me, and they render 100.0% of the examples shown on 
internals <at>  redundant...

Zeev

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Edin Kadribasic | 1 Aug 2004 12:38
Picon

Re: [PHP-DEV] PHP 5.0.1

I saw Dmitry commit several fixes to SOAP extension but I didn't see them
merged. Maybe they should be.

Edin
----- Original Message ----- 
From: "Andi Gutmans" <andi <at> zend.com>
To: <internals <at> lists.php.net>
Sent: Sunday, August 01, 2004 2:43 AM
Subject: [PHP-DEV] PHP 5.0.1

> As I mentioned about a week ago, I'd like to roll 5.0.1 (mainly due to the
> auth bug) and some other fixes.
> I was thinking of rolling this minor release tomorrow or Tuesday. If you
> have any bug fixes you'd like to make in, please let me know. There's no
> problem with delaying it somewhat more...
> Andi
>
> -- 
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


Gmane