Open
Description
Description
The following code:
<?php
$s = "-0b11111111111111111111111111111111111111111111111111111111111111111111111111111";
$v1 = intval($s, 2);
var_dump($v1);
$v2 = intval($s);
var_dump($v2);
var_dump((int) $s);
Resulted in this output:
int(-9223372036854775808)
int(0)
int(0)
But I expected this output instead:
int(-9223372036854775808)
int(-9223372036854775808)
int(0)
Similarly, if we use $base = 16
Note the 0o
prefix is not supported (which is what initially led me down this rabbit hole).
PHP Version
PHP 8.3
Operating System
No response