Re: "global" need terminating semicolon or not?
| From: | Andi Gutmans | Date: | Fri, 02 Jun 2000 16:50:31 +0000 |
| Subject: | Re: "global" need terminating semicolon or not? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-912@lists.php.net to get a copy of this message | ||
That is a bug. It should require a ';'. I will fix it in the CVS.
Andi
At 11:44 AM 6/2/00 -0500, Paul DuBois wrote:
Is "global" a special kind of statement in not needing a trailing
semicolon? The following script prints the values of $x and $y
just fine, and no parse error occurs. If I leave off the semicolon
on either assignment statement or either print statement, I get a
parse error. This is with PHP 4.0.0.
<?php
$x = 1;
$y = 2;
function z ()
{
global $x
global $y
print "x = $x\n";
print "y = $y\n";
}
z();
?>
--
Paul DuBois, paul@snake.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net
---
Andi Gutmans <andi@zend.com>
http://www.zend.com/