From: [EMAIL PROTECTED]
Operating system: Debian 3.0
PHP version: 4.3.0-pre2
PHP Bug Type: Zend Engine 2 problem
Bug description: Importing symbols from one class to another
I am encountering a parse error when I try to import symbols from one class
into another class.
Here's my example:
<?php
class rztest
{
const testvar = 1;
function test()
{
echo "This is a test.";
}
}
class rztest2
{
import const testvar from rztest;
function test2()
{
echo testvar;
}
}
?>
The import line in the rztest2 class results in:
Parse error: parse error, expecting `';'' in
/home/jesse/public_html/test.php on line 15
If I comment out the import line it runs without complaint. I am also
able to access the constant just fine by using a direct rztest::testvar
reference. I also tried importing the function from rztest instead of the
constant and had similar results.
I have no difficulty importing a constant or function into the global
scope.
I am currently using the packaged php4.3.0-dev w/ zend engine 2 that was
released in June because I haven't been able to make the current php4-ze2
cvs branch compile yet.
--
Edit bug report at http://bugs.php.net/?id=20182&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20182&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20182&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20182&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20182&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20182&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20182&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20182&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20182&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20182&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20182&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20182&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20182&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20182&r=isapi