Answer the question
In order to leave comments, you need to log in
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
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.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question