3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function findSerializeError($data1) { echo "<pre>"; $data2 = preg_replace ( '!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':\"$2\";'",$data1 ); $max = (strlen ( $data1 ) > strlen ( $data2 )) ? strlen ( $data1 ) : strlen ( $data2 ); echo $data1 . PHP_EOL; echo $data2 . PHP_EOL; for($i = 0; $i < $max; $i ++) { if (@$data1 {$i} !== @$data2 {$i}) { echo "Diffrence ", @$data1 {$i}, " != ", @$data2 {$i}, PHP_EOL; echo "\t-> ORD number ", ord ( @$data1 {$i} ), " != ", ord ( @$data2 {$i} ), PHP_EOL; echo "\t-> Line Number = $i" . PHP_EOL; $start = ($i - 20); $start = ($start < 0) ? 0 : $start; $length = 40; $point = $max - $i; if ($point < 20) { $rlength = 1; $rpoint = - $point; } else { $rpoint = $length - 20; $rlength = 1; } echo "\t-> Section Data1 = ", substr_replace ( substr ( $data1, $start, $length ), "<b style=\"color:green\">{$data1 {$i}}</b>", $rpoint, $rlength ), PHP_EOL; echo "\t-> Section Data2 = ", substr_replace ( substr ( $data2, $start, $length ), "<b style=\"color:red\">{$data2 {$i}}</b>", $rpoint, $rlength ), PHP_EOL; } } } $data = 'a:3:{s:6:"entity";s:29:"Aulinks\Model\Entities\Widget";s:7:"depends";a:1:{i:0;s:33:"Aulinks\Model\Entities\WidgetArea";}s:4:"data";a:9:{i:0;a:2:{s:6:"fields";a:5:{s:12:"factoryClass";s:83:"Aulinks\FrontModule\Components\Layout\Widgets\MainMenuWidget\IMainMenuWidgetFactory";s:4:"name";s:1:"1";s:8:"position";i:1;s:4:"data";a:0:{}s:2:"id";i:1;}s:12:"associations";a:1:{s:4:"area";i:1;}}i:1;a:2:{s:6:"fields";a:5:{s:12:"factoryClass";s:89:"Aulinks\FrontModule\Components\Layout\Widgets\SidebarTextWidget\ISidebarTextWidgetFactory";s:4:"name";s:1:"2";s:8:"position";i:2;s:4:"data";a:0:{}s:2:"id";i:2;}s:12:"associations";a:1:{s:4:"area";i:1;}}i:2;a:2:{s:6:"fields";a:5:{s:12:"factoryClass";s:81:"Aulinks\FrontModule\Components\Layout\Widgets\BoxHtmlWidget\IBoxHtmlWidgetFactory";s:4:"name";s:1:"3";s:8:"position";i:3;s:4:"data";a:3:{s:5:"title";s:12:"HOT NABÍDKY";s:4:"icon";s:10:"fa fa-bomb";s:4:"text";s:274:"<ul class="info-box"> <li> <a href="#">Název pracovní pozice</a> <span>(Praha)</span> </li> <li> <a href="#">Název pracovní pozice</a> <span>(Praha)</span> </li> <li> <a href="#">Název pracovní pozice</a> <span>(Praha)</span> </li> </ul>";}s:2:"id";i:3;}s:12:"associations";a:1:{s:4:"area";i:1;}}i:3;a:2:{s:6:"fields";a:5:{s:12:"factoryClass";s:83:"Aulinks\FrontModule\Components\Layout\Widgets\BoxImageWidget\IBoxImageWidgetFactory";s:4:"name";s:1:"4";s:8:"position";i:4;s:4:"data";a:2:{s:4:"path";s:34:"front/images/workmarket-banner.jpg";s:4:"link";s:24:"http://www.workmarket.cz";}s:2:"id";i:4;}s:12:"associations";a:1:{s:4:"area";i:1;}}i:4;a:2:{s:6:"fields";a:5:{s:12:"factoryClass";s:83:"Aulinks\FrontModule\Components\Layout\Widgets\BoxImageWidget\IBoxImageWidgetFactory";s:4:"name";s:1:"5";s:8:"position";i:5;s:4:"data";a:2:{s:4:"path";s:31:"front/images/aulinks-banner.jpg";s:4:"link";s:5:"cenik";}s:2:"id";i:5;}s:12:"associations";a:1:{s:4:"area";i:1;}}i:5;a:2:{s:6:"fields";a:5:{s:12:"factoryClass";s:89:"Aulinks\FrontModule\Components\Layout\Widgets\DescriptionWidget\IDescriptionWidgetFactory";s:4:"name";s:11:"description";s:8:"position";i:2;s:4:"data";a:0:{}s:2:"id";i:9;}s:12:"associations";a:1:{s:4:"area";i:3;}}i:6;a:2:{s:6:"fields";a:5:{s:12:"factoryClass";s:81:"Aulinks\FrontModule\Components\Layout\Widgets\ContactWidget\IContactWidgetFactory";s:4:"name";s:8:"contacts";s:8:"position";i:4;s:4:"data";a:8:{s:7:"address";s:34:"Na Plzeňce 1236/4, 150 00 Praha 5";s:5:"phone";s:16:"+420 123 456 789";s:5:"email";s:23:"ejobsservice@ejobss.com";s:3:"web";s:14:"www.ejobss.com";s:8:"facebook";s:7:"aulinks";s:6:"google";s:7:"aulinks";s:7:"twitter";s:7:"aulinks";s:8:"linkedIn";s:7:"aulinks";}s:2:"id";i:12;}s:12:"associations";a:1:{s:4:"area";i:3;}}i:7;a:2:{s:6:"fields";a:5:{s:12:"factoryClass";s:73:"Aulinks\FrontModule\Components\Layout\Widgets\MapWidget\IMapWidgetFactory";s:4:"name";s:3:"map";s:8:"position";i:1;s:4:"data";a:3:{s:7:"address";s:0:"";s:5:"point";s:0:"";s:6:"height";s:0:"";}s:2:"id";i:14;}s:12:"associations";a:1:{s:4:"area";i:2;}}i:8;a:2:{s:6:"fields";a:5:{s:12:"factoryClass";s:77:"Aulinks\FrontModule\Components\Layout\Widgets\LinksWidget\ILinksWidgetFactory";s:4:"name";s:11:"footerLinks";s:8:"position";i:5;s:4:"data";a:1:{s:5:"links";s:25:""Kontakty"|About:feedback";}s:2:"id";i:15;}s:12:"associations";a:1:{s:4:"area";i:3;}}}}'; print_r(findSerializeError($data));
based on JstYp