php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51181 eval is not work for using namespaces
Submitted: 2010-03-02 07:27 UTC Modified: 2010-03-02 11:51 UTC
From: abca_b_cabcom at hotmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.3.1 OS: Doesn' matter
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: abca_b_cabcom at hotmail dot com
New email:
PHP Version: OS:

 

 [2010-03-02 07:27 UTC] abca_b_cabcom at hotmail dot com
Description:
------------
eval('use test\me\test as testme;');

doesn't work

it produce
Fatal error: Class 'testme' not found
if I call the testme class

Test script:
---------------
//test.php
<?php

include './includes.php';

eval('use test\me\test as testme;');

$testme = new testme;

//Includes.php
<?php

include './test.class.php';

function testme() {
	return 'test\me\test';
}

//test.class.php
<?php

namespace test\me;

class test {
	function __construct() {
		echo 'here is run';
	}
}


Expected result:
----------------
There should be no error when i call the testme class

Actual result:
--------------
Fatal error occures

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-02 11:51 UTC] jani@php.net
-Status: Open +Status: Bogus -Package: *Compile Issues +Package: *General Issues
 [2010-03-02 11:51 UTC] jani@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC