<?php
/**
* Created by PhpStorm.
* User: Itboot
* Date: 2019/2/13
* Time: 16:58
*/
namespace MagicConst;
trait co
{
public function ff()
{
print 'this is Trait name : ' . __TRAIT__;
}
}
class MagicConst
{
use co;
public function printConst()
{
print __CLASS__ . PHP_EOL;
print __DIR__ . PHP_EOL;
print __FILE__ . PHP_EOL;
print __FUNCTION__ . PHP_EOL;
print __METHOD__ . PHP_EOL;
print __LINE__ . PHP_EOL;
print __NAMESPACE__ . PHP_EOL;
$this->ff();
}
}
$c = new MagicConst();
$c->printConst();
细数PHP中的那些魔术常量
最新推荐文章于 2024-06-25 05:26:53 发布