note 110095 added to language.namespaces
| From: | lehal2 at hotmail dot com | Date: | Tue, 18 Sep 2012 22:46:56 +0000 |
| Subject: | note 110095 added to language.namespaces | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-190873@lists.php.net to get a copy of this message | ||
namespace myclasses;
echo '-',__NAMESPACE__,'-<br />';
class parentclass {
public function __construct(){
echo "<br/>";
$arr=get_declared_classes();
foreach($arr as $k=>$v){
echo "<br/>";
echo $arr[$k]=$v;
$interface1='interface int'.$v.'{ <br/>';
$marr=(get_class_methods($v));
foreach($marr as $mv){
if ($mv=='__construct'){
continue;
}else{
$interface1.='public method '.$mv.'(){} <br/>';
}
}
$interface1.='}';
echo "<br/>";
//you can write this in a directory as the file names you want;
echo $interface1;
}
}
static public function mymethod(){
echo 'this is static' ;
echo "<br/>";
echo __class__;
echo "<br/>";
}
}
use myclasses\parentclass as another;
$obj=new another();
$obj::mymethod();
print_r($obj);
----
Server IP: 87.124.126.49
Probable Submitter: 2.122.145.189
----
Manual Page -- http://www.php.net/manual/en/language.namespaces.php
Edit -- https://master.php.net/note/edit/110095
Del: integrated -- https://master.php.net/note/delete/110095/integrated
Del: useless -- https://master.php.net/note/delete/110095/useless
Del: bad code -- https://master.php.net/note/delete/110095/bad+code
Del: spam -- https://master.php.net/note/delete/110095/spam
Del: non-english -- https://master.php.net/note/delete/110095/non-english
Del: in docs -- https://master.php.net/note/delete/110095/in+docs
Del: other reasons-- https://master.php.net/note/delete/110095
Reject -- https://master.php.net/note/reject/110095
Search -- https://master.php.net/manage/user-notes.php