Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76729 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91739 invoked from network); 20 Aug 2014 10:46:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Aug 2014 10:46:16 -0000 Authentication-Results: pb1.pair.com header.from=mike.php.net@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=mike.php.net@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.179 as permitted sender) X-PHP-List-Original-Sender: mike.php.net@gmail.com X-Host-Fingerprint: 209.85.212.179 mail-wi0-f179.google.com Received: from [209.85.212.179] ([209.85.212.179:63728] helo=mail-wi0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 58/F2-11231-77C74F35 for ; Wed, 20 Aug 2014 06:46:16 -0400 Received: by mail-wi0-f179.google.com with SMTP id f8so6701921wiw.6 for ; Wed, 20 Aug 2014 03:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=u3tbl6XzpdGfeJXVB7aqRfSCvSmdeaaVxGFUKyWNBZI=; b=XORH27Mq6SbI32Y5ym8H1lgHuwOHlP/GgUi7NR8cPiPoYzleWlfLiljzZL1X7OPpa9 kVHGX13QtKDRUFjVRU5aULCF4jMtuV0DXeaW4YAB2SsJrwShbd7yojz0X2xk83xv2aYg o2vExyL32LUoUzl8iOtnBpMAjxrTIdbAr2tCh/HOe1/6Qypo4oXyBxpS+0nsutaRfgzS F4++/HKVso4GK/5IyPuyrG8eUzUwsYkQ5IxvotXcwfscAZCxHkvr0X1kNstNkdeJYKRX W8Vurb4LHt02YrXV7nit5kIVkmNFS98DZLyHEeZuui//MIg8gffqDOZ252L0b3+AfGQK BeCA== X-Received: by 10.180.80.133 with SMTP id r5mr13874902wix.62.1408531573066; Wed, 20 Aug 2014 03:46:13 -0700 (PDT) Received: from [192.168.4.120] (178-18-170-101.customer.bnet.at. [178.18.170.101]) by mx.google.com with ESMTPSA id fp6sm8021658wic.11.2014.08.20.03.46.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Aug 2014 03:46:12 -0700 (PDT) Sender: Michael Wallner Message-ID: <53F47C73.4090205@php.net> Date: Wed, 20 Aug 2014 12:46:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Marc Bennewitz , =?UTF-8?B?Sm9oYW5uZXMgU2NobMO8dGVy?= , Tjerk Meesters CC: Sara Golemon , PHP internals References: <53F1094B.4040100@mabe.berlin> <53F1F534.50109@mabe.berlin> <1408373244.2617.344.camel@guybrush> <37CD1B56-B84F-4586-A631-F3C7F2547FBE@gmail.com> <1408375856.2617.353.camel@guybrush> <1408376583.2617.357.camel@guybrush> <53F46671.8020601@mabe.berlin> In-Reply-To: <53F46671.8020601@mabe.berlin> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Binary String Comparison From: mike@php.net (Michael Wallner) On 20/08/14 11:12, Marc Bennewitz wrote:> > > On 18.08.2014 17:43, Johannes Schlüter wrote: >> On Mon, 2014-08-18 at 17:30 +0200, Johannes Schlüter wrote: >>> foreach ($db->query("SELECT id, title FROM entries") as $row) { >>> echo ">> if ($row[0] == $_GET['highlight_id']) { >>> echo " background='#ff0000'"; >>> } >>> echo ">".htmlentities($row[1]).""; >>> } >>> >>> will suddenly fail. How wonderful! (irony) >> >> Just to make this more fun: Assume $db is PDO then the behavior will >> depend on the driver (and for some drivers even at the configuration, >> i.e. setting of PDO::ATTR_EMULATE_PREPARES with MySQL) what will happen. > > I don't understand exactly what you mean here. This RFC has nothing todo > with DB layer and PDO. > > Do you have any example where a DB returns integers differently? php -r '$p = new PDO("mysql:user=root"); \ $s=$p->prepare("SELECT 1"); $s->execute(); \ var_dump($s->fetchAll()); \ $p->setAttribute(PDO::ATTR_EMULATE_PREPARES,false); \ $s=$p->prepare("SELECT 1"); $s->execute(); \ var_dump($s->fetchAll());' array(1) { [0]=> array(2) { [1]=> string(1) "1" [2]=> string(1) "1" } } array(1) { [0]=> array(2) { [1]=> int(1) [2]=> int(1) } } -- Regards, Mike