self::$instance null || !(self::$instance instanceof Tpl

WBOY
Release: 2016-06-23 13:12:54
Original
1498 people have browsed it

self::$instance === null || !(self::$instance instanceof Tpl)
这句话是什么意思,有点看不明白


回复讨论(解决方案)

instance 实例

self::$instance 表示类的一个静态属性
在这里表示存储了一个实例化后的对象

self::$instance === null 是没有实例化的意思

self::$instance instanceof Tpl 表示 self::$instance 保存的对象隶属于类 Tpl
!(self::$instance instanceof Tpl) 就是对象不是从 Tpl 或其派生类产生的

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template