本文整理汇总了PHP中ReflectionExtension::export方法的典型用法代码示例。如果您正苦于以下问题:PHP ReflectionExtension::export方法的具体用法?PHP ReflectionExtension::export怎么用?PHP ReflectionExtension::export使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReflectionExtension
的用法示例。
在下文中一共展示了ReflectionExtension::export方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: export
/**
* Exports a reflection object.
*
* Returns the output if TRUE is specified for return, printing it otherwise.
* This is purely a wrapper method, which calls the corresponding method of
* the parent class.
* @param ReflectionExtension|string $extension
* ReflectionExtension object or name of the extension
* @param boolean $return
* Whether to return (TRUE) or print (FALSE) the output
* @return mixed
*/
public static function export($extension, $return = false)
{
return parent::export($extension, $return);
}
示例2: Func
<?php
class Foo
{
public $prop;
function Func($name)
{
echo "Hello {$name}";
}
}
ReflectionClass::export('Foo');
//output: Class [ class Foo ] { @@ /home/cg/root/main.php 3-10 - Constants [0] { } - Static properties [0] { } - Static methods [0] { } - Properties [1] { Property [ public $prop ] } - Methods [1] { Method [ public method Func ] { @@ /home/cg/root/main.php 7 - 9 - Parameters [1] { Parameter #0 [ $name ] } } } }
ReflectionObject::export(new Foo());
// output: Object of class [ class Foo ] { @@ /home/cg/root/main.php 3-10 - Constants [0] { } - Static properties [0] { } - Static methods [0] { } - Properties [1] { Property [ public $prop ] } - Dynamic properties [0] { } - Methods [1] { Method [ public method Func ] { @@ /home/cg/root/main.php 7 - 9 - Parameters [1] { Parameter #0 [ $name ] } } } }
ReflectionMethod::export('Foo', 'func');
// output: Method [ public method Func ] { @@ /home/cg/root/main.php 7 - 9 - Parameters [1] { Parameter #0 [ $name ] } }
ReflectionProperty::export('Foo', 'prop');
//output: Property [ public $prop ]
ReflectionExtension::export('standard');
//output: Extension [ extension #15 standard version 5.5.18 ] ...
示例3: header
<?php
header('Content-type: text/plain; charset=utf-8');
ReflectionExtension::export('yb');
示例4: ob_start
<?php
ob_start();
ReflectionExtension::export("reflection", true);
$test = ob_get_clean();
var_dump(empty($test));
unset($test);
ob_start();
ReflectionExtension::export("reflection", false);
$test = ob_get_clean();
var_dump(empty($test));
?>
==DONE==