note 126055 deleted from intro.bc by cmb
| From: | cmb@php.net | Date: | Fri, 07 May 2021 12:19:42 +0000 |
| Subject: | note 126055 deleted from intro.bc by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-216355@lists.php.net to get a copy of this message | ||
Note Submitter: crtmsvc at gmail dot com
----
The regular expression is not quite right as I testing.
The number 20.00000509 which not match /^[+-]?[0]*[1-9]*[.]?[0-9]*$/ will pass the bcmatch format.
I think reference to source in the php_str2num function will be better. It is more like
/^[+-]?(0|[1-9][0-9]*)[.]?[0-9]*$/ to me.
https://github.com/php/php-src/blob/master/ext/bcmath/bcmath.c