3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $num = base_convert("ffffffffffffffff",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);
Output for 5.0.0 - 5.3.29, 5.5.17, 5.6.0 - 5.6.38, hhvm-3.10.1 - 3.22.0, 7.0.0 - 7.2.11
int(-1)
Output for 5.4.0 - 5.5.16, 5.5.18 - 5.5.38
Fatal error: Call to undefined function bcadd() in /in/YrDQS on line 10
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: str_split() in /in/YrDQS on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: str_split() in /in/YrDQS on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: str_split() in /in/YrDQS on line 3