3v4l.org

run code in 300+ PHP versions simultaneously
<?php function censorWord($word, $censor) { if(strpos($word, $censor)) { return preg_replace("/$censor/",'*', $word, 1); } } $start = microtime(true); $word_list = ['php','javascript']; $data = "Javascript and php are awesome!"; $words = explode(" ", $data); // pass each word by reference so it can be modified inside our array foreach($words as &$word) { if(in_array(strtolower($word), $word_list)) { // this just passes the second letter of the word // as the $censor argument $word = censorWord($word, $word[1]); } } echo implode(" ", $words); // returns J*vascript and p*p are awesome! $end = (microtime(true)); echo '<br />'; echo $end - $start;

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)
7.4.10.0060.00915.29
7.4.00.0090.01015.16
7.3.130.0050.01414.89
7.3.120.0040.01214.87
7.3.110.0080.01115.04
7.3.100.0070.00915.08
7.3.90.0100.00315.07
7.3.80.0030.00915.09
7.3.70.0030.01215.15
7.3.60.0080.00714.98
7.3.50.0070.00715.12
7.3.40.0060.00715.08
7.3.30.0070.00615.09
7.3.20.0090.00416.81
7.3.10.0060.00816.87
7.3.00.0070.01116.76
7.2.260.0100.01015.36
7.2.250.0070.01015.06
7.2.240.0070.00815.35
7.2.230.0020.00915.28
7.2.220.0040.00915.30
7.2.210.0090.00615.33
7.2.200.0030.01115.31
7.2.190.0070.00715.24
7.2.180.0120.00315.27
7.2.170.0070.01015.29
7.2.160.0050.00715.14
7.2.150.0070.00617.20
7.2.140.0030.00917.24
7.2.130.0030.01017.19
7.2.120.0110.00517.12
7.2.110.0090.00617.12
7.2.100.0090.00617.23
7.2.90.0040.01217.06
7.2.80.0050.00717.17
7.2.70.0050.01017.11
7.2.60.0110.00617.15
7.2.50.0100.00517.00
7.2.40.0030.01417.34
7.2.30.0030.00917.04
7.2.20.0060.00617.12
7.2.10.0090.00517.08
7.2.00.0090.00118.04
7.1.330.0020.01216.14
7.1.320.0040.01016.09
7.1.310.0070.00916.00
7.1.300.0050.00715.96
7.1.290.0030.01015.90
7.1.280.0060.00816.01
7.1.270.0030.00815.79
7.1.260.0080.00815.90
7.1.250.0060.00616.07
7.1.240.0020.01216.03
7.1.230.0030.00916.10
7.1.220.0050.01015.93
7.1.210.0050.00816.03
7.1.200.0060.00916.00
7.1.190.0050.00715.90
7.1.180.0010.00916.02
7.1.170.0060.00715.76
7.1.160.0080.00415.92
7.1.150.0080.00515.99
7.1.140.0040.00616.07
7.1.130.0040.01116.08
7.1.120.0030.00916.09
7.1.110.0100.00315.97
7.1.100.0080.00415.82
7.1.90.0040.01116.06
7.1.80.0040.00915.93
7.1.70.0050.00816.41
7.1.60.0090.00817.10
7.1.50.0160.00422.38
7.1.40.0070.00615.95
7.1.30.0100.00515.99
7.1.20.0060.00815.93
7.1.10.0060.00615.91
7.1.00.0070.02918.02
7.0.330.0020.01215.38
7.0.320.0110.00315.40
7.0.310.0030.00715.63
7.0.300.0060.00515.54
7.0.290.0050.00815.62
7.0.280.0040.00915.62
7.0.270.0060.00815.65
7.0.260.0020.01115.39
7.0.250.0050.00415.67
7.0.240.0080.00815.76
7.0.230.0070.00915.56
7.0.220.0050.01015.71
7.0.210.0080.00615.62
7.0.200.0040.00816.05
7.0.190.0030.01215.69
7.0.180.0030.01215.43
7.0.170.0070.00515.49
7.0.160.0080.00715.66
7.0.150.0050.00615.72
7.0.140.0050.03017.74
7.0.130.0090.00515.67
7.0.120.0050.01015.60
7.0.110.0090.00415.61
7.0.100.0130.00015.58
7.0.90.0090.00415.50
7.0.80.0020.01115.49
7.0.70.0060.02517.74
7.0.60.0130.02217.56
7.0.50.0080.02017.82
7.0.40.0020.03615.81
7.0.30.0070.03215.90
7.0.20.0010.03615.69
7.0.10.0020.03515.79
7.0.00.0070.03215.77
5.6.400.0080.00914.56
5.6.390.0050.00814.56
5.6.380.0040.00914.48
5.6.370.0080.00514.41
5.6.360.0070.00714.45
5.6.350.0050.00714.33
5.6.340.0040.00914.59
5.6.330.0060.00814.40
5.6.320.0060.00514.72
5.6.310.0070.00714.36
5.6.300.0070.00914.38
5.6.290.0050.00814.23
5.6.280.0030.03316.77
5.6.270.0080.00814.53
5.6.260.0080.00614.35
5.6.250.0050.00914.55
5.6.240.0080.00614.38
5.6.230.0020.01114.35
5.6.220.0060.03216.56
5.6.210.0060.03416.47
5.6.200.0070.02916.55
5.6.190.0050.03316.79
5.6.180.0060.03216.59
5.6.170.0040.02816.66
5.6.160.0050.02516.57
5.6.150.0050.02316.75
5.6.140.0080.03316.76
5.6.130.0060.03016.66
5.6.120.0040.02816.72
5.6.110.0110.02916.70
5.6.100.0090.02716.50
5.6.90.0040.02516.74
5.6.80.0080.03116.46
5.6.70.0030.02316.41
5.6.60.0070.02916.36
5.6.50.0040.03016.32
5.6.40.0080.02816.33
5.6.30.0060.02916.43
5.6.20.0050.02216.33
5.6.10.0060.03016.37
5.6.00.0090.02116.42
5.5.380.0050.01014.63
5.5.370.0020.01114.44
5.5.360.0050.03116.40
5.5.350.0060.02116.54
5.5.340.0060.02816.67
5.5.330.0040.03316.52
5.5.320.0030.03416.44
5.5.310.0060.03316.56
5.5.300.0090.03016.63
5.5.290.0060.02116.42
5.5.280.0060.03416.55
5.5.270.0070.03016.60
5.5.260.0080.03116.49
5.5.250.0020.02316.47
5.5.240.0020.02616.43
5.5.230.0050.03216.29
5.5.220.0030.02516.29
5.5.210.0030.03116.15
5.5.200.0050.03316.22
5.5.190.0040.03516.22
5.5.180.0070.02516.30
5.5.170.0060.00614.34
5.5.160.0070.01716.40
5.5.150.0020.02716.34
5.5.140.0060.03116.34
5.5.130.0020.02916.40
5.5.120.0030.03416.31
5.5.110.0040.03016.43
5.5.100.0030.02816.34
5.5.90.0050.02016.25
5.5.80.0070.03116.33
5.5.70.0020.02416.19
5.5.60.0040.03416.25
5.5.50.0020.03216.32
5.5.40.0060.02916.26
5.5.30.0050.03216.38
5.5.20.0030.03616.23
5.5.10.0080.02916.28
5.5.00.0080.02916.21
5.4.450.0030.03014.11
5.4.440.0040.03014.02
5.4.430.0010.03014.06
5.4.420.0050.02814.01
5.4.410.0050.02914.03
5.4.400.0060.02713.82
5.4.390.0080.01413.83
5.4.380.0060.02913.87
5.4.370.0070.02513.92
5.4.360.0040.03213.88
5.4.350.0070.02813.86
5.4.340.0020.02813.89
5.4.330.0040.00611.30
5.4.320.0040.02113.86
5.4.310.0070.02613.87
5.4.300.0030.02313.77
5.4.290.0040.03013.83
5.4.280.0030.03213.91
5.4.270.0010.02413.90
5.4.260.0050.02713.72
5.4.250.0060.02113.90
5.4.240.0050.02713.82
5.4.230.0010.03413.97
5.4.220.0030.03313.88
5.4.210.0050.03013.82
5.4.200.0060.02513.99
5.4.190.0020.03113.89
5.4.180.0040.02813.89
5.4.170.0050.02813.80
5.4.160.0060.02713.73
5.4.150.0010.03313.85
5.4.140.0040.02813.06
5.4.130.0070.02713.06
5.4.120.0050.02813.02
5.4.110.0010.02113.03
5.4.100.0060.02612.93
5.4.90.0040.02913.08
5.4.80.0030.02513.02
5.4.70.0040.02913.02
5.4.60.0070.02613.02
5.4.50.0050.02713.00
5.4.40.0030.02512.89
5.4.30.0050.02812.96
5.4.20.0020.02912.96
5.4.10.0060.02812.97
5.4.00.0050.02712.84
5.3.290.0030.03112.51
5.3.280.0020.02912.48
5.3.270.0030.02812.48
5.3.260.0050.02912.50
5.3.250.0030.03012.49
5.3.240.0010.02912.48
5.3.230.0020.02612.48
5.3.220.0010.02912.48
5.3.210.0020.02712.50
5.3.200.0060.02612.48
5.3.190.0000.02512.48
5.3.180.0040.02812.52
5.3.170.0050.02812.54
5.3.160.0050.02812.53
5.3.150.0050.02312.54
5.3.140.0030.02912.52
5.3.130.0030.02212.49
5.3.120.0060.02112.48
5.3.110.0010.02512.49
5.3.100.0030.02712.52
5.3.90.0010.02912.51
5.3.80.0070.02312.48
5.3.70.0040.02312.48
5.3.60.0060.02612.48
5.3.50.0060.02012.48
5.3.40.0040.02712.48
5.3.30.0040.01912.48
5.3.20.0040.02612.48
5.3.10.0040.02412.48
5.3.00.0010.03112.48
5.2.170.0000.07015.80
5.2.160.0000.06715.80
5.2.150.0000.05715.80
5.2.140.0070.06015.80
5.2.130.0030.04315.80
5.2.120.0070.05015.80
5.2.110.0000.04715.80
5.2.100.0030.06015.80
5.2.90.0030.06015.80
5.2.80.0000.06715.80
5.2.70.0030.06015.80
5.2.60.0070.05715.80
5.2.50.0000.06015.80
5.2.40.0100.05315.80
5.2.30.0070.06015.80
5.2.20.0100.05015.80
5.2.10.0000.04715.80
5.2.00.0100.05315.80
5.1.60.0030.04315.80
5.1.50.0100.04715.80
5.1.40.0030.05315.80
5.1.30.0030.05715.80
5.1.20.0000.04315.80
5.1.10.0030.04715.80
5.1.00.0030.05315.80
5.0.50.0000.04015.80
5.0.40.0030.04715.80
5.0.30.0000.06715.80
5.0.20.0000.04715.80
5.0.10.0070.03015.80
5.0.00.0000.06715.80
4.4.90.0030.03015.80
4.4.80.0070.03015.80
4.4.70.0030.03315.80
4.4.60.0030.03315.80
4.4.50.0030.03315.80
4.4.40.0030.02715.80
4.4.30.0000.03715.80
4.4.20.0030.03315.80
4.4.10.0000.03015.80
4.4.00.0000.05315.80
4.3.110.0000.03315.80
4.3.100.0070.03015.80
4.3.90.0000.03715.80
4.3.80.0000.04315.80
4.3.70.0000.03015.80
4.3.60.0000.03715.80
4.3.50.0000.03715.80
4.3.40.0070.04715.80
4.3.30.0030.03315.80
4.3.20.0030.03315.80
4.3.10.0030.03315.80
4.3.00.0030.03315.80

preferences:
48.97 ms | 401 KiB | 5 Q