RE: [PHP-WIN] exception throw from __autoload could not be catched on php 5.3.1

[email protected] (Venkat Raman Don)
Newsgroups php.windows
Message-ID <3FA2AD39E9964240B4E6DD4AE62E031B449E2B10@TK5EX14MBXC120.redmond.corp.microsoft.com>
Yes, I am also able to reproduce this in the browser using both 5.3.1 as well as 5.3.0 on Windows using IIS.

Seems like a bug.

You may like to file the bug at http://bugs.php.net.

Thanks,
Don.

-----Original Message-----
From: Eric Lee [mailto:[email protected]] 
Sent: Thursday, January 28, 2010 9:09 PM
To: [email protected]
Subject: [PHP-WIN] exception throw from __autoload could not be catched on php 5.3.1

Hi php-dev pros,

I got an issue about catching exception throw from __autoload on php 5.3.1.

The manual state that exception throw from __autoload could be catched with
try.. catch statement same as the normal flow.

But I'can archive that even I have copied the same sample code from the
manual.

Here are the code segment.

[[[
function __autoload($name) {
   echo "Want to load $name.\n";
   throw new Exception("Unable to load $name.");
}

try {
   $obj = new NonLoadableClass();
} catch (Exception $e) {
   echo $e->getMessage(), "\n";
}

]]]

Are there anyone experienced this or not ?

Thanks in advance !

Regards,
Eric,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.