RE: [PHP] problems with switch()

From: Date: Sat, 08 Jul 2000 09:05:26 +0000
Subject: RE: [PHP] problems with switch()
Groups: php.general 
Request: Send a blank email to php-general+get-5515@lists.php.net to get a copy of this message
Addressed to: "J.R. Lillard" <jr@hyphen.org> Php-General <php-general@lists.php.net> ** Reply to note from "J.R. Lillard" <jr@hyphen.org> Fri, 7 Jul 2000 20:15:12 -0500 (CDT) > > no i do not. it is my understanding that if you're only putting one > command between the <? and ?> tags, you don't need the trailing > semicolon. i've had no problems in that sense either. so: > > <? $x = 1 ?> > <? $y = 1 ?> > > is the same as: > > <? > $x = 1; > $y = 1; > ?> > Almost the same... The first will be slightly slower as it causes a switch from PHP mode to HTML mode, and back for each line. This would be acceptable if there is some HTML to send between the php lines, but as shown it is a waste of two context switches to save a semicolon. Rick Widmer Internet Marketing Specialists www.developersdesk.com

« previous php.general (#5515) next »