ID:               29268
 User updated by:  david at jool dot nl
-Summary:          __autoload() not called when inside eval()
 Reported By:      david at jool dot nl
-Status:           Feedback
+Status:           Open
 Bug Type:         Zend Engine 2 problem
 Operating System: winXP
 PHP Version:      5.0.0
 New Comment:

I took another look at the bug and found out it's more a
reflectionProperty bug:

-- File 'A.class.php'
<?PHP
class A{        
}
?>

-- File test.php in the same directory
<?php
/** autoload functie voor PHP5 */
function __autoload($classname) {
        if(file_exists("$classname.class.php"))
                include("$classname.class.php");
}
//When you include the following line, it works
//include("A.class.php");

class B{
        public function doit(A $a){
        }
}

$ref = new reflectionMethod('B','doit');
$parameters = $ref->getParameters();    
foreach($parameters as $parameter){
        //the following line give the error
        $class = $parameter->getClass();        
        echo $class->name;
}
?>

--Expected result
'A'

-- Actual result
Fatal error: Uncaught exception 'ReflectionException' with message
'Class A does not exist'


Previous Comments:
------------------------------------------------------------------------

[2005-01-14 23:38:39] [EMAIL PROTECTED]

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.




------------------------------------------------------------------------

[2004-07-19 23:12:11] david at jool dot nl

Description:
------------
When creating a new instance of a class inside eval() the __autoload
function isn't called.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=29268&edit=1

Reply via email to