Is strict_types=1 still necessary? |
Hi,
All my code in ci3 had these two lines at the top of the page: PHP Code: declare(strict_types=1); Are they still needed in ci4? Thanks
Declaring strict_types was never required in CI3, but it's good to have to help with obscure errors. You can still use it if you want or need to. The defined BASEPATH is no longer used in CI4.
declare(strict_types=1); is good practice.
See https://www.php.net/manual/en/language.t...ons.strict CI4 does not use the constant BASEPATH. So if you don't remove defined('BASEPATH') OR exit('No direct script access allowed');, CI4 does not work. |
Welcome Guest, Not a member yet? Register Sign In |