3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getCount($str) { $vowelsCount = 0; $vowels = array('a', 'e', 'i', 'o', 'u'); $letters = explode('', $str); print_r($letters); foreach ($letters as $letter) { if (in_array($letter, $vowels)) { $vowelsCount++; } } return $vowelsCount; } echo getCount('heyo'); function getMiddle($text) { $length = strlen($text); if ($length%2 == 0) { echo $length/2; return substr($text, $length/2 - 1, 2); } else { return substr($text, $length/2, 1); } } //echo getMiddle('test');

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.0160.00616.63
8.3.50.0150.00316.46
8.3.40.0120.00618.70
8.3.30.0070.01018.65
8.3.20.0060.00320.09
8.3.10.0040.00420.98
8.3.00.0040.00420.13
8.2.180.0080.00818.54
8.2.170.0070.01122.96
8.2.160.0140.00021.20
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0000.00721.04
8.2.120.0040.00426.35
8.2.110.0070.00421.12
8.2.100.0070.00417.91
8.2.90.0030.00619.18
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0040.00417.80
8.2.50.0000.00718.10
8.2.40.0030.00620.42
8.2.30.0040.00419.09
8.2.20.0000.00718.07
8.2.10.0040.00418.12
8.2.00.0040.00418.11
8.1.280.0120.00625.92
8.1.270.0080.00023.92
8.1.260.0050.00226.35
8.1.250.0000.00728.09
8.1.240.0100.00020.80
8.1.230.0090.00322.18
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0000.00817.48
8.1.190.0040.00417.25
8.1.180.0040.00418.10
8.1.170.0040.00418.59
8.1.160.0060.00318.78
8.1.150.0040.00420.29
8.1.140.0000.00819.58
8.1.130.0080.00018.84
8.1.120.0040.00417.38
8.1.110.0040.00417.38
8.1.100.0000.00817.38
8.1.90.0060.00317.40
8.1.80.0000.00717.40
8.1.70.0030.00317.31
8.1.60.0050.00317.59
8.1.50.0040.00417.56
8.1.40.0040.00417.43
8.1.30.0030.00517.65
8.1.20.0000.00817.66
8.1.10.0030.00617.60
8.1.00.0030.00517.41
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0040.00418.43
8.0.270.0040.00417.20
8.0.260.0060.00018.84
8.0.250.0000.00716.96
8.0.240.0050.00216.88
8.0.230.0030.00516.94
8.0.220.0000.00716.91
8.0.210.0030.00516.80
8.0.200.0040.00417.00
8.0.190.0050.00317.00
8.0.180.0050.00216.80
8.0.170.0070.00016.94
8.0.160.0000.00816.92
8.0.150.0040.00416.80
8.0.140.0030.00516.87
8.0.130.0030.00313.28
8.0.120.0040.00416.92
8.0.110.0000.00816.86
8.0.100.0000.00716.68
8.0.90.0000.00716.93
8.0.80.0090.01316.87
8.0.70.0040.00416.90
8.0.60.0000.00816.93
8.0.50.0000.00716.96
8.0.30.0120.00517.01
8.0.20.0130.00717.40
8.0.10.0040.00416.82
8.0.00.0070.01716.69
7.4.330.0000.00515.55
7.4.320.0080.00016.50
7.4.300.0030.00316.60
7.4.290.0000.00716.53
7.4.280.0030.00516.45
7.4.270.0000.00716.43
7.4.260.0030.00716.60
7.4.250.0000.00716.46
7.4.240.0030.00316.65
7.4.230.0040.00416.51
7.4.220.0090.00916.55
7.4.210.0070.00716.67
7.4.200.0030.00316.30
7.4.160.0120.00516.44
7.4.150.0060.01217.40
7.4.140.0100.00917.86
7.4.130.0090.01216.57
7.4.120.0110.01116.57
7.4.110.0030.01416.81
7.4.100.0040.01416.49
7.4.90.0090.00916.70
7.4.80.0130.00719.39
7.4.70.0000.01616.66
7.4.60.0090.00616.54
7.4.50.0030.01216.49
7.4.40.0150.00616.70
7.4.30.0070.01016.61
7.4.10.0070.01114.94
7.4.00.0090.00715.13
7.3.330.0000.00513.21
7.3.320.0000.00513.34
7.3.310.0050.00316.24
7.3.300.0060.00016.28
7.3.290.0080.00716.32
7.3.280.0080.00916.34
7.3.270.0100.00717.40
7.3.260.0120.00516.59
7.3.250.0070.01016.43
7.3.240.0120.00816.41
7.3.230.0060.01316.39
7.3.210.0030.01316.36
7.3.200.0060.01016.43
7.3.190.0070.01016.36
7.3.180.0160.00616.50
7.3.170.0040.01216.52
7.3.160.0100.00616.36
7.3.130.0110.00714.66
7.3.120.0100.00714.98
7.3.110.0090.00914.57
7.3.100.0060.00314.93
7.3.90.0030.01014.84
7.3.80.0090.00614.83
7.3.70.0020.01014.92
7.3.60.0030.01314.96
7.3.50.0050.01214.75
7.3.40.0060.01014.72
7.3.30.0050.01214.94
7.3.20.0060.01016.51
7.3.10.0050.01116.70
7.3.00.0060.00816.60
7.2.330.0090.00916.49
7.2.320.0180.00716.71
7.2.310.0100.00616.42
7.2.300.0100.00716.49
7.2.290.0040.01216.82
7.2.260.0090.00615.16
7.2.250.0060.01015.17
7.2.240.0030.01515.13
7.2.230.0050.00914.94
7.2.220.0050.01015.03
7.2.210.0080.00414.98
7.2.200.0100.00415.07
7.2.190.0100.00414.81
7.2.180.0040.01115.03
7.2.170.0020.01015.07
7.2.160.0070.00715.09
7.2.150.0100.00616.89
7.2.140.0070.01016.71
7.2.130.0100.00316.93
7.2.120.0050.00616.96
7.2.110.0130.00716.80
7.2.100.0120.00216.96
7.2.90.0040.00716.86
7.2.80.0090.00416.96
7.2.70.0070.00416.76
7.2.60.0100.00616.69
7.2.50.0050.01016.82
7.2.40.0030.00816.74
7.2.30.0040.00916.68
7.2.20.0070.00716.93
7.2.10.0080.00716.73
7.2.00.0060.00916.90
7.1.330.0050.01015.62
7.1.320.0120.00515.70
7.1.310.0030.01015.84
7.1.300.0070.00715.59
7.1.290.0070.00715.85
7.1.280.0000.01315.68
7.1.270.0070.00915.86
7.1.260.0060.01015.84
7.1.250.0060.00815.62
7.1.240.0070.00515.62
7.1.230.0030.01015.60
7.1.220.0050.01115.73
7.1.210.0050.01015.59
7.1.200.0030.00915.59
7.1.190.0040.00715.75
7.1.180.0040.00915.57
7.1.170.0080.00315.75
7.1.160.0030.00915.58
7.1.150.0020.01115.89
7.1.140.0020.01215.70
7.1.130.0070.00515.73
7.1.120.0060.00715.72
7.1.110.0060.00715.81
7.1.100.0020.01115.79
7.1.90.0040.00816.46
7.1.80.0050.00816.55
7.1.70.0080.00716.28
7.1.60.0100.01022.12
7.1.50.0080.00921.98
7.1.40.0090.01121.88
7.1.30.0090.01421.99
7.1.20.0040.01422.04
7.1.10.0060.00416.01
7.1.00.0030.01015.93
7.0.330.0050.00915.51
7.0.320.0040.00515.37
7.0.310.0030.00915.40
7.0.300.0010.01015.49
7.0.290.0030.00815.31
7.0.280.0070.00715.26
7.0.270.0100.00015.25
7.0.260.0090.00015.28
7.0.250.0080.00715.25
7.0.240.0050.00715.52
7.0.230.0040.00615.33
7.0.220.0070.00515.32
7.0.210.0090.00515.21
7.0.200.0080.00615.77
7.0.190.0030.01015.85
7.0.180.0030.00915.70
7.0.170.0060.00915.56
7.0.160.0090.00315.70
7.0.150.0090.00415.79
7.0.140.0080.00615.77
7.0.130.0070.00715.62
7.0.120.0070.00815.91
7.0.110.0070.00515.70
7.0.100.0070.00315.81
7.0.90.0000.01315.72
7.0.80.0050.00815.72
7.0.70.0060.00715.67
7.0.60.0040.00815.61
7.0.50.0080.00415.74
7.0.40.0040.00614.41
7.0.30.0050.00814.45
7.0.20.0050.00914.41
7.0.10.0040.00614.46
7.0.00.0030.01114.42
5.6.400.0070.00713.92
5.6.390.0090.00313.95
5.6.380.0050.00814.42
5.6.370.0040.00814.25
5.6.360.0110.00414.25
5.6.350.0030.00714.71
5.6.340.0080.00614.07
5.6.330.0090.00914.34
5.6.320.0040.01114.18
5.6.310.0000.01214.40
5.6.300.0040.01114.52
5.6.290.0030.00714.57
5.6.280.0070.01014.03
5.6.270.0140.00014.39
5.6.260.0070.00714.38
5.6.250.0000.00914.02
5.6.240.0070.00714.36
5.6.230.0100.00614.63
5.6.220.0070.00714.43
5.6.210.0000.01414.18
5.6.200.0040.01114.09
5.6.190.0110.00014.46
5.6.180.0070.00714.35
5.6.170.0110.00314.32
5.6.160.0030.01014.48
5.6.150.0030.00613.93
5.6.140.0070.00714.52
5.6.130.0070.00314.25
5.6.120.0040.01114.54
5.6.110.0040.01114.25
5.6.100.0030.00614.27
5.6.90.0110.00414.21
5.6.80.0030.01414.12
5.6.70.0070.01014.17
5.6.60.0060.01014.21
5.6.50.0070.01014.05
5.6.40.0060.00314.30
5.6.30.0130.00014.07
5.6.20.0040.00814.24
5.6.10.0040.00414.32
5.6.00.0030.01014.15

preferences:
64.2 ms | 400 KiB | 5 Q