PHP版本升级导致类构造函数的问题 [英] PHP Version Upgrade Caused Problems With Class Constructors

查看:87
本文介绍了PHP版本升级导致类构造函数的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将我的PHP版本从 v5.3.1 升级到 v5.3.9 。突然类构造函数开始不工作了。任何想法?

解决方案

您可能使用类名称而不是 __ construct c $ c>关键字。请参阅v5.3.3中的行为更改:



http://www.php.net/archive/2010.php#id2010-07-22-2



使用 __ construct()就可以了。



http://www.php.net/manual/en/language.oop5.decon.php


I just upgraded my PHP version from v5.3.1 to v5.3.9. Suddenly class constructors started not working. Any ideas?

解决方案

You are probably using constructors with Class name instead of __construct() keyword. See the behaviour change in v5.3.3 here:

http://www.php.net/archive/2010.php#id2010-07-22-2

Use __construct() and you should be fine.

http://www.php.net/manual/en/language.oop5.decon.php

这篇关于PHP版本升级导致类构造函数的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆