You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not a full unrestricted goto. The target label must be within the same file and context, meaning that you cannot jump out of a function or method, nor can you jump into one. You also cannot jump into any sort of loop or switch structure.
For a real-world instance of proper goto usage in the WordPress world, see https://github.com/sybrew/the-seo-framework/blob/5.1.2/inc/classes/meta/robots/args.class.php#L96.
Rewriting that code to adhere to WordPress's ostracizing PHP 4 standard would introduce at least 9 opcodes (2 vars forwarded (+2) and read (+2), in static scope (+1), function call (+1), unnecessary return yield from in generator (+2), and another yield (+1)) in that function, which can be called up to 600 times per admin page load.
To learn more, see igorw/retry#3.
Please try to implement it in your code before condemning others. Thanks.
The text was updated successfully, but these errors were encountered:
PHP's
goto
is not the same as C's.From PHP's manual:
To broaden your perspective, see the comments here: https://stackoverflow.com/questions/3517726/what-is-wrong-with-using-goto/.
And here https://www.reddit.com/r/PHP/comments/75sa2y/what_valid_use_cases_if_any_exist_for_goto_in_php/.
Also see https://en.wikipedia.org/wiki/Goto#Common_usage_patterns.
For a real-world instance of proper goto usage in the WordPress world, see https://github.com/sybrew/the-seo-framework/blob/5.1.2/inc/classes/meta/robots/args.class.php#L96.
Rewriting that code to adhere to WordPress's ostracizing PHP 4 standard would introduce at least 9 opcodes (2 vars forwarded (+2) and read (+2), in static scope (+1), function call (+1), unnecessary
return yield from
in generator (+2), and another yield (+1)) in that function, which can be called up to 600 times per admin page load.To learn more, see igorw/retry#3.
Please try to implement it in your code before condemning others. Thanks.
The text was updated successfully, but these errors were encountered: