3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $serialized_data = serialize(array('Math', 'Language', 'Science')); echo $serialized_data . '<br>'; // Unserialize the data $var1 = unserialize($serialized_data); // Show the unserialized data; foreach ($serialized_data[0] as $desg): echo $desg; endforeach; print_r(unserialize($serialized_data)); ?>
based on EV0HG
Output for 4.3.0 - 4.3.10, 4.4.0 - 7.2.0
a:3:{i:0;s:4:"Math";i:1;s:8:"Language";i:2;s:7:"Science";}<br> Warning: Invalid argument supplied for foreach() in /in/aZpqk on line 7 Array ( [0] => Math [1] => Language [2] => Science )
Output for 4.3.11
a:3:{i:0;s:4:"Math";i:1;s:8:"Language";i:2;s:7:"Science";}<br>Array ( [0] => Math [1] => Language [2] => Science )