ID: 24226
User updated by: stephane dot drouard at st dot com
Reported By: stephane dot drouard at st dot com
Status: Bogus
Bug Type: *General Issues
Operating System: Lunix
PHP Version: 4.3.2
New Comment:
According to the answer, I added a variable but without terminating it
by a ';':
<?
class test {
var $dummy
?>
<!-- comment -->
<?
function test() {
print 'OK';
}
}
?>
It still reports the same error, but now at line 6, the opening PHP
tag.
Previous Comments:
------------------------------------------------------------------------
[2003-06-17 11:04:02] [EMAIL PROTECTED]
It might not be clear right away but this is how it's seen
by PHP:
<?
class test {
;
function test() {
print 'OK';
}
}
>From the manual,
http://www.php.net/manual/en/language.basic-syntax.php
"The closing tag for the block will include the immediately trailing
newline if one is present. Also, the closing tag automatically implies
a semicolon; you do not need to have a semicolon terminating the last
line of a PHP block."
------------------------------------------------------------------------
[2003-06-17 10:17:06] stephane dot drouard at st dot com
Description:
------------
I'm using Dreamweaver and it handles editable regions by inserting HTML
comments. To do so within PHP code, we need to close the script and to
reopen it after.
It works fine within functions (including class functions), loops, if,
...
The only case (I identified) that does not work is within class
definitions.
Reproduce code:
---------------
<?
class test {
?>
<!-- comment -->
<?
function test() {
print 'OK';
}
}
?>
Expected result:
----------------
It should compile
Actual result:
--------------
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or
`T_VAR' or `'}'' in <file> on line 3
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24226&edit=1