ReflectionClass::getStartLine

(PHP 5)

ReflectionClass::getStartLineGets starting line number

Description

public int ReflectionClass::getStartLine ( void )

Get the starting line number.

Warning

This function is currently not documented; only its argument list is available.

Parameters

This function has no parameters.

Return Values

The starting line number, as an integer.

See Also

Коментарии

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
   
)
);
?>
2021-10-31 18:28:17
http://php5.kiev.ua/manual/ru/reflectionclass.getstartline.html

    Поддержать сайт на родительском проекте КГБ