note 123633 added to function.is-numeric

From: Date: Thu, 21 Feb 2019 10:48:50 +0000
Subject: note 123633 added to function.is-numeric
Groups: php.notes 
Request: Send a blank email to php-notes+get-210272@lists.php.net to get a copy of this message
Note that strings with leading zeros containing only digits also return true on check with is_numeric, although they might be not a valid number. Example: <?php $x = 009; // this is invalid php code, 009 is not octal $y = 007; // this is valid php code, 007 is octal $z = 01.12; // this also is valid php code var_dump(is_numeric("009")); // outputs true var_dump(is_numeric("007")); // outputs true var_dump(is_numeric("00.12")); // outputs true ?> ---- Server IP: 208.43.231.9 Probable Submitter: 185.85.3.142 (proxied: 212.65.13.82) ---- Manual Page -- http://php.net/manual/en/function.is-numeric.php Edit -- https://master.php.net/note/edit/123633 Del: integrated -- https://master.php.net/note/delete/123633/integrated Del: useless -- https://master.php.net/note/delete/123633/useless Del: bad code -- https://master.php.net/note/delete/123633/bad+code Del: spam -- https://master.php.net/note/delete/123633/spam Del: non-english -- https://master.php.net/note/delete/123633/non-english Del: in docs -- https://master.php.net/note/delete/123633/in+docs Del: other reasons-- https://master.php.net/note/delete/123633 Reject -- https://master.php.net/note/reject/123633 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#210272) next »