ID: 51013 Updated by: [email protected] Reported By: dellytufy at hotmail dot com -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: win PHP Version: 5.3SVN-2010-02-11 (SVN) New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php The use in the eval() is valid for the eval'd code. Previous Comments: ------------------------------------------------------------------------ [2010-02-11 11:53:49] dellytufy at hotmail dot com Description: ------------ i cannot use namespace in eval() as eval('use namespaceName\classname as myClass;'); after this i cannot ust $mc=myClass(); undeclared class namespace d3; namespace d3\sql; class oracle{ public $type='oracle'; } namespace d3\linq; class linq{ public $className='linq'; } $type='oracle'; eval('use \d3\sql\\'.$type.' as baglanti;'); $a=new baglanti();// error. undeclared class d3\linq\baglanti echo $a->type; Reproduce code: --------------- $type='oracle'; eval('use \d3\sql\\'.$type.' as baglanti; $a=new baglanti();'); echo $a->type; but this is successfully runned. Expected result: ---------------- namespace d3; namespace d3\sql; class oracle{ public $type='oracle'; } namespace d3\linq; class linq{ public $className='linq'; } $type='oracle'; eval('use \d3\sql\\'.$type.' as baglanti;'); $a=new baglanti(); echo $a->type; i think it must write oracle . ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=51013&edit=1
