arvil
arvil

Reputation: 920

PHP find which file a Constant was initially defined?

I am just wondering if its possible to find where a constant is being redefined was initially defined? Turning on display_errors to E_ALL will just throw Notice where a constant was being redefined, but it did not say which file/function it was initially defined.

Regards,

Upvotes: 0

Views: 186

Answers (1)

Mark1
Mark1

Reputation: 166

The file/function and line number mentioned in the Notice message is where the constant is defined for the second time. ( although I can understand that one can could interpret this message differently.)

Notice: Constant SES_REGION already defined in <php-file> on line 7

To be clear: the notice does NOT say where the constant was originally defined. Is says where it is redefined.

Upvotes: 1

Related Questions