Skip to content

Feat: Prevendo erro de inicialização em PHP^8#81

Open
FernandoEbert wants to merge 1 commit intorobsonvleite:masterfrom
FernandoEbert:master
Open

Feat: Prevendo erro de inicialização em PHP^8#81
FernandoEbert wants to merge 1 commit intorobsonvleite:masterfrom
FernandoEbert:master

Conversation

@FernandoEbert
Copy link
Copy Markdown

Existe o seguinte erro: PHP Fatal error: Uncaught Error: Typed static property CoffeeCode\DataLayer\Connect::$instance must not be accessed before initialization in /var/www/html/vendor/coffeecode/datalayer/src/Connect.php:48

Esse erro indica que a propriedade static tipada Connect::$instance da biblioteca CoffeeCode\DataLayer está sendo acessada antes de ser inicializada.

Causa
No PHP 8.1+, quando você define uma propriedade static com tipagem e sem valor padrão, ela deve ser inicializada antes de ser acessada, caso contrário ocorre um erro fatal.

@byuufx byuufx mentioned this pull request Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant