class MyClass { function someFunction() { echo "Hello World"; } } $reflectionClass = new ReflectionClass('MyClass'); echo $reflectionClass->getEndLine(); // Outputs: 4
namespace MyPackage; class MyClass { function someFunction() { echo "Hello World"; } } $reflectionClass = new ReflectionClass('MyPackage\\MyClass'); echo $reflectionClass->getEndLine(); // Outputs: 5This code creates a MyClass class inside the MyPackage namespace and then creates a new ReflectionClass object for it. The getEndLine method is called and returns 5, which is the last line number of the class declaration in the file. Based on the namespace and usage of ReflectionClass, it is likely that this code is part of a larger PHP package or library.