3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Check if a string starts with a substring * * @param string $string * @param string $substr * @return bool */ function str_starts_with(string $string, string $substr): bool { return strpos($string, $substr) === 0; } var_dump( str_starts_with("This is test!", "This"));

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.4.30.0040.00420.08
8.4.20.0090.01218.80
8.4.10.0090.01217.70
8.3.160.0090.00917.04
8.3.150.0040.01217.23
8.3.140.0090.00018.42
8.3.130.0080.01116.78
8.3.120.0000.00919.00
8.3.110.0090.00020.94
8.3.100.0060.00324.06
8.3.90.0030.00726.77
8.3.80.0030.00618.50
8.3.70.0110.00416.75
8.3.60.0140.00718.31
8.3.50.0090.00618.86
8.3.40.0160.00318.77
8.3.30.0150.00018.77
8.3.20.0070.00020.82
8.3.10.0090.00021.99
8.3.00.0040.00422.43
8.2.270.0060.00317.14
8.2.260.0110.00718.32
8.2.250.0040.00416.59
8.2.240.0040.00418.52
8.2.230.0030.00722.58
8.2.220.0070.00037.54
8.2.210.0090.00026.77
8.2.200.0070.00416.63
8.2.190.0150.00616.63
8.2.180.0070.01018.54
8.2.170.0100.00322.96
8.2.160.0140.00020.21
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0060.00322.20
8.2.100.0070.00417.91
8.2.90.0080.00018.22
8.2.80.0040.00418.98
8.2.70.0040.00417.43
8.2.60.0040.00418.03
8.2.50.0050.00318.10
8.2.40.0030.00619.30
8.2.30.0060.00319.00
8.2.20.0000.00717.94
8.2.10.0040.00419.22
8.2.00.0070.00318.08
8.1.310.0030.00518.16
8.1.300.0060.00318.00
8.1.290.0000.00918.88
8.1.280.0100.01025.92
8.1.270.0080.00022.39
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00023.83
8.1.230.0090.00322.67
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0030.00617.23
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0080.00020.81
8.1.160.0050.00318.85
8.1.150.0070.00018.67
8.1.140.0070.00419.10
8.1.130.0060.00417.29
8.1.120.0040.00417.33
8.1.110.0080.00017.33
8.1.100.0070.00017.30
8.1.90.0000.01017.22
8.1.80.0070.00017.30
8.1.70.0050.00217.21
8.1.60.0050.00317.50
8.1.50.0000.00717.43
8.1.40.0040.00417.21
8.1.30.0080.00017.48
8.1.20.0040.00417.43
8.1.10.0030.00617.38
8.1.00.0090.00317.37
8.0.300.0070.00022.07
8.0.290.0060.00316.75
8.0.280.0070.00018.32
8.0.270.0030.00517.13
8.0.260.0070.00216.83
8.0.250.0000.00716.80
8.0.240.0030.00616.85
8.0.230.0040.00416.93
8.0.220.0020.00516.84
8.0.210.0050.00216.74
8.0.200.0040.00416.84
8.0.190.0000.00716.86
8.0.180.0080.00016.73
8.0.170.0040.00816.90
8.0.160.0000.00716.79
8.0.150.0070.00016.79
8.0.140.0040.00416.82
8.0.130.0030.00313.33
8.0.120.0060.00316.80
8.0.110.0030.00516.75
8.0.100.0040.00416.88
8.0.90.0040.00416.66
8.0.80.0090.00616.88
8.0.70.0040.00416.80
8.0.60.0040.00416.66
8.0.50.0070.00016.90
8.0.30.0130.00316.71
8.0.20.0110.00717.04
8.0.10.0030.00316.85
8.0.00.0060.01616.52
7.4.330.0050.00316.43
7.4.320.0030.00316.43
7.4.300.0040.00416.37
7.4.290.0030.00316.48
7.4.280.0040.00416.44
7.4.270.0000.00716.35
7.4.260.0000.00813.12
7.4.250.0070.00016.51
7.4.240.0010.00616.53
7.4.230.0030.00316.66
7.4.220.0000.00716.64
7.4.210.0070.01016.50
7.4.200.0030.00316.20
7.4.130.0100.00716.34
7.4.120.0140.00616.43
7.4.110.0040.03816.53
7.4.100.0100.01016.39
7.4.90.0090.00916.31
7.4.80.0220.00019.39
7.4.70.0090.00916.41
7.4.60.0100.01116.50
7.4.50.0040.01116.35
7.4.40.0070.01016.67
7.4.00.0030.01014.96
7.3.330.0000.00716.36
7.3.320.0000.00613.13
7.3.310.0070.00016.16
7.3.300.0060.00016.29
7.3.290.0000.00716.36
7.3.260.0120.00716.41
7.3.230.0130.00516.57
7.3.210.0090.00916.46
7.3.200.0070.01316.65
7.3.190.0120.00916.49
7.3.180.0080.00816.25
7.3.170.0100.00716.39
7.3.160.0110.00816.45
7.3.100.0060.00914.78
7.3.90.0050.00914.80
7.3.80.0070.00814.72
7.3.70.0070.00714.80
7.3.60.0090.00614.73
7.3.50.0050.01114.71
7.3.40.0080.00614.62
7.3.30.0100.00614.57
7.3.20.0130.00414.88
7.3.10.0060.00814.96
7.3.00.0030.01114.72
7.2.330.0100.00716.32
7.2.320.0070.01116.38
7.2.310.0090.01616.18
7.2.300.0060.01216.64
7.2.290.0110.00716.60
7.2.230.0080.00614.93
7.2.220.0130.00714.73
7.2.210.0050.00914.79
7.2.200.0100.00514.80
7.2.190.0070.00815.01
7.2.180.0030.01514.80
7.2.170.0110.00614.87
7.2.160.0070.00914.98
7.2.150.0070.01014.90
7.2.140.0050.01014.85
7.2.130.0070.00914.99
7.2.120.0020.01414.88
7.2.110.0090.00715.03
7.2.100.0120.00314.96
7.2.90.0140.00214.73
7.2.80.0200.00614.73
7.2.70.0040.01314.91
7.2.60.0080.00614.87
7.2.50.0040.01214.87
7.2.40.0080.00614.68
7.2.30.0110.00614.97
7.2.20.0110.00714.78
7.2.10.0080.01014.62
7.2.00.0100.00714.82
7.1.320.0070.00813.74
7.1.310.0080.00813.83
7.1.300.0040.01013.80
7.1.290.0080.00913.94
7.1.280.0020.01213.90
7.1.270.0090.00513.64
7.1.260.0100.00413.86
7.1.250.0050.00913.77
4.3.90.0000.00216.87

preferences:
17.25 ms | 403 KiB | 5 Q