Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67907 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37284 invoked from network); 26 Jun 2013 19:40:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2013 19:40:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.182 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.214.182 mail-ob0-f182.google.com Received: from [209.85.214.182] ([209.85.214.182:38566] helo=mail-ob0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/67-29746-6934BC15 for ; Wed, 26 Jun 2013 15:40:06 -0400 Received: by mail-ob0-f182.google.com with SMTP id va7so13694425obc.41 for ; Wed, 26 Jun 2013 12:40:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qoUeQvzcZ2BCKCXdPeSdkQAMLVFpO1CLnD6LgwvhUus=; b=T/GTsSYK3a4oUyaLFu6Hu9XP8AHu74bPrhZwlGTy2p+xOzYCz1xNqxj27HLPGgD+JM yX0CJ+MKhItC/9RabBly9HedTHAkbuQQDHDeUKo+avKbXKC6k+VQ8st2mkyJgZ7apqQq q7KhRYaNHn75Mqsdkv5RgsPpWM6AiulMM+KL72WeX3XavI9WO04A2Ns9w8KylDFuUU9/ 5/b7cSatrRLeyggAkvbZCVcLNPQlr22nYI3zAB1gc7OdAAlLLBLxjKFLRFmbjBRPkoTf VfpkacAYlI13qJifjyTkpJuPXHI3lVJEmQYPjKm5zvvvOjvrmOXzrmfan7ZQ0pmr3IRr DyPg== MIME-Version: 1.0 X-Received: by 10.60.42.174 with SMTP id p14mr1226446oel.73.1372275602872; Wed, 26 Jun 2013 12:40:02 -0700 (PDT) Received: by 10.182.89.170 with HTTP; Wed, 26 Jun 2013 12:40:02 -0700 (PDT) In-Reply-To: References: Date: Wed, 26 Jun 2013 21:40:02 +0200 Message-ID: To: Yasuo Ohgaki Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c2519ad7e32904e013cf72 Subject: Re: [PHP-DEV] hex2bin: E_WARNING is too much for odd string? From: nikita.ppv@gmail.com (Nikita Popov) --001a11c2519ad7e32904e013cf72 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jun 26, 2013 at 9:21 PM, Yasuo Ohgaki wrote: > Hi all, > > hex2bin raises E_WARNING for odd length hex strings from PHP 5.4.1. > http://jp2.php.net/manual/en/function.hex2bin.php > However, just returning FALSE is easier for programmers. > Why is it easier? If you pass an odd length string to hex2bin you have malformed input, which is usually a bug on the programmers side. Not having a warning would make the issue harder to debug. Nikita --001a11c2519ad7e32904e013cf72--