3v4l.org

run code in 300+ PHP versions simultaneously
<?php // let's say I want to add "Has" at beginning (if doesn't exist) $string_1 = "AnaHasSomeApples"; // we need to add $string_2 = "HsSomeApples"; // we need to add $string_3 = "HasApplesAlready"; // already exists at the beginning echo "string_1: ". (strpos($string_1,"Has") !== 0 ? "Has".$string_1: $string_1)."\n"; echo "string_2: ". (strpos($string_2,"Has") !== 0 ? "Has".$string_2: $string_2)."\n"; echo "string_3: ". (strpos($string_3,"Has") !== 0 ? "Has".$string_3: $string_3)."\n";

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.5.10.0100.01016.53
8.5.00.0130.00919.79
8.4.150.0020.00114.05
8.4.140.0140.00817.50
8.4.130.0090.00917.62
8.4.120.0140.00720.72
8.4.110.0120.00722.51
8.4.100.0070.00818.79
8.4.90.0040.00520.70
8.4.80.0030.00518.71
8.4.70.0050.00418.92
8.4.60.0040.00518.92
8.4.50.0150.00518.66
8.4.40.0100.01019.35
8.4.30.0060.01322.09
8.4.20.0130.00320.69
8.4.10.0120.00017.64
8.3.280.0080.01118.43
8.3.270.0100.01016.47
8.3.260.0060.00316.77
8.3.250.0110.00818.75
8.3.240.0090.00716.26
8.3.230.0070.00216.61
8.3.220.0080.01018.92
8.3.210.0110.00416.73
8.3.200.0050.00416.69
8.3.190.0110.00817.17
8.3.180.0040.00416.66
8.3.170.0030.01119.04
8.3.160.0110.00716.59
8.3.150.0150.00320.57
8.3.140.0050.00316.54
8.3.130.0150.00318.20
8.3.120.0070.00716.62
8.3.110.0090.00016.60
8.3.100.0090.00016.39
8.3.90.0080.00018.55
8.3.80.0040.00418.33
8.3.70.0000.01518.52
8.3.60.0080.01118.43
8.3.50.0090.00618.04
8.3.40.0070.01418.44
8.3.30.0090.00618.74
8.3.20.0050.00221.88
8.3.10.0000.00821.75
8.3.00.0040.00423.56
8.2.290.0090.01016.49
8.2.280.0100.00818.35
8.2.270.0110.00716.99
8.2.260.0110.00719.89
8.2.250.0050.00316.73
8.2.240.0070.01118.95
8.2.230.0040.00420.94
8.2.220.0040.00424.06
8.2.210.0100.00726.77
8.2.200.0060.00318.16
8.2.190.0120.00316.63
8.2.180.0140.00318.16
8.2.170.0070.00722.96
8.2.160.0080.00621.02
8.2.150.0040.00424.18
8.2.140.0030.01324.66
8.2.130.0080.00026.16
8.2.120.0040.00420.39
8.2.110.0060.00321.13
8.2.100.0000.01117.78
8.2.90.0050.00218.22
8.2.80.0000.00817.97
8.2.70.0000.00817.78
8.2.60.0000.00918.09
8.2.50.0040.00418.10
8.2.40.0040.00420.47
8.2.30.0000.00719.33
8.2.20.0050.00218.13
8.2.10.0040.00419.14
8.2.00.0040.00421.02
8.1.330.0140.00616.29
8.1.320.0110.01116.22
8.1.310.0050.00317.00
8.1.300.0090.00918.41
8.1.290.0080.00018.88
8.1.280.0160.00325.92
8.1.270.0130.00320.65
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00619.28
8.1.230.0080.00422.72
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0000.00917.35
8.1.190.0040.00417.25
8.1.180.0030.00618.10
8.1.170.0000.00818.68
8.1.160.0070.00018.89
8.1.150.0040.00418.77
8.1.140.0030.00318.87
8.1.130.0000.00820.27
8.1.120.0050.00317.41
8.1.110.0070.00017.43
8.1.100.0040.00417.38
8.1.90.0000.00817.45
8.1.80.0060.00317.47
8.1.70.0050.00617.44
8.1.60.0090.00417.61
8.1.50.0100.00417.45
8.1.40.0040.00717.45
8.1.30.0030.01017.66
8.1.20.0090.00417.63
8.1.10.0050.00717.39
8.1.00.0030.00917.42
8.0.300.0060.00320.04
8.0.290.0080.00016.75
8.0.280.0000.00718.37
8.0.270.0000.00717.22
8.0.260.0030.00318.46
8.0.250.0040.00416.98
8.0.240.0000.00816.98
8.0.230.0000.00716.94
8.0.220.0090.00016.79
8.0.210.0030.00316.89
8.0.200.0060.00316.92
8.0.190.0110.00116.92
8.0.180.0100.00216.93
8.0.170.0100.00216.85
8.0.160.0040.00716.90
8.0.150.0100.00216.79
8.0.140.0100.00216.80
8.0.130.0050.00815.04
8.0.120.0060.00516.90
8.0.110.0090.00316.82
8.0.100.0040.00616.89
8.0.90.0070.00316.81
8.0.80.0100.00416.83
8.0.70.0050.00516.77
8.0.60.0020.00716.75
8.0.50.0050.00616.76
8.0.30.0090.00516.90
8.0.20.0090.00616.92
8.0.10.0060.00316.96
8.0.00.0090.00716.85
7.4.330.0050.00015.55
7.4.320.0030.00316.65
7.4.300.0040.00416.50
7.4.290.0060.00416.52
7.4.280.0060.00416.52
7.4.270.0060.00516.52
7.4.260.0040.00816.57
7.4.250.0080.00416.62
7.4.240.0070.00316.55
7.4.230.0070.00516.51
7.4.220.0060.00416.37
7.4.210.0050.01016.60
7.4.200.0060.00416.61
7.4.190.0040.00716.59
7.4.180.0070.00416.56
7.4.160.0100.00616.50
7.4.150.0070.00416.55
7.4.140.0130.00816.97
7.4.130.0080.00616.48
7.4.120.0080.00516.44
7.4.110.0100.00316.44
7.4.100.0060.00816.46
7.4.90.0070.00616.45
7.4.80.0060.00717.49
7.4.70.0100.00316.62
7.4.60.0060.00716.57
7.4.50.0080.00416.45
7.4.40.0060.00716.45
7.4.30.0070.00416.46
7.4.20.0070.00416.37
7.4.10.0070.00416.42
7.4.00.0090.00416.00
7.3.330.0070.00314.72
7.3.320.0040.00714.66
7.3.310.0050.00616.30
7.3.300.0090.00216.22
7.3.290.0080.00316.30
7.3.280.0110.00316.26
7.3.270.0070.00316.16
7.3.260.0080.00916.40
7.3.250.0060.00416.23
7.3.240.0100.00616.27
7.3.230.0080.00716.31
7.3.220.0050.00516.16
7.3.210.0070.00616.27
7.3.200.0100.00316.17
7.3.190.0030.00916.24
7.3.180.0110.00116.24
7.3.170.0100.00216.28
7.3.160.0070.00516.34
7.3.150.0050.00616.26
7.3.140.0070.00316.15
7.3.130.0050.00416.17
7.3.120.0080.00216.11
7.3.110.0060.00416.11
7.3.100.0060.00516.12
7.3.90.0070.00416.39
7.3.80.0080.00316.25
7.3.70.0040.00616.29
7.3.60.0080.00415.86
7.3.50.0070.00315.77
7.3.40.0100.00115.86
7.3.30.0090.00515.94
7.3.20.0060.00517.04
7.3.10.0090.00317.02
7.3.00.0070.00517.05
7.2.340.0090.00116.30
7.2.330.0070.00616.40
7.2.320.0090.00416.40
7.2.310.0060.00716.53
7.2.300.0060.00916.36
7.2.290.0070.00516.44
7.2.280.0030.00716.39
7.2.270.0090.00216.29
7.2.260.0070.00316.40
7.2.250.0080.00416.31
7.2.240.0080.00216.32
7.2.230.0040.00616.18
7.2.220.0090.00116.32
7.2.210.0050.00616.32
7.2.200.0090.00216.52
7.2.190.0070.00515.87
7.2.180.0060.00515.96
7.2.170.0070.00515.82
7.2.160.0080.00615.92
7.2.150.0070.00717.26
7.2.140.0070.00417.21
7.2.130.0050.00617.37
7.2.120.0040.00917.29
7.2.110.0080.00317.32
7.2.100.0080.00417.32
7.2.90.0080.00417.29
7.2.80.0090.00817.22
7.2.70.0050.00817.23
7.2.60.0110.00217.28
7.2.50.0050.00717.22
7.2.40.0070.00617.27
7.2.30.0060.00617.38
7.2.20.0080.00617.18
7.2.10.0070.00417.09
7.2.00.0070.00717.38
7.1.330.0100.00116.27
7.1.320.0070.00416.43
7.1.310.0060.00416.38
7.1.300.0090.00516.27
7.1.290.0070.00716.14
7.1.280.0080.00516.07
7.1.270.0050.00516.18
7.1.260.0040.00716.15
7.1.250.0060.00516.00
7.1.240.0100.00016.28
7.1.230.0060.00516.31
7.1.220.0060.00416.37
7.1.210.0070.00316.36
7.1.200.0110.00516.23
7.1.190.0110.00016.29
7.1.180.0060.00616.34
7.1.170.0080.00316.21
7.1.160.0100.00216.21
7.1.150.0090.00116.36
7.1.140.0090.00216.19
7.1.130.0070.00416.34
7.1.120.0070.00416.37
7.1.110.0070.00416.19
7.1.100.0060.00616.33
7.1.90.0100.00316.27
7.1.80.0050.00616.41
7.1.70.0100.00016.18
7.1.60.0100.00016.32
7.1.50.0070.00416.37
7.1.40.0080.00216.37
7.1.30.0050.00516.27
7.1.20.0080.00316.32
7.1.10.0070.00316.32
7.1.00.0070.00416.26

preferences:
132.29 ms | 403 KiB | 5 Q