Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60078 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84879 invoked from network); 17 Apr 2012 11:57:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2012 11:57:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=simonsimcity@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=simonsimcity@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.213.42 as permitted sender) X-PHP-List-Original-Sender: simonsimcity@googlemail.com X-Host-Fingerprint: 209.85.213.42 mail-yw0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:58698] helo=mail-yw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0E/13-03996-0CA5D8F4 for ; Tue, 17 Apr 2012 07:57:52 -0400 Received: by yhfq11 with SMTP id q11so3323198yhf.29 for ; Tue, 17 Apr 2012 04:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=NNp3s4vjTswh2o93K/M9c4uOh1uSaCNTuLnS/WTzB9c=; b=hsXt9Prqkd35iHqMutLpLLh6iqBS+sr6EyFO7btnkazWLsfQUP58OQFrfMM5PaHZZ2 TI6JjfNNnm3T0cg7Z9Y+cVedDPnlmxT2Dx/mEKnKMq3f14ntgSprUFOjGdybmNX1hVul j2RTzxdsbK9oI2aYT+vxJlpDCUkwqTfli17URSof5IrH7PqbHDPSNuunZ/kVnq4shOkk UlDfaMlA3P2S2/TPcr0HAxJinaCKS5MPH4eBISZAeZFcR8L7iiCl7K3WG3YYZSRSAk0b ZwdpusB8WfnCqZTAyE7bwT2z/ypZf27egzCe4W+HwTLS5n8fZSg+ohmdUkbPDoWH75I/ vbfw== MIME-Version: 1.0 Received: by 10.60.28.137 with SMTP id b9mr20947054oeh.57.1334663869626; Tue, 17 Apr 2012 04:57:49 -0700 (PDT) Received: by 10.60.98.74 with HTTP; Tue, 17 Apr 2012 04:57:49 -0700 (PDT) In-Reply-To: References: Date: Tue, 17 Apr 2012 13:57:49 +0200 Message-ID: To: Gustavo Lopes Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] is_numeric_string an hexadecimal numbers ("123" == "0x7B") From: simonsimcity@googlemail.com (Simon Schick) 2012/4/17 Gustavo Lopes : > > I think that would be an error. As was mentioned a few months ago when 0b > was introduced, no other number format has this behavior. You can't do "123" > == "0b10" or "123" == "0876". Extending this hexadecimal oddity instead of > eliminating it is inconsistent with the treatment given to those other > formats. > > -- > Gustavo Lopes > Hi, Gustavo That's something I didn't know of ... if we're doing that, it should, of course, be also be done for the dual system. The only thing I wonder about is the code examples you're giving ... I would expect this to work if we start to change something here: var_dump((int) '0x7b'); // int(123) var_dump((int) '0b1111011'); // int(123) var_dump((int) '0123'); // int(123) The last example was not mentioned here before but as you set in an example, I did it here as well ... Bye Simon