3v4l.org

run code in 300+ PHP versions simultaneously
<?php function remove_recursion($o){ static $replace; if(!isset($replace)) $replace = create_function('$m','$r="\x00{$m[1]}ecursion_";return \'s:\'.strlen($r.$m[2]).\':"\'.$r.$m[2].\'";\';') ; if(is_array($o) || is_object($o)){ $re = '#(r|R):([0-9]+);#'; $serialize = serialize($o); if(preg_match($re, $serialize)){ $last = $pos = 0; while(false !== ($pos = strpos($serialize, 's:', $pos))){ $chunk = substr($serialize, $last, $pos - $last); if(preg_match($re, $chunk)){ $length = strlen($chunk); $chunk = preg_replace_callback($re, $replace, $chunk); $serialize = substr($serialize, 0, $last).$chunk.substr($serialize, $last + ($pos - $last)); $pos += strlen($chunk) - $length; } $pos += 2; $last = strpos($serialize, ':', $pos); $length = substr($serialize, $pos, $last- $pos); $last += 4 + $length; $pos = $last; } $serialize = substr($serialize, 0, $last).preg_replace_callback($re, $replace, substr($serialize, $last)); $o = unserialize($serialize); } } return $o; } $o = new stdClass; $o->n = function($a) { return $a; }; $o->r = &$o; echo serialize($o), ' ', serialize( remove_recursion($o) ) ;

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0110.00418.43
8.3.50.0140.00921.02
8.3.40.0180.00318.88
8.3.30.0130.00319.96
8.3.20.0030.00718.76
8.3.10.0090.00020.93
8.3.00.0080.00023.71
8.2.180.0070.00718.39
8.2.170.0070.01419.04
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0000.00819.86
8.2.110.0030.00721.09
8.2.100.0080.00417.68
8.2.90.0060.00317.97
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0050.00317.80
8.2.50.0070.00318.07
8.2.40.0030.00618.34
8.2.30.0040.00419.37
8.2.20.0000.00717.74
8.2.10.0040.00417.66
8.2.00.0000.00817.81
8.1.280.0070.01125.92
8.1.270.0000.00823.96
8.1.260.0030.00626.35
8.1.250.0100.01028.09
8.1.240.0100.01022.14
8.1.230.0030.00920.90
8.1.220.0030.00617.79
8.1.210.0080.00019.03
8.1.200.0030.00617.35
8.1.190.0000.00717.66
8.1.180.0030.00618.10
8.1.170.0080.00018.54
8.1.160.0000.00718.83
8.1.150.0040.00418.68
8.1.140.0070.00017.52
8.1.130.0050.00217.86
8.1.120.0000.00717.43
8.1.110.0000.00717.39
8.1.100.0050.00317.52
8.1.90.0000.00717.48
8.1.80.0000.00717.53
8.1.70.0030.00317.50
8.1.60.0030.00617.59
8.1.50.0080.00017.41
8.1.40.0050.00317.55
8.1.30.0030.00617.61
8.1.20.0050.00317.63
8.1.10.0070.00017.54
8.1.00.0000.00817.53
8.0.300.0040.00419.90
8.0.290.0040.00416.93
8.0.280.0070.00018.42
8.0.270.0070.00017.15
8.0.260.0000.00616.75
8.0.250.0040.00416.86
8.0.240.0060.00317.00
8.0.230.0000.00816.98
8.0.220.0020.00516.98
8.0.210.0000.00716.78
8.0.200.0030.00316.93
8.0.190.0000.00716.99
8.0.180.0030.00517.05
8.0.170.0070.00017.01
8.0.160.0040.00416.83
8.0.150.0020.00516.77
8.0.140.0030.00316.91
8.0.130.0030.00313.40
8.0.120.0040.00416.84
8.0.110.0000.00716.84
8.0.100.0040.00416.95
8.0.90.0040.00417.04
8.0.80.0040.01117.00
8.0.70.0070.00016.79
8.0.60.0030.00516.92
8.0.50.0040.00416.99
8.0.30.0110.00917.27
8.0.20.0090.00817.40
8.0.10.0040.00417.09
8.0.00.0110.01416.82
7.4.330.0060.00016.79
7.4.320.0040.00416.63
7.4.300.0030.00316.63
7.4.290.0070.00016.58
7.4.280.0040.00416.53
7.4.270.0040.00416.54
7.4.260.0000.00513.22
7.4.250.0030.00616.59
7.4.240.0030.00316.55
7.4.230.0000.00716.41
7.4.220.0090.00916.68
7.4.210.0070.00916.64
7.4.200.0000.00716.60
7.4.190.0040.00316.75
7.4.160.0080.00816.68
7.4.150.0070.01017.40
7.4.140.0080.01217.86
7.4.130.0100.01016.58
7.4.120.0080.01316.61
7.4.110.0070.01616.51
7.4.100.0100.00716.45
7.4.90.0070.01116.51
7.4.80.0160.00919.39
7.4.70.0030.01316.70
7.4.60.0130.00316.57
7.4.50.0050.00316.67
7.4.40.0050.00322.77
7.4.30.0090.01216.75
7.4.00.0000.01414.84
7.3.330.0000.00513.29
7.3.320.0030.00313.34
7.3.310.0030.00316.21
7.3.300.0000.00716.33
7.3.290.0170.00316.30
7.3.280.0050.01316.31
7.3.270.0100.00617.40
7.3.260.0120.00918.24
7.3.250.0110.00516.33
7.3.240.0080.00816.38
7.3.230.0120.00616.43
7.3.210.0160.00316.36
7.3.200.0190.00419.39
7.3.190.0070.01116.46
7.3.180.0000.01616.53
7.3.170.0090.00916.42
7.3.160.0030.01316.39
7.3.120.0070.00714.88
7.3.00.0000.01416.58
7.2.330.0070.01016.65
7.2.320.0160.01016.74
7.2.310.0150.00616.39
7.2.300.0090.01216.81
7.2.290.0070.01016.67
7.2.130.0030.01316.71
7.2.120.0120.00316.55
7.2.110.0040.00816.61
7.2.100.0140.00516.85
7.2.90.0070.01016.53
7.2.80.0090.00616.81
7.2.70.0040.01116.70
7.2.60.0080.00716.70
7.2.50.0120.00516.58
7.2.40.0100.00716.99
7.2.30.0100.00316.77
7.2.20.0100.00716.78
7.2.10.0070.00716.67
7.2.00.0100.00718.21
7.1.250.0120.00315.50
7.1.240.0150.00315.62
7.1.230.0040.01115.52
7.1.220.0070.00715.65
7.1.210.0100.01015.87
7.1.200.0120.00315.64
7.1.190.0030.01315.64
7.1.180.0030.00715.56
7.1.170.0120.00315.56
7.1.160.0040.00415.85
7.1.150.0030.01015.42
7.1.140.0090.00315.86
7.1.130.0040.01115.69
7.1.120.0130.00315.70
7.1.110.0030.00915.65
7.1.100.0060.00316.90
7.1.90.0120.00615.72
7.1.80.0040.00815.61
7.1.70.0070.00416.37
7.1.60.0050.00817.44
7.1.50.0050.00716.32
7.1.40.0040.00715.73
7.1.30.0040.00815.45
7.1.20.0030.01015.60
7.1.10.0060.00315.55
7.1.00.0050.03018.98
7.0.330.0070.00715.18
7.0.320.0130.00015.26
7.0.310.0030.01015.21
7.0.300.0030.00615.37
7.0.290.0040.00915.30
7.0.280.0090.00015.41
7.0.270.0040.00414.98
7.0.260.0080.00015.05
7.0.250.0080.00715.29
7.0.240.0040.00715.48
7.0.230.0070.00715.35
7.0.220.0060.01015.20
7.0.210.0070.00715.44
7.0.200.0080.00116.04
7.0.190.0030.00615.33
7.0.180.0060.01015.10
7.0.170.0090.00615.21
7.0.160.0070.00415.23
7.0.150.0070.00715.16
7.0.140.0010.04318.56
7.0.130.0040.00715.01
7.0.120.0040.01215.29
7.0.110.0420.04317.47
7.0.100.0250.04017.47
7.0.90.0250.04817.59
7.0.80.0320.03817.53
7.0.70.0350.03717.42
7.0.60.0350.03717.62
7.0.50.0330.02117.73
7.0.40.0070.02916.68
7.0.30.0070.04316.47
7.0.20.0130.04016.83
7.0.10.0070.04516.64
7.0.00.0030.04616.60
5.6.380.0000.01314.05
5.6.370.0090.00614.08
5.6.360.0000.01714.45
5.6.350.0040.01214.35
5.6.340.0100.00314.13
5.6.330.0140.00714.29
5.6.320.0030.00714.29
5.6.310.0030.00614.50
5.6.300.0090.00314.28
5.6.290.0030.01014.36
5.6.280.0000.04517.79
5.6.270.0070.00714.31
5.6.260.0100.03717.52
5.6.250.0050.03017.35
5.6.240.0030.03717.47
5.6.230.0100.02617.49
5.6.220.0110.02617.51
5.6.210.0030.04917.41
5.6.200.0110.03017.65
5.6.190.0050.04517.68
5.6.180.0030.04317.69
5.6.170.0150.04017.78
5.6.160.0100.04317.59
5.6.150.0100.03317.70
5.6.140.0120.03617.79
5.6.130.0130.04117.63
5.6.120.0000.04417.80
5.6.110.0100.04717.70
5.6.100.0090.04017.60
5.6.90.0040.04717.77
5.6.80.0110.03717.31
5.6.70.0110.03517.32
5.6.60.0050.03917.24
5.6.50.0080.04117.25
5.6.40.0090.03917.29
5.6.30.0060.03017.46
5.6.20.0030.04517.35
5.6.10.0050.04417.37
5.6.00.0070.04517.29
5.5.380.0030.04415.69
5.5.370.0060.04515.69
5.5.360.0050.03715.60
5.5.350.0090.03815.74
5.5.340.0070.04315.89
5.5.330.0060.03715.93
5.5.320.0050.02916.04
5.5.310.0060.02916.04
5.5.300.0050.04316.13
5.5.290.0070.04116.09
5.5.280.0020.03016.21
5.5.270.0060.04315.89
5.5.260.0030.04615.92
5.5.250.0050.04015.72
5.5.240.0080.03915.64
5.5.230.0070.03915.50
5.5.220.0080.04015.55
5.5.210.0020.04515.63
5.5.200.0030.04215.52
5.5.190.0100.03815.61
5.5.180.0020.04815.53
5.5.170.0040.00710.90
5.5.160.0100.03615.58
5.5.150.0120.04115.59
5.5.140.0050.03915.56
5.5.130.0030.04115.60
5.5.120.0030.04215.54
5.5.110.0060.04015.56
5.5.100.0090.03615.61
5.5.90.0050.04015.53
5.5.80.0000.04615.48
5.5.70.0000.03115.53
5.5.60.0020.02915.70
5.5.50.0050.03115.51
5.5.40.0110.03815.53
5.5.30.0070.04015.66
5.5.20.0080.02715.61
5.5.10.0060.03615.63
5.5.00.0080.03615.50
5.4.450.0030.04915.19
5.4.440.0070.04515.25
5.4.430.0010.04615.32
5.4.420.0070.04115.25
5.4.410.0060.03815.25
5.4.400.0000.03915.07
5.4.390.0050.03415.10
5.4.380.0070.03314.95
5.4.370.0090.02815.13
5.4.360.0090.03615.25
5.4.350.0030.04414.98
5.4.340.0030.03014.96
5.4.330.0040.00810.90
5.4.320.0060.03815.11
5.4.310.0020.03115.03
5.4.300.0080.03715.13
5.4.290.0080.02215.08
5.4.280.0070.04014.99
5.4.270.0070.04015.04
5.4.260.0070.03414.98
5.4.250.0050.04215.10
5.4.240.0070.03515.04
5.4.230.0020.02315.05
5.4.220.0080.03815.06
5.4.210.0030.04114.95
5.4.200.0110.02815.03
5.4.190.0040.03614.92
5.4.180.0070.03514.99
5.4.170.0050.02514.92
5.4.160.0050.02614.95
5.4.150.0100.03514.93
5.4.140.0050.04013.71
5.4.130.0080.03513.67
5.4.120.0100.03213.67
5.4.110.0020.03313.69
5.4.100.0120.03613.74
5.4.90.0050.04213.71
5.4.80.0030.03913.79
5.4.70.0050.04013.73
5.4.60.0050.03513.73
5.4.50.0030.03713.75
5.4.40.0060.03613.82
5.4.30.0070.03713.73
5.4.20.0050.03413.67
5.4.10.0100.03713.64
5.4.00.0030.03713.42
5.3.290.0070.04012.80
5.3.280.0050.03712.87
5.3.270.0080.02312.74
5.3.260.0040.04412.69
5.3.250.0060.03612.77
5.3.240.0050.04012.75
5.3.230.0030.04112.69
5.3.220.0060.03812.75
5.3.210.0020.03812.67
5.3.200.0050.03512.67
5.3.190.0070.03812.82
5.3.180.0020.04012.81
5.3.170.0020.04312.80
5.3.160.0070.03812.80
5.3.150.0030.04112.75
5.3.140.0080.03312.67
5.3.130.0040.04312.75
5.3.120.0080.03812.66
5.3.110.0070.03412.73
5.3.100.0040.04112.47
5.3.90.0020.03512.46
5.3.80.0030.02512.47
5.3.70.0030.02012.58
5.3.60.0050.04012.58
5.3.50.0050.04012.45
5.3.40.0030.03112.55
5.3.30.0070.03312.39
5.3.20.0080.03812.29
5.3.10.0030.02312.30
5.3.00.0100.03012.32
5.2.170.0050.03011.63
5.2.160.0030.03211.63
5.2.150.0030.03311.63
5.2.140.0030.03311.63
5.2.130.0050.03311.63
5.2.120.0020.04011.63
5.2.110.0000.03611.63
5.2.100.0050.01811.63
5.2.90.0030.02411.63
5.2.80.0050.03211.63
5.2.70.0020.02211.63
5.2.60.0030.03311.63
5.2.50.0030.03811.63
5.2.40.0060.03311.63
5.2.30.0030.03211.63
5.2.20.0030.03711.63
5.2.10.0030.02911.63
5.2.00.0050.02911.63
5.1.60.0030.02811.63
5.1.50.0050.03011.63
5.1.40.0000.03211.63
5.1.30.0050.03011.63
5.1.20.0060.01611.63
5.1.10.0040.03011.63
5.1.00.0030.03011.63
5.0.50.0070.02211.63
5.0.40.0040.02311.63
5.0.30.0050.02811.63
5.0.20.0020.02411.63
5.0.10.0020.02211.63
5.0.00.0030.03411.63
4.4.90.0000.02111.63
4.4.80.0030.01811.63
4.4.70.0010.01811.63
4.4.60.0020.02011.63
4.4.50.0000.01511.63
4.4.40.0040.02511.63
4.4.30.0020.02011.63
4.4.20.0030.01811.63
4.4.10.0060.01711.63
4.4.00.0050.02611.63
4.3.110.0020.01111.63
4.3.100.0020.02011.63
4.3.90.0000.02111.63
4.3.80.0030.02311.63
4.3.70.0070.01511.63
4.3.60.0030.01711.63
4.3.50.0030.01511.63
4.3.40.0010.02811.63
4.3.30.0010.02011.63
4.3.20.0000.01211.63
4.3.10.0000.02011.63
4.3.00.0040.01511.63

preferences:
54.85 ms | 401 KiB | 5 Q