note 107530 added to control-structures.switch
| From: | Anonymous | Date: | Wed, 15 Feb 2012 18:29:33 +0000 |
| Subject: | note 107530 added to control-structures.switch | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186152@lists.php.net to get a copy of this message | ||
Regarding [php_net at mcdragonsoftware dot com 17-Jun-2011 09:53]; the elegant function and syntax
provided for an "inline switch" statement is more readable and about 25% faster than this
alternative (that uses existing builtin functions), which produces the same result:
<?php echo array_pop(array_slice(array( 'rock', 'paper', 'scissors'
), --$roll, 1)); ?>
----
Server IP: 69.147.83.197
Probable Submitter: 72.219.151.91
----
Manual Page -- http://www.php.net/manual/en/control-structures.switch.php
Edit -- https://master.php.net/note/edit/107530
Del: integrated -- https://master.php.net/note/delete/107530/integrated
Del: useless -- https://master.php.net/note/delete/107530/useless
Del: bad code -- https://master.php.net/note/delete/107530/bad+code
Del: spam -- https://master.php.net/note/delete/107530/spam
Del: non-english -- https://master.php.net/note/delete/107530/non-english
Del: in docs -- https://master.php.net/note/delete/107530/in+docs
Del: other reasons-- https://master.php.net/note/delete/107530
Reject -- https://master.php.net/note/reject/107530
Search -- https://master.php.net/manage/user-notes.php