Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:30201 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30502 invoked by uid 1010); 16 Jun 2007 01:58:53 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 30487 invoked from network); 16 Jun 2007 01:58:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jun 2007 01:58:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=andrei@gravitonic.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=andrei@gravitonic.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain gravitonic.com from 204.11.219.139 cause and error) X-PHP-List-Original-Sender: andrei@gravitonic.com X-Host-Fingerprint: 204.11.219.139 mail.lerdorf.com Received: from [204.11.219.139] ([204.11.219.139:35617] helo=mail.lerdorf.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/8A-39713-AD343764 for ; Fri, 15 Jun 2007 21:58:52 -0400 Received: from [192.168.11.2] (c-24-6-152-247.hsd1.ca.comcast.net [24.6.152.247]) (authenticated bits=0) by mail.lerdorf.com (8.14.1/8.14.1/Debian-4) with ESMTP id l5G1widD003644; Fri, 15 Jun 2007 18:58:47 -0700 In-Reply-To: <465BF195.2080300@zend.com> References: <465BF195.2080300@zend.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: Cc: php-dev Content-Transfer-Encoding: 7bit Date: Fri, 15 Jun 2007 18:58:42 -0700 To: Antony Dovgal X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: ClamAV 0.90.3/3434/Fri Jun 15 17:56:15 2007 on colo.lerdorf.com X-Virus-Status: Clean Subject: Re: [PHP-DEV] bitwise operations and Unicode strings From: andrei@gravitonic.com (Andrei Zmievski) I don't think we should support bitwise ops on Unicode strings. I am not even sure why we support them for normal strings. -Andrei On May 29, 2007, at 2:25 AM, Antony Dovgal wrote: > Hello. > > Do you think the engine should support bitwise operators and > Unicode strings? > If yes, how do you think it should work? > > Example: > $a = "1"; $a|="2"; var_dump($a); > ?> > > This code outputs "3" in native mode and "Fatal error: Unsupported > operand types" in Unicode mode. > I believe this is an inconsistency and it should be possible to use > Unicode strings there. > > There are several possible ways to implement it: > 1) the same as with native strings - apply the operator to each > element of the string separately; > 2) convert the string to binary (using say iso-8859-1) and then see > 1); > > We can also leave it as is (since it doesn't seem very useful) or > even drop the native strings support (it doesn't seem very useful > to me either). > Opinions? > > -- > Wbr, Antony Dovgal > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php