PHP Syntax Error in Setting Global Variable

前端 未结 4 2187
野性不改
野性不改 2020-12-20 19:17

Ok, so my PHP is, to say the least, horrible. I inherited an application and am having to fix errors in it from someone that wrote it over 7 years ago. When I run the page

4条回答
  •  渐次进展
    2020-12-20 20:04

    See here. global is a modifier which means the variable comes from the global scope. It should just be

    and in functions which use them (but you don't have any in this page)

    function f() {
      global $siteRoot, $reportRoot;
      ...
    }
    

提交回复
热议问题