#20182 [Opn->Csd]: Importing symbols from one class to another

From: Date: Sat, 17 Jan 2004 15:20:43 +0000
Subject: #20182 [Opn->Csd]: Importing symbols from one class to another
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-53486@lists.php.net to get a copy of this message
ID: 20182 Updated by: andrey@php.net Reported By: scotje at wwc dot edu -Status: Open +Status: Closed Bug Type: Feature/Change Request Operating System: Debian 3.0 PHP Version: 4.3.0-pre2 New Comment: "import" is no more part of PHP5 Previous Comments: ------------------------------------------------------------------------ [2002-10-31 01:49:46] scotje at wwc dot edu 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 this bug report at http://bugs.php.net/?id=20182&edit=1

« previous php.bugs (#53486) next »