Re: Re: PHP Brain Teasers
| From: | Stut | Date: | Wed, 27 Jun 2007 14:47:22 +0000 |
| Subject: | Re: Re: PHP Brain Teasers | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-257869@lists.php.net to get a copy of this message | ||
Jay Blanchard wrote:
[snip]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) {<?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 the $10,000 bonus....what should you return here and what is the least amount of code you can do it in?
$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. -Stut -- http://stut.net/