note 110210 added to function.interface-exists
| From: | maxim at inbox dot ru | Date: | Mon, 01 Oct 2012 10:40:53 +0000 |
| Subject: | note 110210 added to function.interface-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-191085@lists.php.net to get a copy of this message | ||
If you want to check for included interface and you already register spl autoloader - it will crash.
Becassue autoloader trying to load
string and he doesnt matter is it class or not.
Iv found several ways :
1 - unregister AL - -> check for Ifaces - -> register Autoloader
2 - $ifaces = array_flip(get_declared_interfaces());
if($ifaces["MyIface"]) // empty // isset .
Interfaces are not bad, you can build correct geomentry of system , with validation by funcs / vars
/ const .
Also they are good to storage variables <?php
ROOT::THEMES ; ROOT::LOC ; ?> . Much faster then Define, but you cant put algorithms inside,
only complite strings / __file__ / etc.
----
Server IP: 69.147.83.199
Probable Submitter: 95.221.42.165
----
Manual Page -- http://www.php.net/manual/en/function.interface-exists.php
Edit -- https://master.php.net/note/edit/110210
Del: integrated -- https://master.php.net/note/delete/110210/integrated
Del: useless -- https://master.php.net/note/delete/110210/useless
Del: bad code -- https://master.php.net/note/delete/110210/bad+code
Del: spam -- https://master.php.net/note/delete/110210/spam
Del: non-english -- https://master.php.net/note/delete/110210/non-english
Del: in docs -- https://master.php.net/note/delete/110210/in+docs
Del: other reasons-- https://master.php.net/note/delete/110210
Reject -- https://master.php.net/note/reject/110210
Search -- https://master.php.net/manage/user-notes.php