3v4l.org

run code in 300+ PHP versions simultaneously
<?php $corrupted_byte_counts = <<<STRING a:1:{i:0;a:3:{s:7:"address";s:52:"Elågåresgude 41, 2200 Københamm N";s:12:"company_name";s:14:"Kaffe og Kluns";s:9:"telephone";s:0:"";}} STRING; $repaired = preg_replace_callback( '/s:\d+:"(.*?)";/s', function ($m) { return 's:' . strlen($m[1]) . ":\"{$m[1]}\";"; }, $corrupted_byte_counts ); echo "corrupted serialized array:\n$corrupted_byte_counts"; echo "\n---\n"; echo "repaired serialized array:\n$repaired"; echo "\n---\n"; print_r(unserialize($repaired));
Output for git.master, git.master_jit, rfc.property-hooks
corrupted serialized array: a:1:{i:0;a:3:{s:7:"address";s:52:"Elågåresgude 41, 2200 Københamm N";s:12:"company_name";s:14:"Kaffe og Kluns";s:9:"telephone";s:0:"";}} --- repaired serialized array: a:1:{i:0;a:3:{s:7:"address";s:36:"Elågåresgude 41, 2200 Københamm N";s:12:"company_name";s:14:"Kaffe og Kluns";s:9:"telephone";s:0:"";}} --- Array ( [0] => Array ( [address] => Elågåresgude 41, 2200 Københamm N [company_name] => Kaffe og Kluns [telephone] => ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
170.83 ms | 407 KiB | 5 Q