在宣布课程之前“如果定义”是一种好习惯吗?

时间:2017-05-15 14:32:02

标签: php performance code-readability

在我的工作中修复代码我注意到在检查后是否定义了很多类,如:[/ p>

<?
  if(!defined("_myClass_inc")){

      define("_myClass_inc", 1);

      class _myClass{
          __contructor(){
          //Code goes here
          }
      }
  }
?>

这是最好的方法吗,考虑到存在函数require_once

0 个答案:

没有答案
相关问题