3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $packed = 'Hello world'; $data = array(); $data[0] = unpack('a5', $packed); $data[1] = unpack('Z5', $packed); var_dump($data);
Output for 5.5.0 - 5.6.21, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(2) { [0]=> array(1) { [1]=> string(5) "Hello" } [1]=> array(1) { [1]=> string(5) "Hello" } }
Output for 4.4.8 - 4.4.9, 5.2.4 - 5.4.45
Warning: unpack(): Invalid format type Z in /in/AuZrK on line 5 array(2) { [0]=> array(1) { [1]=> string(5) "Hello" } [1]=> bool(false) }
Output for 4.3.5 - 4.4.7, 5.0.0 - 5.2.3
array(2) { [0]=> array(1) { [1]=> string(5) "Hello" } [1]=> array(0) { } }
Output for 4.3.0 - 4.3.4
array(2) { [0]=> array(1) { [""]=> string(5) "Hello" } [1]=> array(0) { } }