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

(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:
// file: index.php 

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


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.

Messages In This Thread
[split] Strict typing - by John_Betong - 03-20-2017, 07:00 PM
RE: CodeIgniter 3.1.4 released - by skunkbad - 03-21-2017, 09:40 PM
RE: CodeIgniter 3.1.4 released - by John_Betong - 03-21-2017, 10:18 PM
RE: CodeIgniter 3.1.4 released - by skunkbad - 03-21-2017, 10:59 PM

Theme © iAndrew 2016 - Forum software by © MyBB