Skip to content

Bug: CI_DEBUG incorrect type and fails strict validation #2975

Description

@John-Betong

Adding the following script to index.php and to every single ./system PHP file makes the script compatible with the PHP Strict 7.?? source.

If and only if 'declare(strict_types=1)' is declared in the parent file will strict_types have any effect.

The following three files fail PHP strict validation because they "type juggle" to change the numeric to a bool:

Files:
./app/Config/Boot/development.php
./app/Config/Boot/production.php
./app/Config/Boot/testing.php

// FAIL
// defined('CI_DEBUG') || define('CI_DEBUG', 1);

// PASS:
defined('CI_DEBUG') || define('CI_DEBUG', TRUE);

These three small changes make it possible to render the Welcome page using PHP Strict Mode.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementPRs that improve existing functionalities

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions