note 103699 added to reflection.extending
| From: | khelaz at gmail dot com | Date: | Thu, 28 Apr 2011 18:12:41 +0000 |
| Subject: | note 103699 added to reflection.extending | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-179243@lists.php.net to get a copy of this message | ||
Extending class ReflectionFunction to get source code of function
class Custom_Reflection_Function extends ReflectionFunction {
public function getSource() {
if( !file_exists( $this->getFileName() ) ) return false;
$start_offset = ( $this->getStartLine() - 1 );
$end_offset = ( $this->getEndLine() - $this->getStartLine() ) + 1;
return join( '', array_slice( file( $this->getFileName() ), $start_offset,
$end_offset ) );
}
}
----
Server IP: 69.147.83.197
Probable Submitter: 79.26.249.127
----
Manual Page -- http://www.php.net/manual/en/reflection.extending.php
Edit -- https://master.php.net/note/edit/103699
Del: integrated -- https://master.php.net/note/delete/103699/integrated
Del: useless -- https://master.php.net/note/delete/103699/useless
Del: bad code -- https://master.php.net/note/delete/103699/bad+code
Del: spam -- https://master.php.net/note/delete/103699/spam
Del: non-english -- https://master.php.net/note/delete/103699/non-english
Del: in docs -- https://master.php.net/note/delete/103699/in+docs
Del: other reasons-- https://master.php.net/note/delete/103699
Reject -- https://master.php.net/note/reject/103699
Search -- https://master.php.net/manage/user-notes.php