note 107225 deleted from function.class-exists by tularis
| From: | tularis@php.net | Date: | Tue, 17 Jan 2012 21:13:32 +0000 |
| Subject: | note 107225 deleted from function.class-exists by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185687@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
Reason: useless
----
@ Annymous and myb at mikebevz dot com either method should work fine as in the case below.
Something else must be wrong
<?php
namespace MyNameSpace {
Class MyClass {
public function myFunction() {
return class_exists( '\Test' );
}
public function myFunction2() {
return class_exists( '\\Test' );
}
}
}
namespace {
Class Test {}
//Hack to show I was loading the correct class on php.net note
$myClass = "MyNameSpace\MyClass";
$myClass = new $myClass;
var_dump( $myClass->myFunction() ); //returns bool(true)
var_dump( $myClass->myFunction2() ); //returns bool(true)
}
?>