CancelImage Upload

PHP 5.3 includes goto operator

Ever wanted to jump to another section within your code? The goto operator included in PHP 5.3 gives you just that option.

Here is an example of the code:

<?php

goto lable1;

echo 'This area of the code will be jumped over.';

lable1:

echo 'This text will end up being displayed in your browser.';

?>

Resulting in:

This text will end up being displayed in your browser.

Note that the goto operator is not unrestricted. The target lable that you wish to jump to must be within the same function and file. You cannot jump out of a function or leap into one. Jumping into a loop or switch is also not possible.

Login
Want to leave a comment?

No problem. Just enter your email and password below.


register | home | reminder

myDesignTool Networking • www.mydesigntool.cominfo@mydesigntool.com