After PHP5, there is an automatic loading mechanism for classes, which can be defined__Autoload function, when an undefined class is used, an error will occur when executing PHP, but at this time, the PHP engine will check whether there is a definition before returning the failure__Autoload to load the required classes
Recently, the project has been switched to php7.0, and an error message “deprecated:__autoload() is deprecated, use spl_autoload_register() instead in**********”
Cause php7 above versions do not support using “function”__Autoload() {} “, this error will be reported
Solution
1. Just lower the PHP version a little, both 5.6 and 5.4
2. Will__Autoload is rewritten to spl_autoload_Register mode loading (recommended)
//Old function __autoload($name) { } //Modified spl_autoload_register(function ($name) { });
The content of the function body remains unchanged. So far, the problem has been solved
Similar Posts:
- [How to Solve] Cannot set property ‘onclick’ of null
- Fatal error: Call-time pass-by-reference has be…
- JavaScript Uncaught TypeError: Cannot set property ‘innerHTML’ of null”
- Actionbar expiration problem
- [Solved] Python 3.9 Start Ride error: Attributeerror: ‘MenuItem’ object has no attribute ‘getlabel’
- document.body.scrollTop or document.documentElement.scrollTop
- Error in JS function referencing public page [How to Solve]
- [Solved] Node.js runs ES6 default import file error: import m1 from’./m1.js’ ^^ SyntaxError: Unexpected identifier
- Flutter run Error: The getter ‘body1’ isn’t defined for the class ‘TextTheme’. – ‘TextTheme’ is from ‘package:flutter/src/material/text_theme.dart’