How to check filename and directory where constant variable is defined

时间:2016-05-17 11:12:04

标签: php global-variables constants

I need to change my defined constant but ,I couldn't find where i've defined it i.e.

<?php 
  define("var_name","somevalue");
?>

Is it possible in php to get where this constant is defined ??

1 个答案:

答案 0 :(得分:0)

Using runkit_constant_redefine you can re define your defined constant.

runkit_constant_redefine("var_name_new", "somevalue_new");

more about function.runkit-constant-redefine.php

Note: If you have the runkit extension installed, you can use runkit_constant_redefine()