3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Reference { function __construct($value) { $this->reference = $value; } function startsWith($something, $start = 0) { if (mt_rand() % 2) { return strpos($this->reference, $something) === $start; } else { return substr($this->reference, $start, strlen($something)) == $something; } } } $subject = new Reference("AWB012345"); $result = $subject->startsWith("AWB0"); var_dump($result); $subject = new Reference("12345"); $result = $subject->startsWith("AWB0"); var_dump($result);

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.0120.00614.74
7.4.00.0130.00615.00
7.3.130.0060.01214.84
7.3.120.0090.00714.58
7.3.110.0130.00614.89
7.3.100.0090.00614.68
7.3.90.0030.01014.97
7.3.80.0000.01614.76
7.3.70.0070.00714.61
7.3.60.0060.00614.71
7.3.50.0000.01314.83
7.3.40.0070.00714.57
7.3.30.0000.01414.78
7.3.20.0000.01616.55
7.3.10.0060.01216.54
7.3.00.0080.00516.57
7.2.260.0110.00715.19
7.2.250.0110.00714.89
7.2.240.0070.00715.05
7.2.230.0090.00315.17
7.2.220.0000.01115.06
7.2.210.0000.01315.04
7.2.200.0030.01215.18
7.2.190.0040.01215.24
7.2.180.0090.00615.17
7.2.170.0030.00714.98
7.2.160.0030.01015.00
7.2.150.0110.00317.02
7.2.140.0030.00916.91
7.2.130.0130.00416.72
7.2.120.0070.00916.88
7.2.110.0090.00716.80
7.2.100.0050.01116.68
7.2.90.0050.01016.80
7.2.80.0110.00716.90
7.2.70.0060.00716.67
7.2.60.0090.01016.94
7.2.50.0060.00916.64
7.2.40.0100.00616.92
7.2.30.0110.00716.79
7.2.20.0070.00916.64
7.2.10.0090.00416.58
7.2.00.0040.00716.75
7.1.330.0060.01015.89
7.1.320.0030.00615.69
7.1.310.0060.00616.04
7.1.300.0030.01215.76
7.1.290.0060.00615.64
7.1.280.0000.01315.77
7.1.270.0030.01015.80
7.1.260.0080.00315.74
7.1.250.0060.00715.64
7.1.240.0060.00615.72
7.1.230.0060.00615.63
7.1.220.0070.00415.82
7.1.210.0010.01015.75
7.1.200.0090.00115.75
7.1.190.0020.01115.98
7.1.180.0020.01115.78
7.1.170.0040.00715.74
7.1.160.0080.00515.78
7.1.150.0020.01015.79
7.1.140.0060.00715.75
7.1.130.0030.00715.70
7.1.120.0070.00415.88
7.1.110.0030.00815.62
7.1.100.0070.00715.74
7.1.90.0040.00715.71
7.1.80.0050.00815.71
7.1.70.0030.00616.09
7.1.60.0070.01017.05
7.1.50.0090.00916.15
7.1.40.0050.00715.86
7.1.30.0050.00715.94
7.1.20.0080.00615.83
7.1.10.0060.00515.88
7.1.00.0040.03018.09
7.0.330.0050.00515.35
7.0.320.0020.01015.46
7.0.310.0060.00715.39
7.0.300.0030.00715.41
7.0.290.0030.01015.21
7.0.280.0060.00415.18
7.0.270.0030.00615.40
7.0.260.0050.00515.42
7.0.250.0080.00615.23
7.0.240.0070.00415.42
7.0.230.0060.00315.38
7.0.220.0080.00615.43
7.0.210.0070.00515.48
7.0.200.0040.00715.87
7.0.190.0050.00815.46
7.0.180.0040.00615.58
7.0.170.0070.00515.39
7.0.160.0070.00715.21
7.0.150.0040.00515.43
7.0.140.0070.02817.68
7.0.130.0070.00515.38
7.0.120.0080.00415.36
7.0.110.0050.00815.46
7.0.100.0060.00715.35
7.0.90.0030.01015.59
7.0.80.0050.00615.49
7.0.70.0050.00815.52
7.0.60.0020.02116.84
7.0.50.0050.02016.36
7.0.40.0090.03015.81
7.0.30.0130.03015.75
7.0.20.0150.03215.57
7.0.10.0080.03115.69
7.0.00.0060.03015.79
5.6.400.0040.00814.65
5.6.390.0040.00714.61
5.6.380.0030.00814.43
5.6.370.0060.00414.19
5.6.360.0070.00714.43
5.6.350.0080.00614.47
5.6.340.0020.01014.29
5.6.330.0050.00614.54
5.6.320.0040.00914.61
5.6.310.0050.00714.26
5.6.300.0050.00714.20
5.6.290.0070.00614.50
5.6.280.0030.03016.67
5.6.270.0070.00514.53
5.6.260.0080.00614.35
5.6.250.0070.00814.27
5.6.240.0090.00614.37
5.6.230.0080.00814.20
5.6.220.0020.01114.46
5.6.210.0110.02716.42
5.6.200.0050.03015.59
5.6.190.0090.01716.40
5.6.180.0140.02816.35
5.6.170.0100.03216.43
5.6.160.0100.01916.41
5.6.150.0090.01715.64
5.6.140.0090.02215.69
5.6.130.0080.03115.53
5.6.120.0060.03216.57
5.6.110.0080.03316.46
5.6.100.0130.02816.65
5.6.90.0080.02916.53
5.6.80.0050.03316.27
5.6.70.0130.01616.33
5.6.60.0060.00614.28
5.6.50.0040.00914.37
5.6.40.0060.00414.41
5.6.30.0030.00814.34
5.6.20.0070.00714.47
5.6.10.0090.00314.31
5.6.00.0050.00914.28
5.5.380.0020.00812.80
5.5.370.0090.00212.71
5.5.360.0040.00412.81
5.5.350.0050.03315.43
5.5.340.0080.02714.46
5.5.330.0030.01815.47
5.5.320.0090.02515.36
5.5.310.0150.01815.38
5.5.300.0020.03414.46
5.5.290.0030.02114.56
5.5.280.0080.02015.47
5.5.270.0060.03215.47
5.5.260.0050.03315.37
5.5.250.0100.02115.41
5.5.240.0040.01815.31
5.5.230.0030.00512.78
5.5.220.0060.00612.66
5.5.210.0050.00512.85
5.5.200.0020.01012.76
5.5.190.0070.00312.67
5.5.180.0050.00312.73
5.5.170.0050.00712.77
5.5.160.0060.00312.80
5.5.150.0020.01112.69
5.5.140.0050.00612.53
5.5.130.0030.00812.94
5.5.120.0090.00312.79
5.5.110.0020.00812.78
5.5.100.0040.00712.65
5.5.90.0020.01012.66
5.5.80.0050.00812.67
5.5.70.0020.00712.81
5.5.60.0040.00712.72
5.5.50.0040.00712.76
5.5.40.0000.00712.78
5.5.30.0030.00712.73
5.5.20.0020.01012.80
5.5.10.0000.01112.67
5.5.00.0050.00512.61
5.4.450.0300.01614.40
5.4.440.0200.02214.34
5.4.430.0120.01814.43
5.4.420.0270.00214.47
5.4.410.0260.00414.44
5.4.400.0250.00214.33
5.4.390.0230.00214.29
5.4.380.0310.00414.25
5.4.370.0240.00314.31
5.4.360.0220.00414.30
5.4.350.0240.00414.24
5.4.340.0230.00414.29
5.4.330.0050.00711.87
5.4.320.0060.01612.08
5.4.310.0050.01712.08
5.4.300.0030.01912.08
5.4.290.0040.02312.10
5.4.280.0070.01412.04
5.4.270.0050.01712.04
5.4.260.0040.02012.04
5.4.250.0060.01612.09
5.4.240.0070.01312.04
5.4.230.0050.01412.04
5.4.220.0040.01512.04
5.4.210.0040.01412.04
5.4.200.0050.01612.04
5.4.190.0030.01812.04
5.4.180.0040.01712.04
5.4.170.0030.01812.04
5.4.160.0040.01612.04
5.4.150.0060.01412.04
5.4.140.0040.01611.94
5.4.130.0050.01611.93
5.4.120.0060.01811.92
5.4.110.0030.01811.95
5.4.100.0040.01811.95
5.4.90.0060.01511.92
5.4.80.0020.01811.92
5.4.70.0020.01811.92
5.4.60.0020.01711.92
5.4.50.0050.01811.92
5.4.40.0040.01711.91
5.4.30.0060.01311.91
5.4.20.0060.01311.91
5.4.10.0030.01711.91
5.4.00.0050.01511.74
5.3.290.0050.02311.99
5.3.280.0050.02011.94
5.3.270.0050.02811.95
5.3.260.0040.02411.95
5.3.250.0070.02011.95
5.3.240.0050.02111.95
5.3.230.0030.02211.94
5.3.220.0050.01911.93
5.3.210.0050.02111.93
5.3.200.0060.02111.93
5.3.190.0060.01911.93
5.3.180.0020.02111.92
5.3.170.0040.02211.92
5.3.160.0010.02311.92
5.3.150.0040.02211.93
5.3.140.0060.02311.92
5.3.130.0040.02611.92
5.3.120.0030.02611.92
5.3.110.0070.01911.92
5.3.100.0070.02111.65
5.3.90.0040.02011.64
5.3.80.0060.02211.64
5.3.70.0050.02411.64
5.3.60.0070.02011.63
5.3.50.0040.02311.60
5.3.40.0030.02411.60
5.3.30.0050.02311.58
5.3.20.0010.02311.48
5.3.10.0070.01711.46
5.3.00.0060.02311.45
5.2.170.0030.02110.20
5.2.160.0040.01610.20
5.2.150.0060.01510.20
5.2.140.0020.01810.20
5.2.130.0010.01910.18
5.2.120.0050.01710.18
5.2.110.0050.01810.18
5.2.100.0060.01510.18
5.2.90.0040.01710.18
5.2.80.0040.01910.18
5.2.70.0040.01710.18
5.2.60.0060.01610.16
5.2.50.0030.02010.14
5.2.40.0040.01710.13
5.2.30.0030.01910.12
5.2.20.0040.01710.11
5.2.10.0060.01710.06
5.2.00.0040.01810.00
5.1.60.0040.0159.64
5.1.50.0060.0139.63
5.1.40.0040.0189.62
5.1.30.0040.0179.80
5.1.20.0060.0159.81
5.1.10.0040.0169.67
5.1.00.0030.0179.67
5.0.50.0030.0128.91
5.0.40.0040.0098.84
5.0.30.0040.0158.75
5.0.20.0050.0118.73
5.0.10.0030.0138.72
5.0.00.0020.0188.72
4.4.90.0030.0117.98
4.4.80.0030.0097.96
4.4.70.0030.0087.96
4.4.60.0030.0117.97
4.4.50.0020.0117.97
4.4.40.0020.0157.94
4.4.30.0010.0117.97
4.4.20.0030.0098.01
4.4.10.0030.0098.01
4.4.00.0030.0147.97
4.3.110.0060.0077.92
4.3.100.0020.0117.92
4.3.90.0050.0117.91
4.3.80.0030.0157.88
4.3.70.0020.0117.90
4.3.60.0050.0097.90
4.3.50.0030.0107.90
4.3.40.0030.0157.86
4.3.30.0030.0087.24
4.3.20.0020.0117.23
4.3.10.0030.0107.21
4.3.00.0050.00812.38

preferences:
37.99 ms | 400 KiB | 5 Q