Home  >  Article  >  Backend Development  >  PHP构造函数解决思路

PHP构造函数解决思路

WBOY
WBOYOriginal
2016-06-13 10:08:00736browse

PHP构造函数
现在在写一个类,遇到这样一个问题,如果在构造函数中发现该对象不符合构造条件,如何让对象构造停止,并返回false通知外围对象。。。
在线等。。。

------解决方案--------------------
请码点马贴上来啊
------解决方案--------------------
你可能需要重载 new,不过 php 并不支持重载

Statement:
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