• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[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
CI4 - Playground:
    https://www.john-betong.tk/test/1/42
CI 3.15  -  AmpProject 
     http://tools.pingdom.com/fpt/#!/uC1KU/ww...-jokes.com

Reply

#2
(03-20-2017, 08: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, 10:40 PM)skunkbad Wrote:
(03-20-2017, 08: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.
CI4 - Playground:
    https://www.john-betong.tk/test/1/42
CI 3.15  -  AmpProject 
     http://tools.pingdom.com/fpt/#!/uC1KU/ww...-jokes.com

Reply

#4
(03-21-2017, 11:18 PM)John_Betong Wrote:
(03-21-2017, 10:40 PM)skunkbad Wrote:
(03-20-2017, 08: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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.