#25533 [Opn->Bgs]: or with strings is wrong

From: Date: Tue, 16 Sep 2003 13:48:42 +0000
Subject: #25533 [Opn->Bgs]: or with strings is wrong
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-47630@lists.php.net to get a copy of this message
ID: 25533 Updated by: sniper@php.net Reported By: spagmoid at yahoo dot com -Status: Open +Status: Bogus Bug Type: Strings related Operating System: WinXP PHP Version: 4.3.3 New Comment: No. Now forget about it. Previous Comments: ------------------------------------------------------------------------ [2003-09-15 23:15:50] spagmoid at yahoo dot com if $A+$B works, then $A|$B should work as well. '|' is not '.' ------------------------------------------------------------------------ [2003-09-15 22:55:58] iliaa@php.net Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. echo (int)$A|(int)$B; ------------------------------------------------------------------------ [2003-09-15 22:52:33] spagmoid at yahoo dot com Uhh.. "do not"? That's your solution? You're kidding, right? OK how about this. Values returned from mysql. $A = "146"; $B = "2"; echo $A|$B; result: 346 ------------------------------------------------------------------------ [2003-09-14 20:08:36] iliaa@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 Do not perform bitwise operations on strings. ------------------------------------------------------------------------ [2003-09-14 11:47:47] spagmoid at yahoo dot com Description: ------------ This is a difficult issue to search for dups on. Strings used with pipe OR "|" do something weird. Here it is: echo "146"|"2"; result is "346" echo (int)"146"|"2"; result is correct "146"; ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25533&edit=1

« previous php.bugs (#47630) next »