note 104384 added to reflectionclass.construct
| From: | cspray at gmail dot com | Date: | Mon, 13 Jun 2011 02:14:26 +0000 |
| Subject: | note 104384 added to reflectionclass.construct | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-180465@lists.php.net to get a copy of this message | ||
Useful to know that if you pass a string into the construct and the class cannot be instantiated for
some reason a SPL LogicException will be thrown.
This code was ran on a Mac OS X 10.6.7, AMP, PHP 5.3+
<?php
// index.php
try {
$ReflectedClass = new ReflectionClass('NonExist');
} catch (LogicException $logicDuh) {
print_r($logicDuh);
}
?>
Will return a deeply nested array full of useful information about the error.
----
Server IP: 69.147.83.197
Probable Submitter: 96.228.123.41
----
Manual Page -- http://www.php.net/manual/en/reflectionclass.construct.php
Edit -- https://master.php.net/note/edit/104384
Del: integrated -- https://master.php.net/note/delete/104384/integrated
Del: useless -- https://master.php.net/note/delete/104384/useless
Del: bad code -- https://master.php.net/note/delete/104384/bad+code
Del: spam -- https://master.php.net/note/delete/104384/spam
Del: non-english -- https://master.php.net/note/delete/104384/non-english
Del: in docs -- https://master.php.net/note/delete/104384/in+docs
Del: other reasons-- https://master.php.net/note/delete/104384
Reject -- https://master.php.net/note/reject/104384
Search -- https://master.php.net/manage/user-notes.php