Re: Recommand exception instead of NaN and Infinity

From: Date: Mon, 19 Aug 2019 10:03:39 +0000
Subject: Re: Recommand exception instead of NaN and Infinity
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-326887@lists.php.net to get a copy of this message
> As of PHP 7.0.0, instead of being undefined and platform-dependent, NaN and Infinity will > always be zero when cast to integer. NaN and Infinity is not of integer type. Janis svētd., 2019. g. 18. aug., plkst. 04:01 — lietotājs Aziz Saleh (<azizsaleh@gmail.com>) rakstīja: > > NaN = Not a number > Infinity = A number that is infinite (ex: log(0)) > > Not sure I understand your question. Can you elaborate on it please. > > On Thu, Aug 15, 2019 at 9:18 PM 251099795 <251099795@qq.com> wrote: >> >> I read that php integer type has NaN and Infinity, >> https://www.php.net/manual/en/language.types.integer.php >> >> I don’t think this make sense. Maybe throwing exceptions when NaN and Infinity is a >> better and simple solution. >> Simple is very important for a programming language.

« previous php.general (#326887) next »