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

PHP构造函数解决思路

WBOY
Release: 2016-06-13 10:08:00
Original
809 people have browsed it

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

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

Related labels:
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