php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70247 case eq
Submitted: 2015-08-12 14:14 UTC Modified: 2015-08-12 15:20 UTC
From: rh at hrdns dot de Assigned: cmb (profile)
Status: Not a bug Package: *General Issues
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
 [2015-08-12 14:14 UTC] rh at hrdns dot de
Description:
------------
Case/EQ Bug?

'c' => 'c'
(int)'c' => '0'
(int)(bool)'c' => '1'

o0 ?

Test script:
---------------
var_dump( 'a' == ((int)'c') );
var_dump( '1' == ((int)'3') );

Expected result:
----------------
bool(false)
bool(false)

Actual result:
--------------
bool(true)
bool(false)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-08-12 15:20 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2015-08-12 15:20 UTC] cmb@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

See <http://php.net/manual/en/language.types.type-juggling.php#language.types.typecasting>.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 03:01:33 2024 UTC