3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function pack_decode($format, $val) { } function pack_encode($format, $val) { $base64 = base64_encode(pack($format, $val)); return str_replace(array('/', '='), array('_', ''), $base64); } function pack_encode_uint16($val) { return pack_encode('S', $val); } function pack_encode_uint32($val) { return pack_encode('S', $val); } $max = 32767; $n = 20; $step = intval($max/$n); for ($i=0; $i<=$n; $i++) { $val = $i*$step; $uint16 = pack_encode_uint16($val); $uin326 = pack_encode_uint32($val); $str = base64_encode(strval($val)); echo json_encode("$uint16 $uint32 $str $val") . "\n"; }
based on 4o1kG
Output for 5.2.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: uint32 in /in/00QoH on line 29 "AAA MA== 0" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "ZgY MTYzOA== 1638" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "zAw MzI3Ng== 3276" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "MhM NDkxNA== 4914" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "mBk NjU1Mg== 6552" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "_h8 ODE5MA== 8190" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "ZCY OTgyOA== 9828" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "yiw MTE0NjY= 11466" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "MDM MTMxMDQ= 13104" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "ljk MTQ3NDI= 14742" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "_D8 MTYzODA= 16380" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "YkY MTgwMTg= 18018" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "yEw MTk2NTY= 19656" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "LlM MjEyOTQ= 21294" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "lFk MjI5MzI= 22932" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "+l8 MjQ1NzA= 24570" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "YGY MjYyMDg= 26208" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "xmw Mjc4NDY= 27846" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "LHM Mjk0ODQ= 29484" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "knk MzExMjI= 31122" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "+H8 MzI3NjA= 32760"
Output for hhvm-3.10.0 - 3.13.2
Notice: Undefined variable: uint32 in /in/00QoH on line 29 "AAA MA== 0" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "ZgY MTYzOA== 1638" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "zAw MzI3Ng== 3276" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "MhM NDkxNA== 4914" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "mBk NjU1Mg== 6552" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "_h8 ODE5MA== 8190" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "ZCY OTgyOA== 9828" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "yiw MTE0NjY= 11466" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "MDM MTMxMDQ= 13104" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "ljk MTQ3NDI= 14742" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "_D8 MTYzODA= 16380" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "YkY MTgwMTg= 18018" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "yEw MTk2NTY= 19656" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "LlM MjEyOTQ= 21294" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "lFk MjI5MzI= 22932" Notice: Undefined variable: uint32 in /in/00QoH on line 29 "+l8 MjQ1NzA= 24570" "YGY MjYyMDg= 26208" "xmw Mjc4NDY= 27846" "LHM Mjk0ODQ= 29484" "knk MzExMjI= 31122" "+H8 MzI3NjA= 32760"
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_encode() in /in/00QoH on line 29
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_encode() in /in/00QoH on line 29
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_encode() in /in/00QoH on line 29
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_encode() in /in/00QoH on line 29