Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82167 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39731 invoked from network); 8 Feb 2015 20:10:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Feb 2015 20:10:58 -0000 Authentication-Results: pb1.pair.com header.from=dev@mabe.berlin; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=dev@mabe.berlin; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mabe.berlin from 80.237.132.167 cause and error) X-PHP-List-Original-Sender: dev@mabe.berlin X-Host-Fingerprint: 80.237.132.167 wp160.webpack.hosteurope.de Received: from [80.237.132.167] ([80.237.132.167:38101] helo=wp160.webpack.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/72-26926-1D2C7D45 for ; Sun, 08 Feb 2015 15:10:57 -0500 Received: from dslb-188-102-038-011.188.102.pools.vodafone-ip.de ([188.102.38.11] helo=[192.168.178.30]); authenticated by wp160.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) id 1YKYBy-0007gU-A8; Sun, 08 Feb 2015 21:10:54 +0100 Message-ID: <54D7C2CD.7040707@mabe.berlin> Date: Sun, 08 Feb 2015 21:10:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;dev@mabe.berlin;1423426257;8ef087c4; Subject: PHP6 artifact - binary strings From: dev@mabe.berlin (Marc Bennewitz) Hi all, Since PHP-5.2.1 we have an artifact of PHP-6 in the engine means we can define binary strings but such definitions haven't any effect. So what we can define is the following: $str = "str"; $bin = b"b\0i\0n"; $str2bin = (binary)$str; One of the biggest issue is that currently ALL strings will be handled as ASCII-7 compatible strings on type-juggling but they aren't. It would be very appreciated if PHP could respect such binary declaration: * use binary string comparison on compare a binary string to any other string * don't convert binary strings into integers on array keys * allow bitwise operators on binary strings without casting to integer I don't wont to open such unicode nightmare as it was planned for PHP-6! In my opinion the above operator changes are enough and therefore internal functions doesn't need to be changed in the first place. The only changes *could* be done to functions reading/parsing data to be auto marked binary like: unpack, stream reading functions opened with fopen + "b" ... I don't have enough zend experience and therefore I would like to know how complicated it would be. Thoughts? Marc