|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-17 10:20 UTC] andrey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Mon Feb 09 18:00:01 2026 UTC |
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.