Bug #75484 [Opn->Nab]: comparation of int and string

From: Date: Fri, 03 Nov 2017 16:16:11 +0000
Subject: Bug #75484 [Opn->Nab]: comparation of int and string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212438@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75484&edit=1 ID: 75484 Updated by: requinix@php.net Reported by: burhan at wflux dot pro Summary: comparation of int and string -Status: Open +Status: Not a bug Type: Bug Package: Scripting Engine problem Operating System: ubuntu PHP Version: 7.1.11 Block user comment: N Private report: N New Comment: http://php.net/manual/en/language.types.type-juggling.php http://php.net/manual/en/types.comparisons.php Previous Comments: ------------------------------------------------------------------------ [2017-11-03 16:08:23] burhan at wflux dot pro Description: ------------ bug on comparation betwen integer and string parset from same variable. Test script: --------------- //Enter your code here, enjoy! $COMPANY ="942clud_clinic"; $a = ((int)$COMPANY); $b = (string)$COMPANY; echo gettype($a); echo "\n"; echo $a; echo "\n"; echo gettype($b); echo "\n"; echo $b; echo "\n"; if( $a != $b ){ echo 'aaaa'; } else { echo 'bbbb'; } Expected result: ---------------- 'aaaa' Actual result: -------------- 'bbbb' ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75484&edit=1

« previous php.bugs (#212438) next »