Find declaration of a global variable in PHP

后端 未结 1 358
刺人心
刺人心 2020-12-21 04:25

Is there a quick and concise way of finding the declaration of a global variable in PHP?

If we are dealing with a large codebase where the global variable may be r

相关标签:
1条回答
  • 2020-12-21 04:59

    Are you a Unix-based OS?

    I usually do something like grep -rn 'global $myvar' .

    in the top-level directory. This does a recursive search of files in the current directory for the declaration.

    Or, if you want to get fancy you can search for only PHP files:

    grep -rn --include '*.php' 'global $myvar' .

    0 讨论(0)
提交回复
热议问题