3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = 'Happy^ hour^ / is fun //'; function filenameEncode($possible_filename){ $fngood = str_replace(array('^',';','/',':'), array('^^',';;','^',';'), $possible_filename); return $fngood; } function filenameDecode($possible_filename){ //all single carets need to be replaced with slashes $possible_filename = preg_replace('/([^\^])(\^)([^\^])/im', '$1/$3', $possible_filename); //all semi-colons need to be replaced with colons $possible_filename = preg_replace('/([^;])(;)([^;])/im', '$1:$3', $possible_filename); $fngood = str_replace(array('^',';'), array('/',':'), $possible_filename); return $possible_filename; } echo $s."\n"; $t = filenameEncode($s); $u = filenameDecode($t); echo $t."\n"; echo $u."\n"; if ($s === $u){ echo 'test passed'; }else{ echo 'test failed'; }

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.0040.01118.31
8.3.50.0050.01522.11
8.3.40.0040.01419.12
8.3.30.0140.00018.79
8.3.20.0070.01118.82
8.3.10.0000.00820.92
8.3.00.0000.00821.73
8.2.180.0190.00316.88
8.2.170.0140.00722.96
8.2.160.0100.00320.46
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0000.00821.00
8.2.110.0030.00621.16
8.2.100.0000.01217.84
8.2.90.0040.00419.03
8.2.80.0040.00417.97
8.2.70.0060.00317.88
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0050.00318.16
8.2.30.0050.00321.38
8.2.20.0000.00717.79
8.2.10.0090.00018.01
8.2.00.0060.00317.79
8.1.280.0120.00625.92
8.1.270.0040.00423.99
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0060.00321.30
8.1.230.0040.00817.64
8.1.220.0000.00817.76
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0080.00017.35
8.1.180.0080.00018.10
8.1.170.0030.00518.71
8.1.160.0040.00718.93
8.1.150.0040.00418.74
8.1.140.0040.00417.53
8.1.130.0030.00317.86
8.1.120.0000.00717.42
8.1.110.0040.00417.57
8.1.100.0040.00417.50
8.1.90.0030.00517.61
8.1.80.0080.00017.54
8.1.70.0000.00717.43
8.1.60.0060.00317.75
8.1.50.0070.00017.65
8.1.40.0030.00617.65
8.1.30.0000.00817.64
8.1.20.0030.00517.83
8.1.10.0050.00217.57
8.1.00.0000.01317.60
8.0.300.0000.00818.77
8.0.290.0000.00716.88
8.0.280.0000.00718.48
8.0.270.0000.00717.34
8.0.260.0030.00316.98
8.0.250.0000.00817.03
8.0.240.0040.00617.14
8.0.230.0070.00017.11
8.0.220.0030.00317.05
8.0.210.0000.00716.96
8.0.200.0030.00317.17
8.0.190.0040.00416.99
8.0.180.0040.00416.95
8.0.170.0040.00417.08
8.0.160.0000.00816.90
8.0.150.0050.00317.05
8.0.140.0000.00716.98
8.0.130.0000.00613.48
8.0.120.0040.00416.98
8.0.110.0030.00517.11
8.0.100.0000.00716.90
8.0.90.0030.00517.12
8.0.80.0130.00317.00
8.0.70.0040.00417.08
8.0.60.0050.00317.04
8.0.50.0040.00416.93
8.0.30.0080.01017.12
8.0.20.0060.01217.40
8.0.10.0080.00017.13
8.0.00.0060.01116.91
7.4.330.0060.00016.72
7.4.320.0000.00616.67
7.4.300.0000.00616.62
7.4.290.0030.00616.63
7.4.280.0060.00316.84
7.4.270.0030.00316.68
7.4.260.0000.00513.45
7.4.250.0000.00716.69
7.4.240.0030.00316.78
7.4.230.0050.00216.83
7.4.220.0030.01616.64
7.4.210.0050.01216.77
7.4.200.0000.00716.72
7.4.190.0030.00316.65
7.4.160.0120.01216.89
7.4.150.0120.00917.40
7.4.140.0080.01017.86
7.4.130.0100.00916.75
7.4.120.0100.00816.73
7.4.110.0060.01116.78
7.4.100.0090.00916.50
7.4.90.0110.00716.65
7.4.80.0080.00819.39
7.4.70.0130.00316.79
7.4.60.0060.01116.49
7.4.50.0050.00316.59
7.4.40.0060.00922.77
7.4.30.0070.01016.85
7.4.00.0000.01515.23
7.3.330.0000.00613.36
7.3.320.0060.00013.37
7.3.310.0040.00416.38
7.3.300.0030.00316.44
7.3.290.0030.01116.48
7.3.280.0080.01016.48
7.3.270.0120.00617.40
7.3.260.0080.00818.24
7.3.250.0090.00816.62
7.3.240.0120.00416.60
7.3.230.0040.01316.55
7.3.210.0030.01816.53
7.3.200.0150.00619.39
7.3.190.0130.00916.77
7.3.180.0060.01016.79
7.3.170.0090.00816.77
7.3.160.0080.00816.68
7.3.120.0100.00715.25
7.3.00.0080.00516.75
7.2.330.0070.01116.83
7.2.320.0070.01016.93
7.2.310.0180.00316.78
7.2.300.0100.00716.90
7.2.290.0100.00616.76
7.2.130.0090.00317.12
7.2.120.0070.00717.07
7.2.110.0090.00417.09
7.2.100.0040.01116.84
7.2.90.0130.00617.06
7.2.80.0040.00817.09
7.2.70.0080.00416.97
7.2.60.0130.00617.18
7.2.50.0030.00917.17
7.2.40.0050.00517.01
7.2.30.0040.01117.24
7.2.20.0110.00416.88
7.2.10.0000.01617.05
7.2.00.0050.00718.49
7.1.250.0110.00816.12
7.1.240.0090.00016.03
7.1.230.0090.00615.99
7.1.220.0130.00715.99
7.1.210.0000.01216.04
7.1.200.0110.00015.79
7.1.190.0080.00415.82
7.1.180.0070.00715.99
7.1.170.0150.00015.99
7.1.160.0060.00616.04
7.1.150.0040.00815.94
7.1.140.0060.01016.14
7.1.130.0100.00315.88
7.1.120.0060.00615.85
7.1.110.0060.00915.74
7.1.100.0030.00817.05
7.1.90.0070.00716.05
7.1.80.0040.00815.95
7.1.70.0080.00716.67
7.1.60.0090.01317.68
7.1.50.0140.00725.37
7.1.40.0040.00815.89
7.1.30.0030.01116.00
7.1.20.0030.00915.90
7.1.10.0100.00315.91
7.1.00.0010.03619.02
7.0.330.0100.00415.34
7.0.320.0000.01215.54
7.0.310.0170.00015.62
7.0.300.0090.00015.62
7.0.290.0040.00715.57
7.0.280.0040.00715.45
7.0.270.0070.00715.65
7.0.260.0030.00915.37
7.0.250.0060.00615.76
7.0.240.0060.00615.51
7.0.230.0100.00715.34
7.0.220.0090.00615.52
7.0.210.0110.00415.57
7.0.200.0040.00616.19
7.0.190.0090.00615.53
7.0.180.0040.00715.56
7.0.170.0080.00315.66
7.0.160.0090.00915.40
7.0.150.0090.00615.48
7.0.140.0070.03718.75
7.0.130.0040.00815.48
7.0.120.0060.00315.57
7.0.110.0030.00915.43
7.0.100.0050.04317.63
7.0.90.0210.03817.89
7.0.80.0060.04317.71
7.0.70.0180.02417.79
7.0.60.0170.02017.65
7.0.50.0050.04618.01
7.0.40.0100.02516.90
7.0.30.0080.02316.82
7.0.20.0020.03316.76
7.0.10.0040.02616.82
7.0.00.0070.02016.85
5.6.380.0040.01014.22
5.6.370.0060.00614.33
5.6.360.0060.00614.40
5.6.350.0030.00814.66
5.6.340.0060.00314.71
5.6.330.0070.00414.50
5.6.320.0040.00814.35
5.6.310.0030.01014.41
5.6.300.0060.00914.36
5.6.290.0040.00914.30
5.6.280.0020.04317.59
5.6.270.0070.00714.51
5.6.260.0080.00414.70
5.6.250.0100.02217.41
5.6.240.0020.03217.73
5.6.230.0030.03117.51
5.6.220.0070.04417.42
5.6.210.0090.03517.48
5.6.200.0050.04617.71
5.6.190.0100.04217.81
5.6.180.0030.02617.69
5.6.170.0060.02317.70
5.6.160.0030.03117.79
5.6.150.0060.02517.67
5.6.140.0060.02117.76
5.6.130.0060.02317.62
5.6.120.0090.02217.60
5.6.110.0070.04717.69
5.6.100.0080.02217.67
5.6.90.0070.02217.73
5.6.80.0090.02417.40
5.6.70.0020.02817.30
5.6.60.0060.02417.22
5.6.50.0020.02517.31
5.6.40.0050.01917.22
5.6.30.0070.02017.25
5.6.20.0040.02517.43
5.6.10.0000.02417.23
5.6.00.0070.01817.32
5.5.380.0050.04215.87
5.5.370.0070.04015.81
5.5.360.0060.03515.80
5.5.350.0100.03915.94
5.5.340.0100.03515.96
5.5.330.0030.03315.99
5.5.320.0070.02015.91
5.5.310.0040.02316.04
5.5.300.0060.02215.98
5.5.290.0030.02515.92
5.5.280.0060.02115.95
5.5.270.0060.01915.84
5.5.260.0020.02416.01
5.5.250.0030.02315.79
5.5.240.0090.01815.67
5.5.230.0000.03015.74
5.5.220.0060.02015.61
5.5.210.0110.01815.66
5.5.200.0020.02515.65
5.5.190.0050.02515.54
5.5.180.0060.02315.59
5.5.170.0000.01010.90
5.5.160.0010.02515.52
5.5.150.0050.02215.74
5.5.140.0030.02415.70
5.5.130.0020.02515.56
5.5.120.0020.02515.82
5.5.110.0030.02415.43
5.5.100.0030.02515.52
5.5.90.0050.01915.54
5.5.80.0080.01815.62
5.5.70.0080.03815.55
5.5.60.0030.02915.58
5.5.50.0040.04415.65
5.5.40.0050.03815.68
5.5.30.0070.03915.52
5.5.20.0090.04115.52
5.5.10.0140.03615.62
5.5.00.0020.03115.60
5.4.450.0060.02115.35
5.4.440.0060.02015.09
5.4.430.0040.02915.27
5.4.420.0050.02015.24
5.4.410.0050.02315.28
5.4.400.0070.02015.13
5.4.390.0060.02114.96
5.4.380.0040.01815.04
5.4.370.0010.02214.97
5.4.360.0000.02215.22
5.4.350.0090.01715.07
5.4.340.0050.01915.10
5.4.330.0080.00010.90
5.4.320.0080.01715.07
5.4.310.0010.02014.89
5.4.300.0070.01715.03
5.4.290.0020.02514.92
5.4.280.0030.02115.02
5.4.270.0020.02815.18
5.4.260.0030.02015.08
5.4.250.0060.02614.96
5.4.240.0080.03515.07
5.4.230.0080.03815.08
5.4.220.0130.02814.97
5.4.210.0090.03715.01
5.4.200.0050.03315.07
5.4.190.0020.03415.19
5.4.180.0080.03815.20
5.4.170.0030.03615.22
5.4.160.0070.04015.02
5.4.150.0070.03914.94
5.4.140.0020.04213.83
5.4.130.0060.02513.92
5.4.120.0030.02413.64
5.4.110.0030.04313.85
5.4.100.0100.03513.83
5.4.90.0080.03313.69
5.4.80.0030.04213.83
5.4.70.0070.03713.73
5.4.60.0030.03813.79
5.4.50.0050.03613.75
5.4.40.0050.03813.70
5.4.30.0060.02313.78
5.4.20.0030.03813.69
5.4.10.0100.03313.73
5.4.00.0020.03913.29
5.3.290.0050.02012.86
5.3.280.0100.03512.81
5.3.270.0080.04212.83
5.3.260.0050.04112.78
5.3.250.0030.04012.79
5.3.240.0050.03812.77
5.3.230.0030.04412.76
5.3.220.0070.04012.72
5.3.210.0090.03812.77
5.3.200.0030.04312.75
5.3.190.0050.02312.74
5.3.180.0050.02312.71
5.3.170.0050.02312.75
5.3.160.0070.04012.70
5.3.150.0050.04012.75
5.3.140.0050.03912.69
5.3.130.0030.04212.79
5.3.120.0030.04012.77
5.3.110.0060.04012.74
5.3.100.0030.04512.46
5.3.90.0050.02312.49
5.3.80.0110.03212.47
5.3.70.0080.03312.46
5.3.60.0030.03612.52
5.3.50.0050.04012.50
5.3.40.0080.03312.47
5.3.30.0040.02512.37
5.3.20.0070.03812.30
5.3.10.0050.03812.27
5.3.00.0060.03812.22
5.2.170.0030.03310.97
5.2.160.0070.03110.99
5.2.150.0050.03011.03
5.2.140.0050.02111.08
5.2.130.0080.03011.06
5.2.120.0050.03411.02
5.2.110.0000.02311.03
5.2.100.0090.02811.03
5.2.90.0050.03311.04
5.2.80.0030.02511.04
5.2.70.0060.02511.05
5.2.60.0100.02610.91
5.2.50.0050.03310.99
5.2.40.0020.03510.96
5.2.30.0050.03410.97
5.2.20.0030.03410.95
5.2.10.0080.02810.94
5.2.00.0060.02310.84
5.1.60.0020.03110.50
5.1.50.0030.01710.44
5.1.40.0000.03310.44
5.1.30.0060.01310.63
5.1.20.0050.02810.58
5.1.10.0060.02610.48
5.1.00.0070.02810.53
5.0.50.0080.0139.77
5.0.40.0050.0229.69
5.0.30.0050.0329.56
5.0.20.0030.0239.56
5.0.10.0060.0209.56
5.0.00.0000.0399.56
4.4.90.0020.0199.56
4.4.80.0050.0109.56
4.4.70.0000.0229.56
4.4.60.0020.0189.56
4.4.50.0030.0179.56
4.4.40.0080.0229.56
4.4.30.0020.0179.56
4.4.20.0040.0179.56
4.4.10.0010.0199.56
4.4.00.0000.0319.56
4.3.110.0060.0079.56
4.3.100.0030.0179.56
4.3.90.0020.0189.56
4.3.80.0020.0309.56
4.3.70.0020.0189.56
4.3.60.0000.0159.56
4.3.50.0060.0169.56
4.3.40.0000.0289.56
4.3.30.0030.0199.56
4.3.20.0020.0109.56
4.3.10.0020.0199.56
4.3.00.0030.0189.56

preferences:
35.35 ms | 401 KiB | 5 Q