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: '.$s."\n"; $t = filenameEncode($s); $u = filenameDecode($t); echo 't: '.$t."\n"; echo 'u: '.$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.0090.00618.30
8.3.50.0080.00822.17
8.3.40.0070.01118.79
8.3.30.0070.00718.97
8.3.20.0080.00018.67
8.3.10.0050.00321.05
8.3.00.0000.00921.76
8.2.180.0120.00316.75
8.2.170.0090.00622.96
8.2.160.0070.00720.52
8.2.150.0050.00324.18
8.2.140.0030.00624.66
8.2.130.0100.00626.16
8.2.120.0080.00021.02
8.2.110.0090.00020.22
8.2.100.0110.00018.03
8.2.90.0000.00819.23
8.2.80.0060.00317.97
8.2.70.0060.00317.75
8.2.60.0080.00017.80
8.2.50.0100.00018.07
8.2.40.0040.00418.22
8.2.30.0080.00019.47
8.2.20.0040.00417.70
8.2.10.0080.00017.88
8.2.00.0050.00317.73
8.1.280.0120.00625.92
8.1.270.0080.00023.99
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0090.00022.48
8.1.230.0080.00420.98
8.1.220.0080.00018.77
8.1.210.0050.00319.05
8.1.200.0090.00017.35
8.1.190.0050.00317.41
8.1.180.0030.00618.10
8.1.170.0030.00618.65
8.1.160.0080.00018.95
8.1.150.0000.00818.80
8.1.140.0020.00517.61
8.1.130.0070.00017.90
8.1.120.0070.00017.56
8.1.110.0000.00817.57
8.1.100.0040.00417.52
8.1.90.0040.00417.64
8.1.80.0000.00817.55
8.1.70.0000.00717.64
8.1.60.0030.00617.80
8.1.50.0040.00417.64
8.1.40.0040.00417.61
8.1.30.0040.00417.70
8.1.20.0040.00417.70
8.1.10.0000.00717.67
8.1.00.0040.00717.52
8.0.300.0000.00719.85
8.0.290.0050.00217.05
8.0.280.0000.00818.44
8.0.270.0000.00817.31
8.0.260.0040.00416.98
8.0.250.0000.00817.16
8.0.240.0040.00417.02
8.0.230.0030.00317.12
8.0.220.0030.00316.94
8.0.210.0020.00516.98
8.0.200.0000.00717.18
8.0.190.0000.00717.06
8.0.180.0020.00516.97
8.0.170.0050.00216.98
8.0.160.0040.00416.93
8.0.150.0070.00017.00
8.0.140.0040.00416.92
8.0.130.0030.00313.52
8.0.120.0050.00317.13
8.0.110.0000.00716.92
8.0.100.0060.00317.01
8.0.90.0000.00817.02
8.0.80.0070.01416.94
8.0.70.0000.00816.96
8.0.60.0030.00616.88
8.0.50.0040.00417.05
8.0.30.0100.00917.26
8.0.20.0120.00817.40
8.0.10.0030.00516.91
8.0.00.0080.01016.97
7.4.330.0050.00016.91
7.4.320.0000.00616.78
7.4.300.0030.00316.81
7.4.290.0070.00016.82
7.4.280.0000.01016.83
7.4.270.0030.00316.80
7.4.260.0000.00513.46
7.4.250.0000.00816.82
7.4.240.0030.00316.66
7.4.230.0000.00716.48
7.4.220.0090.00916.64
7.4.210.0050.00916.79
7.4.200.0030.00316.62
7.4.190.0040.00416.99
7.4.160.0060.00916.88
7.4.150.0130.01617.40
7.4.140.0140.00417.86
7.4.130.0100.00816.65
7.4.120.0100.00816.77
7.4.110.0140.00316.54
7.4.100.0090.00916.85
7.4.90.0130.00316.55
7.4.80.0070.01019.39
7.4.70.0080.01216.78
7.4.60.0090.00916.76
7.4.50.0030.00616.57
7.4.40.0030.00922.77
7.4.30.0060.01016.75
7.4.00.0100.00715.36
7.3.330.0000.00513.48
7.3.320.0000.00513.36
7.3.310.0070.00016.59
7.3.300.0070.00016.41
7.3.290.0040.00916.46
7.3.280.0040.01116.52
7.3.270.0090.00917.40
7.3.260.0150.00918.24
7.3.250.0150.00716.55
7.3.240.0060.01416.82
7.3.230.0100.00716.55
7.3.210.0120.01216.69
7.3.200.0170.00619.39
7.3.190.0090.00916.52
7.3.180.0060.00916.71
7.3.170.0030.01316.66
7.3.160.0060.01116.54
7.3.120.0060.01115.06
7.3.110.0070.01015.13
7.3.100.0030.00915.00
7.3.90.0030.00814.96
7.3.80.0020.00915.18
7.3.70.0060.00515.17
7.3.60.0060.00515.10
7.3.50.0030.01015.00
7.3.40.0050.00514.94
7.3.30.0070.01014.91
7.3.20.0020.01116.68
7.3.10.0100.00316.75
7.3.00.0020.01616.89
7.2.330.0090.00916.74
7.2.320.0080.01116.92
7.2.310.0150.00316.94
7.2.300.0100.00717.02
7.2.290.0030.01316.83
7.2.240.0100.00615.28
7.2.230.0090.00515.12
7.2.220.0060.00615.11
7.2.210.0040.00915.25
7.2.200.0050.00815.09
7.2.190.0080.00615.12
7.2.180.0050.00714.92
7.2.170.0060.00815.16
7.2.160.0110.00515.02
7.2.150.0070.00516.96
7.2.140.0040.00716.98
7.2.130.0140.00317.09
7.2.120.0120.00316.93
7.2.110.0080.00516.95
7.2.100.0050.00816.96
7.2.90.0090.00917.01
7.2.80.0090.00517.30
7.2.70.0100.00517.09
7.2.60.0060.00917.06
7.2.50.0080.00917.04
7.2.40.0070.00716.91
7.2.30.0030.00917.11
7.2.20.0060.00817.00
7.2.10.0110.00617.09
7.2.00.0080.00818.02
7.1.330.0050.00916.03
7.1.320.0050.00915.79
7.1.310.0050.01015.97
7.1.300.0020.00915.87
7.1.290.0040.01115.90
7.1.280.0060.00716.07
7.1.270.0060.00416.02
7.1.260.0070.00615.97
7.1.250.0050.00815.89
7.1.200.0030.01015.99
7.1.100.0800.00012.18
7.1.70.0060.01017.38
7.1.60.0060.01919.40
7.1.50.0040.01417.05
7.1.00.0030.04022.47
7.0.200.0070.00016.68
7.0.140.0000.07722.10
7.0.70.0730.09020.03
7.0.60.0470.09020.03
7.0.50.0770.07320.32
7.0.40.0070.07020.11
7.0.30.0130.08020.05
7.0.20.0000.09320.04
7.0.10.0100.08320.14
7.0.00.0070.05720.14
5.6.280.0100.06721.16
5.6.220.0070.04320.74
5.6.210.0130.07720.75
5.6.200.0070.08721.06
5.6.190.0100.06721.09
5.6.180.0070.08321.12
5.6.170.0070.05721.09
5.6.160.0030.04321.14
5.6.150.0100.04321.14
5.6.140.0000.04721.04
5.6.130.0100.04721.05
5.6.120.0070.08320.97
5.6.110.0270.06321.14
5.6.100.0030.05321.03
5.6.90.0130.08021.02
5.6.80.0070.07020.34
5.6.70.0130.07720.49
5.6.60.0130.08020.55
5.6.50.0000.07020.47
5.6.40.0100.08320.39
5.6.30.0100.08020.39
5.6.20.0100.06020.42
5.6.10.0070.08320.38
5.6.00.0100.07020.44
5.5.360.0070.04020.40
5.5.350.0170.07320.48
5.5.340.0200.07720.89
5.5.330.0130.06320.79
5.5.320.0030.09020.92
5.5.310.0070.08720.78
5.5.300.0030.05320.90
5.5.290.0130.07020.65
5.5.280.0100.08020.89
5.5.270.0000.07020.73
5.5.260.0070.09020.87
5.5.250.0070.08320.74
5.5.240.0170.06320.29
5.5.230.0100.06320.19
5.5.220.0030.06020.23
5.5.210.0070.06320.16
5.5.200.0100.06320.15
5.5.190.0170.07319.98
5.5.180.0070.06020.12
5.5.160.0100.08020.25
5.5.150.0170.07020.23
5.5.140.0070.06720.18
5.5.130.0030.08320.04
5.5.120.0170.03720.15
5.5.110.0070.08320.23
5.5.100.0100.06720.14
5.5.90.0130.07720.13
5.5.80.0070.08320.16
5.5.70.0100.08020.06
5.5.60.0030.04320.01
5.5.50.0030.08020.13
5.5.40.0000.07320.04
5.5.30.0030.08320.06
5.5.20.0030.08020.08
5.5.10.0070.04720.05
5.5.00.0130.07320.01
5.4.450.0130.06319.45
5.4.440.0100.07019.36
5.4.430.0100.07719.23
5.4.420.0070.05019.36
5.4.410.0130.07319.30
5.4.400.0030.04718.95
5.4.390.0100.04719.07
5.4.380.0100.08019.03
5.4.370.0100.08019.10
5.4.360.0100.07719.15
5.4.350.0100.08019.13
5.4.340.0070.08018.88
5.4.320.0100.07319.25
5.4.310.0100.06319.21
5.4.300.0030.08018.87
5.4.290.0070.08018.90
5.4.280.0000.06019.18
5.4.270.0030.08019.04
5.4.260.0100.07018.87
5.4.250.0030.08019.04
5.4.240.0070.07719.04
5.4.230.0130.07319.04
5.4.220.0130.05019.20
5.4.210.0070.08018.89
5.4.200.0130.06718.99
5.4.190.0000.05019.20
5.4.180.0000.08319.11
5.4.170.0100.06019.22
5.4.160.0130.06019.16
5.4.150.0100.07319.03
5.4.140.0070.07316.39
5.4.130.0130.06016.51
5.4.120.0100.07016.50
5.4.110.0030.05316.44
5.4.100.0070.08016.48
5.4.90.0070.04716.53
5.4.80.0070.07716.45
5.4.70.0100.07016.39
5.4.60.0000.05716.30
5.4.50.0070.03316.44
5.4.40.0100.07316.41
5.4.30.0100.05016.47
5.4.20.0100.07316.49
5.4.10.0130.06016.41
5.4.00.0000.05315.64
5.3.290.0100.07714.66
5.3.280.0100.07014.59
5.3.270.0070.08314.61
5.3.260.0100.05014.55
5.3.250.0030.07714.58
5.3.240.0070.07014.60
5.3.230.0030.08014.66
5.3.220.0070.07714.53
5.3.210.0070.08014.55
5.3.200.0030.08314.58
5.3.190.0070.05014.56
5.3.180.0030.08314.66
5.3.170.0070.07314.63
5.3.160.0030.07314.54
5.3.150.0000.04314.50
5.3.140.0030.03714.57
5.3.130.0070.06314.54
5.3.120.0100.08314.56
5.3.110.0030.06014.69
5.3.100.0130.07314.09
5.3.90.0100.07314.02
5.3.80.0000.07714.14
5.3.70.0030.07714.05
5.3.60.0030.06714.12
5.3.50.0030.07713.84
5.3.40.0100.05314.02
5.3.30.0100.05014.06
5.3.20.0100.07013.72
5.3.10.0070.07013.71
5.3.00.0070.07313.70
5.2.170.0130.05712.49
5.2.160.0030.05312.49
5.2.150.0200.04012.49
5.2.140.0070.07012.49
5.2.130.0100.05712.49
5.2.120.0070.06012.49
5.2.110.0070.06312.49
5.2.100.0030.06712.49
5.2.90.0070.06012.49
5.2.80.0070.06012.49
5.2.70.0100.03312.49
5.2.60.0030.05012.49
5.2.50.0030.06712.49
5.2.40.0070.05712.49
5.2.30.0070.06012.49
5.2.20.0100.05312.49
5.2.10.0070.05712.49
5.2.00.0030.04012.49
5.1.60.0000.05012.49
5.1.50.0070.04712.49
5.1.40.0070.05012.49
5.1.30.0100.06012.49
5.1.20.0070.05312.49
5.1.10.0030.06012.49
5.1.00.0030.04712.49
5.0.50.0030.04712.49
5.0.40.0070.04312.49
5.0.30.0000.07012.49
5.0.20.0000.04712.49
5.0.10.0030.04312.49
5.0.00.0000.07012.49
4.4.90.0000.03712.49
4.4.80.0000.02712.49
4.4.70.0030.03312.49
4.4.60.0070.02312.49
4.4.50.0030.03312.49
4.4.40.0030.05312.49
4.4.30.0000.03012.49
4.4.20.0000.04012.49
4.4.10.0030.03312.49
4.4.00.0070.04712.49
4.3.110.0000.03712.49
4.3.100.0070.02312.49
4.3.90.0070.03012.49
4.3.80.0030.05312.49
4.3.70.0000.04012.49
4.3.60.0000.02712.49
4.3.50.0000.04012.49
4.3.40.0000.05312.49
4.3.30.0030.03712.49
4.3.20.0000.03712.49
4.3.10.0000.03712.49
4.3.00.0000.02712.49

preferences:
41.72 ms | 401 KiB | 5 Q