Welcome Guest, Not a member yet? Register   Sign In
Cannot declare class Attribute, because the name is already in use
#1

(This post was last modified: 11-05-2022, 03:28 PM by CINewb.)

I have a controlled called Attribute.

It worked fine under PHP 7.4 and PHP 8.0 but on PHP 8.1 I get:

"Cannot declare class Attribute, because the name is already in use"

I searched my project and cannot find any other class called Attribute (not even in the system directory).

It doesn't seem to be a reserved keyword either.

Anything else I'm missing?
Reply
#2

You cannot use class Attribute in PHP8, because PHP provides the class.
https://3v4l.org/1LTG3
See https://www.php.net/manual/en/language.a...lasses.php
Reply
#3

I believe it's a reserved word in php 8.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB