Re: Re: PHP Brain Teasers
| From: | Stut | Date: | Wed, 27 Jun 2007 14:56:17 +0000 |
| Subject: | Re: Re: PHP Brain Teasers | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-257873@lists.php.net to get a copy of this message | ||
Jay Blanchard wrote:
[snip]Personally I prefer the potentially more accurate... function think(&$i) {[snip]the<?php function think($i) { TRUE == $i ? 'self-aware' : 'cow'; $return($i);$return($i); ?? You sure about that one? [/snip] *applause* We have a thinker here ladies and gentlemen! OK Stut, for$10,000 bonus....what should you return here and what is the least amount of code you can do it in?I'm not sure here, but are you being sarcastic? ;) Ignoring the extra $ and moving on... I would code it like this... function think(&$i) {$i = 'am';} If I call think, then I am thinking, therefore $i should become 'am'. If you return 'am' rather than changing $i IMHO you're deviating from the spec. [/snip] No sarcasm at all. And you are spot on!
$i = 'may be';} -Stut -- http://stut.net/