当前位置: 首页>>代码示例>>PHP>>正文


PHP CVarDumper::_objects方法代码示例

本文整理汇总了PHP中CVarDumper::_objects方法的典型用法代码示例。如果您正苦于以下问题:PHP CVarDumper::_objects方法的具体用法?PHP CVarDumper::_objects怎么用?PHP CVarDumper::_objects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CVarDumper的用法示例。


在下文中一共展示了CVarDumper::_objects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dumpAsString

 /**
  * Dumps a variable in terms of a string.
  * This method achieves the similar functionality as var_dump and print_r
  * but is more robust when handling complex objects such as Yii controllers.
  * @param mixed $var variable to be dumped
  * @param integer $depth maximum depth that the dumper should go into the variable. Defaults to 10.
  * @param boolean $highlight whether the result should be syntax-highlighted
  * @return string the string representation of the variable
  */
 public static function dumpAsString($var, $depth = 10, $highlight = false)
 {
     self::$_output = '';
     self::$_objects = array();
     self::$_depth = $depth;
     self::dumpInternal($var, 0);
     if ($highlight) {
         $result = highlight_string("<?php\n" . self::$_output, true);
         self::$_output = preg_replace('/&lt;\\?php<br \\/>/', '', $result, 1);
     }
     return self::$_output;
 }
开发者ID:ubertheme,项目名称:module-ubdatamigration,代码行数:21,代码来源:CVarDumper.php

示例2: dumpAsString

 /**
  * Dumps a variable in terms of a string.
  * This method achieves the similar functionality as var_dump and print_r
  * but is more robust when handling complex objects such as Yii controllers.
  * @param mixed $var variable to be dumped
  * @param integer $depth maximum depth that the dumper should go into the variable. Defaults to 10.
  * @param boolean $highlight whether the result should be syntax-highlighted
  * @return string the string representation of the variable
  */
 public static function dumpAsString($var, $depth = 10, $highlight = false)
 {
     self::$_output = '';
     self::$_objects = array();
     self::$_depth = $depth;
     self::dumpInternal($var, 0);
     if ($highlight) {
         $result = highlight_string("<?php\n" . self::$_output, true);
         $pattern = array('/&lt;\\?php<br \\/>/', '/<code>/');
         $replace = array('', '<code class="debug-cvardumper">');
         $result = preg_replace($pattern, $replace, $result);
         if ($highlight === 'css') {
             $pattern = array('/&lt;\\?php<br \\/>/', '/<code>/', '/style="color: ' . ini_get('highlight.string') . '"/', '/style="color: ' . ini_get('highlight.comment') . '"/', '/style="color: ' . ini_get('highlight.keyword') . '"/', '/style="color: ' . ini_get('highlight.bg') . '"/', '/style="color: ' . ini_get('highlight.default') . '"/', '/style="color: ' . ini_get('highlight.html') . '"/');
             $replace = array('', '<code class="debug-cvardumper">', 'class="string"', 'class="comment"', 'class="keyword"', 'class="bg"', 'class="default"', 'class="html"');
             $result = preg_replace($pattern, $replace, $result);
         }
         self::$_output = $result;
     }
     return self::$_output;
 }
开发者ID:fobiaweb,项目名称:php-helper-lib,代码行数:29,代码来源:CVarDumper.php


注:本文中的CVarDumper::_objects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。