【问题标题】:How to make atom php-debug show all elements of an array?如何使 atom php-debug 显示数组的所有元素?
【发布时间】:2016-11-07 08:21:49
【问题描述】:

watchpoints 中仅显示了 67 个数组元素中的 31 个

【问题讨论】:

    标签: php atom-editor


    【解决方案1】:

    如果您使用带有 atom 的 xdebug,请检查以下 xdebug 设置:

    xdebug.var_display_max_depth
    xdebug.var_display_max_children
    xdebug.var_display_max_data
    

    另请参阅此帖子:How to get xdebug var_dump to show full object/array

    在 atom 中显示的子项数量也可能有限制。

    【讨论】:

      【解决方案2】:

      get_class_methods('classname'), 只能获取公共函数

      $class = new ReflectionClass($_brand);
      $methods = $class->getMethods();
      var_dump($methods);
      

      【讨论】:

        【解决方案3】:

        get_class_methods() 对当前范围很敏感,这意味着如果你这样做:

        class brand{
          public    function publicMethod(){}
          private   function privateMethod(){}
          protected function protectedMethod(){}
        
          static    function getMethods(){
            return get_class_methods(__CLASS__);
          }
        }
        
        print_r(brand::getMethods());
        

        您将收到公共、私有、受保护和静态方法的完整列表。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2011-04-11
          • 2010-10-20
          • 1970-01-01
          • 2015-03-07
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多