3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function mb_unserialize($string) { $string = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $string); return unserialize($string); } $string = <<<HERE a:1:{i:0;a:15:{s:2:"ID";s:3:"157";s:3:"qty";i:1;s:4:"name";s:21:"?????\?????";s:6:"nameHe";s:21:"?????\?????";s:6:"nameEn";s:21:"?????\?????";s:5:"price";d:80;s:8:"priceNet";d:80;s:10:"priceGross";d:96.7999999999999971578290569595992565155029296875;s:3:"sum";d:80;s:6:"sumNet";d:80;s:8:"sumGross";d:96.7999999999999971578290569595992565155029296875;s:7:"vatRate";d:21;s:3:"vat";d:16.800000000000000710542735760100185871124267578125;s:6:"vatSum";d:16.800000000000000710542735760100185871124267578125;s:4:"hash";s:40:"94d8e389a9617f0adc2cfedb6e0e102155f4ec2f";}} HERE; var_dump(mb_unserialize($string));
Output for 7.0.0 - 7.1.0
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /in/nZ7rF on line 3 bool(false)
Output for 4.3.0 - 5.4.45, hhvm-3.10.0 - 3.12.0
array(1) { [0]=> array(15) { ["ID"]=> string(3) "157" ["qty"]=> int(1) ["name"]=> string(11) "?????\?????" ["nameHe"]=> string(11) "?????\?????" ["nameEn"]=> string(11) "?????\?????" ["price"]=> float(80) ["priceNet"]=> float(80) ["priceGross"]=> float(96.8) ["sum"]=> float(80) ["sumNet"]=> float(80) ["sumGross"]=> float(96.8) ["vatRate"]=> float(21) ["vat"]=> float(16.8) ["vatSum"]=> float(16.8) ["hash"]=> string(40) "94d8e389a9617f0adc2cfedb6e0e102155f4ec2f" } }
Output for 5.5.0 - 5.6.28
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /in/nZ7rF on line 3 array(1) { [0]=> array(15) { ["ID"]=> string(3) "157" ["qty"]=> int(1) ["name"]=> string(11) "?????\?????" ["nameHe"]=> string(11) "?????\?????" ["nameEn"]=> string(11) "?????\?????" ["price"]=> float(80) ["priceNet"]=> float(80) ["priceGross"]=> float(96.8) ["sum"]=> float(80) ["sumNet"]=> float(80) ["sumGross"]=> float(96.8) ["vatRate"]=> float(21) ["vat"]=> float(16.8) ["vatSum"]=> float(16.8) ["hash"]=> string(40) "94d8e389a9617f0adc2cfedb6e0e102155f4ec2f" } }