Skip to content

Bug: Fatal error: Cannot declare class CodeIgniter\Exceptions\PageNotFoundException #3067

Description

@enix-app

Describe the bug

This is not intentional,

I added route:

$routes->get('/test/(:num)', 'Home::index');

I tried in bar url:

http://localhost:8080/test/([0-9]+)

http://localhost:8080//

http://localhost:8080/test/abc

Show me an error:

Fatal error: Cannot declare class CodeIgniter\Exceptions\PageNotFoundException, because the name is already in use in D:\codeigniter4\CodeIgniter4-test\system\Exceptions\PageNotFoundException.php on line 3

Fatal error: Cannot declare class CodeIgniter\Exceptions\PageNotFoundException, because the name is already in use in D:\codeigniter4\CodeIgniter4-test\system\Exceptions\PageNotFoundException.php on line 3

CodeIgniter 4 version
development, last commit #3062 , fresh install

Affected module(s)
Exception class, Router class

Context

  • Environment: development
  • OS: Win10
  • Built-in PHP Web server, Apache2.4
  • PHP 7.3

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

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions