note 92801 added to function.rand
| From: | adam at greatbigmassive dot net | Date: | Mon, 10 Aug 2009 11:56:27 +0000 |
| Subject: | note 92801 added to function.rand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-159261@lists.php.net to get a copy of this message | ||
The examples for solutions here are great and there have been some brilliant eye openers.
It must be clarified however, that the term "one-liner" means that the solution can be
acheived in one line of PHP code that does NOT require the use of a call to a manually created
function, OR any additional calculations or $variables inside the line.
Obviously, anyone can say "one liner solution" if they are just calling a function that
then has 200 lines in it, or just stuffing all their code on one line without proper line breaks.
The whole point of saying one-liner is to say that the solution can be achieved using a short hand
method and built in php functions, AND does not require the use of any other additional function
calls or calculations.
Example : Hugo Scott just said he has a long version and a "one liner" version. There is
absolutely no difference in both of his versions because both of them still only need a single call
to one of those functions. What's in the function is completely irrelevant, whether it be one
line or 3.
I hope that starts to make sense to people before we continue on this "I've got a one
liner" solutions when they aren't.
----
Server IP: 69.147.83.197
Probable Submitter: 89.242.2.107
----
Manual Page -- http://www.php.net/manual/en/function.rand.php
Edit -- https://master.php.net/note/edit/92801
Del: integrated -- https://master.php.net/note/delete/92801/integrated
Del: useless -- https://master.php.net/note/delete/92801/useless
Del: bad code -- https://master.php.net/note/delete/92801/bad+code
Del: spam -- https://master.php.net/note/delete/92801/spam
Del: non-english -- https://master.php.net/note/delete/92801/non-english
Del: in docs -- https://master.php.net/note/delete/92801/in+docs
Del: other reasons-- https://master.php.net/note/delete/92801
Reject -- https://master.php.net/note/reject/92801
Search -- https://master.php.net/manage/user-notes.php