Syntax:int ReflectionClass::getEndLine (void)
Parameters:This function takes no parameters.
Return value:This function returns the line number where the user-defined class ends.The following programs illustrate the ReflectionClass::getEndLine() function in PHP:
Program 1: < ? php
// Definition of a class named Departments
class
Departments {}
// Using ReflectionClass over the Departments class
$ReflectionClass
=
new
ReflectionClass (
’ Departments’
);
// Calling getEndLine() functions
$A
=
$ReflectionClass
-> getEndLine();
// Get line end number
// specified class
var_dump (
$A
);
?>
Output: int (4)
Program 2:
// Definition of a class named Departments
class
Departments {
static
$Dept1
=
’CSE’
;
private
static
$Dept2
=
’ECE’
;
public
static
$Dept3
=
’EE’
;
}
// Using ReflectionClass over the Departments class
$ReflectionClass
=
new
ReflectionClass (
’Departments’
);
// Calling getEndLine() functions
$A
=
$ReflectionClass
-> getEndLine();
// Get line end number
// specified class
var_dump (
$A
);
?>
Output: int (8)
Link: https://www.php.net/manual/en/reflectionclass.getendline.php