note 110095 deleted from language.namespaces by aharvey

From: Date: Wed, 19 Sep 2012 01:46:07 +0000
Subject: note 110095 deleted from language.namespaces by aharvey
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-190875@lists.php.net to get a copy of this message
Note Submitter: lehal2 at hotmail dot com ---- 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);

« previous php.notes (#190875) next »