Edited. sorry all the class code is bugged
1条回答 默认 最新
- dougu5950 2018-06-14 02:20关注
You should use static function. Try replace your function as code below.
public static function disk($disk) { $instance = new MyStorage(); $instance->disk = $disk; return $instance;
Furthermore, I would suggest you learn singleton design pattern
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报