标签: php function class variables global-variables
如何使用这种方式。我想用最近运行的函数创建一个全局变量。
<?php class test{ public $number = null; public function __destruct(){ $this->number = 5; } } $test = new test(); echo $test->number; // null // How can I use this way. ?>