Skip to content

In Dev Env should throw exception on deprecations #10028

@ampmonteiro

Description

@ampmonteiro

PHP Version

8.5

CodeIgniter4 Version

4.6.5

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

Linux

Which server did you use?

fpm-fcgi

Environment

development

Database

No response

What happened?

Context:

i was reading code of some colleague, in my job, which find out that he was creating dynamic properties in controllers and in some models.

Strange is that i did not see nothing on screen about the deprecation of dynamic properties, which i knew about deprecation on 8.2+ as deprecation warning.

Steps to Reproduce

To make sure, i also create some dynamic properties in some random controller, when i found out that the warning was only showing / written on a log file but not show on screen.

Expected Output

In dev mode / env should show / throw exception on any kind of error on screen ( be a warning or not), because without a framework, it is what php does.

Should only show the kind of error on log file, only in prod.

How did make ci4 show this kind of errors:

just go to app > Config > Exceptions and change this $logDeprecations prop to:

public bool $logDeprecations = (ENVIRONMENT === 'production') ;

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions