D
D
Diman Suvorkin2018-02-23 14:23:13
Yii
Diman Suvorkin, 2018-02-23 14:23:13

How to fix Cannot use 'Object' as class name as it is reserved?

I have php 7.2. I am using the Yii2 framework. Constantly throws an error Cannot use 'Object' as class name as it is reserved. I read on the Internet how to fix it, but nothing helped. How to solve this problem anyway?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexey Ukolov, 2018-02-23
@alexey-m-ukolov

https://github.com/yiisoft/yii2/issues/14823

A
Andrey, 2018-02-23
@VladimirAndreev

Update to 2.0.13.1

W
W1zer, 2018-08-22
@W1zer

It helped me: https://github.com/yiisoft/yii2/issues/14823#issue... The
trick is, you can't use Object in php 7 and higher. Rather, in some modules, it connects to you.
In this module I had extends \yii\base\Object :
Replaced extends \yii\base\Object with extends \yii\base\BaseObject - the error is gone.

D
dbuhonov, 2020-04-28
@dbuhonov

/vendor/nodge/yii2-eauth/src/EAuth.php
/vendor/nodge/yii2-eauth/src/ServiceBase.php
Replace \yii\base\Object with \yii\base\BaseObject

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question