Hi internals, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt was a similar approach another dynamically typed language recently took to support convenient arbitrary precision.
What are your thoughts on making `123_456_000_000_000_000_000_000n` a shorthand for `gmp_init('123456000000000000000000')` (or a call with equivalent results) (similar to existing backtick string syntax is a shorthand for `shell_exec()`) GMP objects already overrides numeric operators. (but having number-like syntax would make code using those more readable) Supporting bigints as anything other than explicitly different objects in PHP's type system seemed from a discussion thread 5 years ago to have several drawbacks - https://externals.io/message/77863 : - Native bigints by default as a result of integer operations would cause a B.C. break for extensions for php user code relying on float behavior. The way that division would be handled would change, for example. - Decrease in performance was seen during a patch being worked on 5 years ago to automatically convert overflowing integer operations to big integers - Requirement to update opcache's inferences to support big integers A prototype implementation is available at https://github.com/php/php-src/pull/5930 which goes into more details about implementation concerns, licensing of GMP, and other drawbacks of representing them as a GMP/BigInt class instance instead of something separate from regular objects. - Tyson -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php