简体   繁体   English

致命错误:无法重新声明类php

[英]Fatal error: Cannot redeclare class php

I have been asked to continue to program the remaining of our company's management system using PHP, though I'm just new to it. 我被要求继续使用PHP对我们公司管理系统的其余部分进行编程,尽管我只是新手。 while inputting the url, I received this: Cannot redeclare class SessionHandler in C:\\xampp\\htdocs\\RMS\\classes\\session\\SessionHandler.php on line 4 在输入url时,我收到了:无法在第4行的C:\\ xampp \\ htdocs \\ RMS \\ classes \\ session \\ SessionHandler.php中重新声明类SessionHandler

It has three (3) classes: Session.php, SessionHandler.php,SessionController.php 它有三(3)个类:Session.php,SessionHandler.php,SessionController.php

Please do check the whole code below: 请检查以下整个代码:

For SessionHandler.php 对于SessionHandler.php

http://pastebin.com/ziA2advz http://pastebin.com/ziA2advz

NOTE: I already did research the same issue I have, they said, use require_once. 注意:我已经研究过相同的问题,他们说,使用require_once。 Since it's already coded, what else do you think is the reason for this problem? 由于它已经编码,您认为还有什么原因导致这个问题? I'm very new to PHP, so please bear with me. 我对PHP很新,所以请耐心等待。 Thanks 谢谢

SessionHandler现在(自5.4起)是一个保留类名,你不能将这个名称用于你自己的类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM