#26640 [NEW]: __autoload() not invoked by Reflection classes

From: Date: Tue, 16 Dec 2003 18:19:47 +0000
Subject: #26640 [NEW]: __autoload() not invoked by Reflection classes
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-52181@lists.php.net to get a copy of this message
From:             adam at trachtenberg dot com
Operating system: *
PHP version:      5CVS-2003-12-16 (dev)
PHP Bug Type:     Zend Engine 2 problem
Bug description:  __autoload() not invoked by Reflection classes

Description:
------------
The Reflection classes do not trigger __autoload() when 
the class is undefined. This works correctly for 
userland classes.

Reproduce code:
---------------
function __autoload($c) {
	class autoload_class {
		public function __construct() {
			print "autoload success\n";
		}
	}
}

Reflection:export(new Reflection_Class('autoload_class'));

Expected result:
----------------
autoload success
Class [ <user>  class autoload_class ] {
  @@ /Users/adam/Desktop/autoload.php 4-10

  - Constants [0] {
  }

  - Static properties [0] {
  }

  - Static methods [0] {
  }

  - Properties [0] {
  }

  - Methods [1] {
    Method [ <user> <ctor> public method __construct ] {
      @@ /Users/adam/Desktop/autoload.php 6 - 8
    }
  }
}

Actual result:
--------------
PHP Fatal error:  Uncaught exception 
'reflection_exception' with message 'Class 
autoload_class does not exist' in /Users/adam/Desktop/
autoload.php:10
Stack trace:
#0 {main}
  thrown in /Users/adam/Desktop/autoload.php on line 10

-- 
Edit bug report at http://bugs.php.net/?id=26640&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26640&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26640&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26640&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26640&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26640&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=26640&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=26640&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26640&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26640&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26640&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26640&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26640&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26640&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26640&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26640&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26640&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26640&r=float


Thread (5 messages)

« previous php.bugs (#52181) next »