public static function getSource($filename, $start_line = 1, $length = null)
    {
        if (!$filename || !\file_exists($filename) || !\is_readable($filename)) {
            return null;
        }

        $source = \preg_split("/\r\n|\n|\r/", \file_get_contents($filename));
        $source = \array_combine(\range(1, \count($source)), $source);
        $source = \array_slice($source, $start_line - 1, $length, true);

        return $source;
    }
public static function getSource($filename, $start_line = 1, $length = null)
    {
        if (!$filename || !\file_exists($filename) || !\is_readable($filename)) {
            return null;
        }

        $source = \preg_split("/\r\n|\n|\r/", \file_get_contents($filename));
        $source = \array_combine(\range(1, \count($source)), $source);
        $source = \array_slice($source, $start_line - 1, $length, true);

        return $source;
    }
public static function getSource ( $ filename , $ start_line = 1 , $ length = null ) { if ( ! $ filename || ! \ file_exists ( $ filename ) || ! \ is_readable ( $ filename ) ) { return null ; } $ source = \ preg_split ( "/\r\n|\n|\r/" , \ file_get_contents ( $ filename ) ) ; $ source = \ array_combine ( \ range ( 1 , \ count ( $ source ) ) , $ source ) ; $ source = \ array_slice ( $ source , $ start_line - 1 , $ length , true ) ; return $ source ; }
Gets section of source code.

@param string   $filename   Full path to file
@param int      $start_line The first line to display (1 based)
@param null|int $length     Amount of lines to show

@return null|array
Gets section of source code .