3v4l.org

run code in 300+ PHP versions simultaneously
<?php $corrupted = <<<STRING a:4:{i:0;s:3:"three";i:1;s:5:"five";i:2;s:2:"newline1 newline2";i:3;s:6:"garçon";} STRING; $repaired = preg_replace_callback( '/s:(\d+):"(.*?)";/s', function ($m) { $len = strlen($m[2]); return $m[1] == $len ? $m[0] : "s:$len:\"{$m[2]}\";"; }, $corrupted ); echo $corrupted , "\n" , $repaired; echo "\n---\n"; var_export(unserialize($repaired));
Output for git.master, git.master_jit, rfc.property-hooks
a:4:{i:0;s:3:"three";i:1;s:5:"five";i:2;s:2:"newline1 newline2";i:3;s:6:"garçon";} a:4:{i:0;s:5:"three";i:1;s:4:"five";i:2;s:17:"newline1 newline2";i:3;s:7:"garçon";} --- array ( 0 => 'three', 1 => 'five', 2 => 'newline1 newline2', 3 => 'garçon', )

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:
60.45 ms | 401 KiB | 8 Q