note 126549 added to reflectionclass.getstartline
| From: | info at ensostudio dot ru | Date: | Sun, 31 Oct 2021 16:28:17 +0000 |
| Subject: | note 126549 added to reflectionclass.getstartline | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217132@lists.php.net to get a copy of this message | ||
Note: lines in file start from 1!
Sample to get class code:
<?php
$class = new ReflectionClass('Foo');
$offset = $class->getStartLine() - 1;
$code = implode(
'',
array_slice(
file($class->getFileName()),
$offset,
$class->getEndLine() - $offset
)
);
?>
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 31.129.215.166)
----
Manual Page -- https://php.net/manual/en/reflectionclass.getstartline.php
Edit -- https://main.php.net/note/edit/126549
Del: integrated -- https://main.php.net/note/delete/126549/integrated
Del: useless -- https://main.php.net/note/delete/126549/useless
Del: bad code -- https://main.php.net/note/delete/126549/bad+code
Del: spam -- https://main.php.net/note/delete/126549/spam
Del: non-english -- https://main.php.net/note/delete/126549/non-english
Del: in docs -- https://main.php.net/note/delete/126549/in+docs
Del: other reasons-- https://main.php.net/note/delete/126549
Reject -- https://main.php.net/note/reject/126549
Search -- https://main.php.net/manage/user-notes.php