You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve performance of intval('+0b...', 2) and intval('0b...', 2)
For this benchmark:
```php
<?php
for ($i = 0; $i < 10000000; $i++) {
intval('+0b11111111111100000000', 2);
}
```
On an i7-4790:
```
Benchmark 1: ./sapi/cli/php x.php
Time (mean ± σ): 527.3 ms ± 8.1 ms [User: 523.5 ms, System: 2.4 ms]
Range (min … max): 515.4 ms … 545.1 ms 10 runs
Benchmark 2: ./sapi/cli/php_old x.php
Time (mean ± σ): 629.3 ms ± 6.0 ms [User: 625.9 ms, System: 1.8 ms]
Range (min … max): 622.8 ms … 643.2 ms 10 runs
Summary
./sapi/cli/php x.php ran
1.19 ± 0.02 times faster than ./sapi/cli/php_old x.php
```
ClosesGH-20357.
0 commit comments