3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = ['a'=>'b','c'=>'d','e'=>'f']; $a = serialize($arr); echo $a.'<br>'; echo unserialize($a).'<br>'; echo json_encode($arr).'<br>'; echo msgpack_pack($arr) ?>
based on aNae2
Output for 7.0.0 - 7.2.0
a:3:{s:1:"a";s:1:"b";s:1:"c";s:1:"d";s:1:"e";s:1:"f";}<br> Notice: Array to string conversion in /in/Q9tBu on line 7 Array<br>{"a":"b","c":"d","e":"f"}<br> Fatal error: Uncaught Error: Call to undefined function msgpack_pack() in /in/Q9tBu:9 Stack trace: #0 {main} thrown in /in/Q9tBu on line 9
Process exited with code 255.
Output for 5.4.0 - 5.6.28
a:3:{s:1:"a";s:1:"b";s:1:"c";s:1:"d";s:1:"e";s:1:"f";}<br> Notice: Array to string conversion in /in/Q9tBu on line 7 Array<br>{"a":"b","c":"d","e":"f"}<br> Fatal error: Call to undefined function msgpack_pack() in /in/Q9tBu on line 9
Process exited with code 255.