This php script I'm working on has a million includes and I'm trying to find where the constant TEXT_PRODUCT has been defined (what filename and line number) is this possbile?
if you want to check for one time where it gets defined, define TEXT_PRODUCT at start of your script as. So whenever PHP script tries to define it again in any file it will give notice level error that it is defined previously. But you have to define your own error handler to get exact line number and file
<?php
function customeHandler($errno, $errstr, $errfile, $errline){
echo "<b>My NOTICE</b> [$errno] $errstr<br />\n";
echo "At line ", $errline , "<br />";
echo "At file ", $errfile , "<br />";;
return true;
}
$old_error_handler = set_error_handler("customeHandler");
define("TEST",3);
So whenever, we again define same variable in any file, it will display notice level error on screen and you can get file name as well as line no. using this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With