Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67911 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60867 invoked from network); 26 Jun 2013 22:38:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2013 22:38:08 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.50 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.50 mail-la0-f50.google.com Received: from [209.85.215.50] ([209.85.215.50:43789] helo=mail-la0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/D1-51393-E4D6BC15 for ; Wed, 26 Jun 2013 18:38:08 -0400 Received: by mail-la0-f50.google.com with SMTP id dy20so34909lab.23 for ; Wed, 26 Jun 2013 15:38:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=3CrfwcGVGb323ki+w164cFJ2qT+Y1a3z3NKs1FWnhLU=; b=CKtAH4p3eUSnepOHweDiBrBpgtqoZJQFD26PD+5WG59hPkGLdlN7Br17hbQ2hnvyY/ RsATJPBovGFHFKH/8WajopQ+NmkuU34B87aJnqnTUpucDbueWvnWQLXa0zaQaVUZZYE/ esbVFFcaWP6eyku9gFoexdkmMuhd1y52l5OLLS/Gjo1icSTwHm/9XTX++gIJoqSc2cx2 +k0MO2DvgceoW3KC7KDmI7vbi9mTXHlB/CQXhOQElh887XNI+LiZaFqbT2V7nr2Wb7QZ bhnuKgqmeNToqZQ4AqNrQOlFZmWneK0JwL87bFZlkt7Tl1sWriGYySU+qEZedHGK4ksU nBMA== X-Received: by 10.112.140.231 with SMTP id rj7mr3138702lbb.16.1372286283152; Wed, 26 Jun 2013 15:38:03 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.4.233 with HTTP; Wed, 26 Jun 2013 15:37:23 -0700 (PDT) In-Reply-To: References: Date: Thu, 27 Jun 2013 07:37:23 +0900 X-Google-Sender-Auth: CH3XL7qcFGhp-od3dbKzzOTDU5k Message-ID: To: Kalle Sommer Nielsen Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c26a3070051a04e0164c0a Subject: Re: [PHP-DEV] hex2bin: E_WARNING is too much for odd string? From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c26a3070051a04e0164c0a Content-Type: text/plain; charset=ISO-8859-1 Hi Kalle, Thank you for notifying E_ERROR/E_WARNING mistake. 2013/6/27 Kalle Sommer Nielsen > We already fixed a few of those in the past, I believe when 5.3 > was shipped, we had pretty much killed all of those along when the new > parameter parsing API was being standardized. > hex2bin() is PHP 5.4 function and the behavior was change by PHP 5.4.1 so that raise E_WARNING for invalid length. > I agree that this E_WARNING is sort of serve, and we should just return false for invalid values I prefer returning FALSE. Raising E_WARING/E_NOTICE for all invalid hex would work, too. > maybe an E_NOTICE could work better here even in case something fails > and the developer must know WHY this happened, I believe we do this in > a few places around the core and its extensions. Yes, there are. We would be better to have error/exception handling guideline for consistent behavior for future releases. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c26a3070051a04e0164c0a--