Welcome Guest, Not a member yet? Register   Sign In
[split] Strict typing
#1

If there is ever another version before CI4 is released, please amend the following:
PHP Code:
<?php
// file: index.php 

declare(strict_types=1); // PHP 7 specific

ini_set('display_errors','true'); 

Many thanks for the update and look forward to trying it today Smile
Reply
#2

(03-20-2017, 07:00 PM)John_Betong Wrote: If there is ever another version before CI4 is released, please amend the following:
PHP Code:
<?php
// file: index.php 

declare(strict_types=1); // PHP 7 specific

ini_set('display_errors','true'); 

Many thanks for the update and look forward to trying it today Smile


Forcing everyone to use strict typing is not well thought out. Personally, I enjoy PHP's default behavior. Practically, CodeIgniter being easy to use for newbs doesn't mix well with features that require that they actually know what they're doing. That one line of code also has the ability to totally break existing apps that are being upgraded. It'd be the nightmare upgrade for sure.
Reply
#3

(03-21-2017, 09:40 PM)skunkbad Wrote:
(03-20-2017, 07:00 PM)John_Betong Wrote: If there is ever another version before CI4 is released, please amend the following:
PHP Code:
<?php
// file: index.php 

declare(strict_types=1); // PHP 7 specific

ini_set('display_errors','true'); 

Many thanks for the update and look forward to trying it today Smile


Forcing everyone to use strict typing is not well thought out. Personally, I enjoy PHP's default behavior. Practically, CodeIgniter being easy to use for newbs doesn't mix well with features that require that they actually know what they're doing. That one line of code also has the ability to totally break existing apps that are being upgraded. It'd be the nightmare upgrade for sure.

Including the declartion (which is **ONLY** file wide), the following error is triggered:

>>> An uncaught Exception was encountered
>>> Type: TypeError
>>> Message: ini_set() expects parameter 2 to be string, integer given

Personally I prefer to be aware of all errors and warnings which may cause elusive bugs.

Also I am under the impression that eliminating all errors and warnings will increase performance and also prevent unnecessary log file entry overhead which must be detrimental to the application.

As far as newbs are concerned I think it is far better if they are aware of the errors and warnings.
Reply
#4

(03-21-2017, 10:18 PM)John_Betong Wrote:
(03-21-2017, 09:40 PM)skunkbad Wrote:
(03-20-2017, 07:00 PM)John_Betong Wrote: If there is ever another version before CI4 is released, please amend the following:
PHP Code:
<?php
// file: index.php 

declare(strict_types=1); // PHP 7 specific

ini_set('display_errors','true'); 

Many thanks for the update and look forward to trying it today Smile


Forcing everyone to use strict typing is not well thought out. Personally, I enjoy PHP's default behavior. Practically, CodeIgniter being easy to use for newbs doesn't mix well with features that require that they actually know what they're doing. That one line of code also has the ability to totally break existing apps that are being upgraded. It'd be the nightmare upgrade for sure.

Including the declartion (which is **ONLY** file wide), the following error is triggered:

>>> An uncaught Exception was encountered
>>> Type: TypeError
>>> Message: ini_set() expects parameter 2 to be string, integer given

Personally I prefer to be aware of all errors and warnings which may cause elusive bugs.

Also I am under the impression that eliminating all errors and warnings will increase performance and also prevent unnecessary log file entry overhead which must be detrimental to the application.

As far as newbs are concerned I think it is far better if they are aware of the errors and warnings.

Using PHP without strict typing is not an error or something to warn about. It's a feature of PHP, and I prefer it. It makes for great flexibility, and does not restrict me.

I see you are a quite the strict types evangelist: https://forum.codeigniter.com/thread-64011.html

I'm not on the strict types bandwagon. If you love it, then good for you.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB