note 92801 deleted from function.rand by danbrown

From: Date: Mon, 10 Aug 2009 15:15:50 +0000
Subject: note 92801 deleted from function.rand by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-159269@lists.php.net to get a copy of this message
Note Submitter: adam at greatbigmassive dot net ---- 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.

« previous php.notes (#159269) next »