Home  >  Article  >  Backend Development  >  A very strange error occurred in php!

A very strange error occurred in php!

藏色散人
藏色散人forward
2021-05-28 14:07:231809browse

This article introduces you to a very strange error in PHP. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

First of all, let’s take a look at what strange error is reported! ?

A very strange error occurred in php!

Argument 1 passed to admins\components\Answer::batchSaveItem() must be an instance of admins\components\int, integer given, called in admins/controllers/LibraryController.php on line 256 and defined

int Isn’t it a specified type? How can it be an instance? ? ?

The following is a summary of some solutions provided by online experts:

The first type:

The probability is to write a line at the top of the file use modules\answer\admin\components\int;

The second option:

is that the PHP version is too low and requires >= 7.0, you can see " https://3v4l.org/Tuqsn

Third option:

Delete the parameter type restriction and it has been restored!

....

Regarding this strange error report, everyone is welcome to leave a message for discussion!

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of A very strange error occurred in php!. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:learnku.com. If there is any infringement, please contact admin@php.cn delete