php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #46734 New flag to turn off / notify implicit type conversions
Submitted: 2008-12-03 10:40 UTC Modified: 2018-05-05 19:44 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: emarco at uol dot com dot br Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 5.2.6 OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: emarco at uol dot com dot br
New email:
PHP Version: OS:

 

 [2008-12-03 10:40 UTC] emarco at uol dot com dot br
Description:
------------
That would be nice to be able to turn off any kind of type conversions in PHP. Since I started coding in PHP, I noticed many bugs in my code are due to unexpected type conversions in PHP, things like the string '0' (zero) being considered equal to the boolean false.

If we could turn off this kind of behaviour, or make PHP generate an alert/warning every time it finds itself comparing data of different types, that would be a powerful debugging tool for all of us. 

Thanks!


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-12 20:29 UTC] klaussantana at gmail dot com
This would resolve your problems:

http://www.php.net/manual/en/language.operators.comparison.php

Use the IDENTICAL (===) and NOT IDENTICAL (!==) comparsion operators...
 [2018-05-05 19:44 UTC] requinix@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2018-05-05 19:44 UTC] requinix@php.net
Old request is old.

Use strict comparisons.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 00:01:32 2024 UTC