- var_export: documentation ( source)
- error_reporting: documentation ( source)
<?php
error_reporting(E_ALL ^ E_STRICT);
trait MyTrait
{
/**
* Comes from trait
*/
private $foo;
}
class MyClass
{
use MyTrait;
/**
* Comes from class
*/
private $foo;
}
$classFoo = new \ReflectionProperty('MyClass', 'foo');
$traitFoo = new \ReflectionProperty('MyTrait', 'foo');
var_export($traitFoo->getDocComment() == $classFoo->getDocComment());
$classFoo = new \ReflectionProperty('MyClass','foo');
$traitFoo = new \ReflectionProperty('MyTrait','foo');
echo $traitFoo->getDeclaringClass()->getName().PHP_EOL;
echo $traitFoo->getDocComment().PHP_EOL;
echo $classFoo->getDeclaringClass()->getName().PHP_EOL;
echo $classFoo->getDocComment().PHP_EOL;