Try ReflectionClass
- ReflectionClass::getFileName — Gets a filename
Example:
class Foo {}
$reflector = new \ReflectionClass('Foo');
echo $reflector->getFileName();
This will return false
when the filename cannot be found, e.g. on native classes.
More Related Contents:
- How can I access an array/object?
- Use global variables in a class
- Can I extend a class using more than 1 class in PHP?
- How to initialize static variables
- What is ::class in PHP?
- mysqli_query() expects parameter 1 to be mysqli, object given
- Redefine Class Methods or Class
- When to use static vs instantiated classes
- Initializing PHP class property declarations with simple expressions yields syntax error
- PHP Accessing Parent Class Variable
- declare property as object?
- Can you create instance properties dynamically in PHP?
- Can I use PHP reserved names for my functions and classes?
- How do I get a PHP class constructor to call its parent’s parent’s constructor?
- PHP __PHP_Incomplete_Class Object with my $_SESSION data
- PHP DateTime() class, change first day of the week to Monday
- Can I use string concatenation to define a class CONST in PHP?
- What’s difference between __construct and function with same name as class has? [duplicate]
- Determining what classes are defined in a PHP class file
- Fatal error: Call to a member function close() on a non-object. MySQLi issue
- Nested or Inner Class in PHP
- What does new self(); mean in PHP?
- Get all defined classes of a parent class in php
- Calling a function within a Class method?
- PHP 5 Reflection API performance
- How do I access static member of a class?
- Laravel / Intervention Image Class – class not found
- Is there a call_user_func() equivalent to create a new class instance?
- Accessing Order Items protected data in Woocommerce 3
- Public static variable value