3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function bin2dec_i($binary_i) { bcscale(0); $decimal_i = '0'; for ($i = 0; $i < strlen($binary_i); $i++) { $decimal_i = bcmul($decimal_i,'2'); $decimal_i = bcadd($decimal_i,$binary_i[$i]); } return($decimal_i); } var_dump(bin2dec_i('001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100101010100101001001000100010010100100100100100100010001001001001001'));;
based on 3iUEI
Output for 5.3.21 - 5.5.28, 5.5.31 - 5.5.33, 5.5.35 - 5.6.12, 5.6.16 - 5.6.19, 5.6.21 - 7.0.4, 7.0.6 - 7.2.0
string(616) "1343817443425835554822546633525067330648027007976373067292288397539940059631536615744827075817903944347238222160232994650010264264164937090040940849772144994757108181507127417283305892778074900902173109379675082397189525558515738645814256614657650482614277234381905055805423811173580907134059077619851709915549572786030202797091838252273639595019065590047537298779362083317056432597762534318821021631039202293598051634550076557712015375502798705784917203275878936952430022563199322480152185094619842069659101769852137257753038550232099120200467705206965283727156579373263713166436230571297625920193535056545649332809"
Output for 7.0.5
Fatal error: Uncaught Error: Call to undefined function bcscale() in /in/YM9d1:5 Stack trace: #0 /in/YM9d1(17): bin2dec_i('001010101001010...') #1 {main} thrown in /in/YM9d1 on line 5
Process exited with code 255.
Output for 5.5.29 - 5.5.30, 5.5.34, 5.6.13 - 5.6.15, 5.6.20
Fatal error: Call to undefined function bcscale() in /in/YM9d1 on line 5
Process exited with code 255.