3v4l.org

run code in 300+ PHP versions simultaneously
<?php $num = base_convert("fffffffffffffffe",16,2); $arr = str_split($num); for ($i=0,$max = count($arr)-1; $i <=$max; $i++) { $arr[$i] = ($arr[$i] == '1')? '0' : '1'; } $str = join('',$arr); $converted = '0x'.$str; $result = bcadd($converted, "1",0); var_dump(-$result);

preferences:
35.89 ms | 402 KiB | 5 Q