Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87083 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78426 invoked from network); 9 Jul 2015 07:10:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jul 2015 07:10:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=phofstetter@sensational.ch; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=phofstetter@sensational.ch; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sensational.ch designates 195.226.6.199 as permitted sender) X-PHP-List-Original-Sender: phofstetter@sensational.ch X-Host-Fingerprint: 195.226.6.199 mail.sensational.ch Received: from [195.226.6.199] ([195.226.6.199:35996] helo=mail.sensational.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8E/71-32504-B5E1E955 for ; Thu, 09 Jul 2015 03:10:20 -0400 Received: from mail-wg0-f41.google.com ([74.125.82.41]:34912) by mail.sensational.ch with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.76 and XAMS 0.0.20) id 1ZD5yK-0000lq-EN for internals@lists.php.net; Thu, 09 Jul 2015 09:10:16 +0200 Received: by wgjx7 with SMTP id x7so214780908wgj.2 for ; Thu, 09 Jul 2015 00:10:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=4i0fAWgGk86kbQlDQ6OhYdgnRvmQ4puJtbPPT9N2TsQ=; b=NS++znpuEX7PX8rX7RgLCAh9uI+ABBYzb5+jYiD6Nd3jvXXSBij1uNbfp1vRsn0+py fmU+TL3g5p2ljqFEM5N7N5AS7m8XrwdVP7Qo4IDESVtQGC5glXHI97QOyGA/kQZxIk7T XFGjdxYKaBMPMs/Hgu4TkDdYeWtPZC8lAoZ2EKlNLB1p1hUw5vfQNj4Hc3RnbNVmg8YC Y7HSm3N1itVAeroIismm8iokZ6JpineygUcUb9NYqGWmOUm1TDej6OmbVrVxyV3MaRKH qQkl1QuUCrSsGZGHMg0FhWwFanrIBiRATdMEVCBKQQfVocUMvQDPD74ePgXGQhOYGyzV 634g== X-Gm-Message-State: ALoCoQmZ/aW1LG/FUcYlp5+J7YbqYKXMTy/nNPW6Opw/dr/QI1d2smH0Drq++BhLRu8pth+L2BA6AAu7WNTJGuAaw+dtVJgczC7M6Yvk5VeN6FO9/70THw9MaYUeeRrwvjeZKwlv3zYNKONyVNWGMnNXCS2o1fvHrA== X-Received: by 10.194.21.70 with SMTP id t6mr29658125wje.74.1436425816050; Thu, 09 Jul 2015 00:10:16 -0700 (PDT) X-Received: by 10.194.21.70 with SMTP id t6mr29658112wje.74.1436425815986; Thu, 09 Jul 2015 00:10:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.143.133 with HTTP; Thu, 9 Jul 2015 00:09:56 -0700 (PDT) In-Reply-To: <559D7DE1.8000603@gmail.com> References: <559D7DE1.8000603@gmail.com> Date: Thu, 9 Jul 2015 09:09:56 +0200 Message-ID: To: Stanislav Malyshev Cc: Net Mo , PHP internals Content-Type: text/plain; charset=UTF-8 X-SA-Do-Not-Run: Yes X-SA-Exim-Connect-IP: 74.125.82.41 X-SA-Exim-Mail-From: phofstetter@sensational.ch X-SA-Exim-Scanned: No (on mail.sensational.ch); SAEximRunCond expanded to false Subject: Re: [PHP-DEV] Change IntlChar::getNumericValue() to return something less horrible when the char is not numeric? From: phofstetter@sensational.ch (Philip Hofstetter) Hi On Wed, Jul 8, 2015 at 9:45 PM, Stanislav Malyshev wrote: >> I would change the function to return NULL instead; what do you think? > > While the exact value of U_NO_NUMERIC_VALUE looks weird, nobody is going > to use it directly, you'd be using U_NO_NUMERIC_VALUE. Comparing to it > doesn't look wrong. So changing that to null doesn't seem to improve > much, just introduce incompatibility with ICU. personally, I think null (or even false) is better because it's of a different type (and falsy) and thus more likely to get noticed that something is wrong. In PHP, you're used to checking for null or false. Having to deal with values that look like they are within valid ranges and which also validate to something true-ish is needlessly difficult and unexpected. The unicode standard apparently wants to use NaN, so ICU is already deviating from the standard. Philip