Yep, I need to find the filename an object was declared in.
file1.php-
require './file2.php';
$ob = new Ob;
file2.php-
class Ob {
function Ob() {
$this->called_from = somehow_get_filename_here();
}
}
I need $this->called_from to be set to file1.php.
In Perl I can use caller like:
$self->{called_from} = (caller)[1];
Thanks in advance for any help possible 🙂