Re: The "jump" operator
| From: | Jani Taskinen | Date: | Fri, 04 Apr 2008 10:41:06 +0000 |
| Subject: | Re: The "jump" operator | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-36800@lists.php.net to get a copy of this message | ||
You're about year too late..or even more. Please, don't just this
discussion now.
--Jani
On Fri, 2008-04-04 at 13:35 +0300, Arvids Godjuks wrote:
> Well, why even add such functionality if it's doubtful it will be used. It
> just ads confusion and anger to users, who knows what it does and what harm
> can be done. GOTO functionality wasn't present in PHP and i think should
> never be ever. break is fine..
>
> 2008/4/4, Alexey Zakhlestin <indeyets@gmail.com>:
> >
> > On Fri, Apr 4, 2008 at 1:17 PM, Arvids Godjuks <arvids.godjuks@gmail.com>
> > wrote:
> > > just emotions, sorry.
> > >
> > > But why you didn't keep the "break [1,2,3];" ? That was fine and
> > > understandable and it was limited to loops, but with this will make code
> > > messy, especially with if statements. I personally woun't use it at all,
> > but
> > > it will be hell to get into badly coded projects with "jump"'s in it.
> > And it
> > > was easily done with try/catch.
> >
> >
> > break [1,2,3] is still there
> >
> > the following was removed
> >
> > $i = 2;
> > break $i;
> >
> > while I, personnaly, agree, that for error-handling situations
> > try/catch is a superior solution, the new "goto" construct can be
> > useful for micro-optimizations
> > I doubt, I will be using it, though :-)
> >
> > p.s. you replied me offlist. you should "cc" it, if you want to keep
> > discussion running
> >
> >
> > > 2008/4/4, Alexey Zakhlestin <indeyets@gmail.com>:
> > >
> > > > On Fri, Apr 4, 2008 at 12:43 PM, Arvids Godjuks
> > > > <arvids.godjuks@gmail.com> wrote:
> > > > > Link: http://news.php.net/php.internals/36536PÀ¸T4
> > > > > æ‰l%¹÷HÕ
> > > > > One question - are you crazy? I heared about break with goto
> > > capabilities -
> > > > > that's understandable - you could break 2 or 3 level loops, but
> > this
> > > one
> > > > > shit.
> > > >
> > > >
> > > > Could you please keep polite language?
> > > > Details of this construct were known for quite a long time, and it was
> > > > available in PHP6 for "ages"
> > > >
> > > > it is a limited goto, just as advertised. you can get out of blocks
> > > > with it, but you can't go into blocks
> > > >
> > > >
> > > > --
> > > > Alexey Zakhlestin
> > > > http://blog.milkfarmsoft.com/
> > > >
> > >
> > >
> > --
> >
> > Alexey Zakhlestin
> > http://blog.milkfarmsoft.com/
> >
--
Patches/Donations: http://pecl.php.net/~jani/