在常量中区调用函数
class Dog{ public $name = 'huzi'; public function _toString(){ return $this ->name; } } $dog = new Dog(); define('DOG',$dog); print_r(DOG)
class Dog{
public $name = 'huzi';
public function _toString(){
return $this ->name;
}
$dog = new Dog();
define('DOG',$dog);
print_r(DOG)
使用道具 举报
本版积分规则 发表回复 回帖后跳转到最后一页
|Archiver|手机版|小黑屋|宜信同城网交流论坛 ( 闽ICP备19021048号 )|站点地图
GMT+8, 2026-3-28 01:01 , Processed in 0.240859 second(s), 14 queries , Redis On.
Powered by Discuz! X3.4
Copyright © 2001-2020, Tencent Cloud.