Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22748 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19196 invoked by uid 1010); 14 Apr 2006 03:54:25 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 19180 invoked from network); 14 Apr 2006 03:54:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Apr 2006 03:54:25 -0000 X-Host-Fingerprint: 192.38.9.232 gw2.emini.dk Linux 2.4/2.6 Received: from ([192.38.9.232:4372] helo=gw2.emini.dk) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id B2/8C-19715-FEC1F344 for ; Thu, 13 Apr 2006 23:54:23 -0400 Received: from foxbox (IGLD-84-228-8-209.inter.net.il [84.228.8.209]) by gw2.emini.dk (Postfix) with ESMTP id 75752ACAA0; Fri, 14 Apr 2006 05:54:18 +0200 (CEST) Message-ID: <07ff01c65f77$0fc9ace0$6602a8c0@foxbox> Reply-To: "Steph Fox" To: , References: <47939.67.108.68.36.1144986573.squirrel@www.l-i-e.com> Date: Fri, 14 Apr 2006 05:53:58 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: Re: [PHP-DEV] CLI php -r requires final ; From: steph@zend.com ("Steph Fox") The final ; is needed with php -r. It's even documented somewhere :) ----- Original Message ----- From: "Richard Lynch" To: Sent: Friday, April 14, 2006 5:49 AM Subject: [PHP-DEV] CLI php -r requires final ; > This is such minutiae, but I needed a break... > > The docs say final ?> is not needed, and final ; is not needed: > > http://php.net/manual/en/language.basic-syntax.instruction-separation.php > > It does not address what happens if BOTH are missing, however. > > It would seem that with both missing... > > -bash-2.05b$ cat temp.php > echo 'hello' > -bash-2.05b$ > php -q temp.php > > you get a syntax error: > > Parse error: parse error, unexpected $end, expecting ',' or ';' > > This is fine, of course. > > We'll call it a feature, even, I guess. > > But, for me, it feels decidedly "odd" when I do: > > php -r "echo 'hello'" > > and get: > Parse error: parse error, unexpected $end, expecting ',' or ';' > > I mean, for some reason, I just expected that the "optional" > semi-colon at the end was, well, optional... > > I mean, -r runs the code without me needing to add > > It's not like I'm relying on the optional ?> at the end of a file > feature. > > It's a different animal. > > php -r is "adding in" both for me, in my mind, at least. > > I just sort of expected that the -r getting rid of didn't > "count" against the ?> OR ; being optional, and I figured the ; was > still optional. > > Am I being too petty? :-^ > > I'm not filing this as bug report without some feedback, that's for sure! > > Actually, I'm just interested to see how others think about this. > > I don't even like leaving off ?> nor ; in PHP source code. I think > it's just a sign of sloppy coding -- even if it does mean that I can't > get that perfectly-align HTML coming out. > > -- > Like Music? > http://l-i-e.com/artists.htm > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > > __________ NOD32 1.1380 (20060125) Information __________ > > This message was checked by NOD32 antivirus system. > http://www.eset.com > >