I wonder if something like this is possible in PHP
$goto = 'end';
goto $goto;
when I use it I get Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING.
Furthermore, how would I do something like this (considering a() returns true or false)
a() or goto end;
as opposed to the longer version
if (!a()) goto end;
- purely theoretically :)
This has certainly got a lot of reaction. I think mentioning two of PHP's most debated areas (goto and eval) helped get some strong reactions.
Just to get things clear and put some people's hearts at ease: I know the reasons for not using goto. But to every "rule" there are exceptions.
purely theoretically :)break 3;would do the same job...