RE: [PHP] PHP Interview questions

From: Date: Tue, 26 Aug 2003 23:08:55 +0000
Subject: RE: [PHP] PHP Interview questions
Groups: php.general 
Request: Send a blank email to php-general+get-160856@lists.php.net to get a copy of this message
Just to throw a spanner (where'd that come from, that wasn't part of the question) into the works... What is the state of the light bulb before the test? If it's on and it's connected to switch #1, then the logic below would result in "switch #2" being displayed... (maybe.., I don't know how long it takes for a light bulb to cool down) Martin -----Original Message----- From: CPT John W. Holmes [mailto:holmes072000@charter.net] Sent: Wednesday, 27 August 2003 5:35 AM To: Curt Zirzow; PHP General Subject: Re: [PHP] PHP Interview questions From: "Curt Zirzow" <php-general@zirzow.dyndns.org> > toggle_light(1); > sleep(120); > toggle_light(1); > > toggle_light(2); > move('self', 'room/'); > > if ($lightbulb['temp'] > $room['temp']) { > echo "switch #1"; > } elseif ($lightbulb['ison']) { > echo "switch #2"; > } else { > echo "switch #3"; > } > > hm.. i had to keep it OT somehow :) Aren't you missing a foreach($lightbulb as $bulb) in there somewhere? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __________ Information from NOD32 1.490 (20030820) __________ This message was checked by NOD32 for Exchange e-mail monitor. http://www.nod32.com

« previous php.general (#160856) next »