3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = "Lorem IPSUM dolor sit amet, consectetur ipsum adipiscing elit."; $dolor = substr($a, 12, 5); echo "substr from position 15, 5 characters => ".$dolor."\n"; $elit = substr($a, -5, 4); echo "substr from position -5, 4 characters => ".$elit."\n"; // case sensitive $dolor_position = strpos($a, "dolor"); echo "strpos of dolor (case sensitive) => ".$dolor_position."\n"; // case insensitive $dolor_position_i = stripos($a, "dOLor"); echo "stripos of dOLlor (case insensitive) => ".$dolor_position_i."\n"; // case sensitive $new_a = str_replace("ipsum", "hello", $a); echo "str_replace ipsum (case sensitive) with hello => ".$new_a."\n"; // case insensitive $new_a = str_ireplace("ipsum", "hello", $a); echo "str_replace ipsum (case insensitive) with hello => ".$new_a."\n"; $len = strlen($a); echo "strlen (length) of a => ".$len."\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.3.60.0120.00616.63
8.3.50.0090.01118.35
8.3.40.0070.01118.50
8.3.30.0070.00718.68
8.3.20.0070.00021.69
8.3.10.0080.00019.01
8.3.00.0050.00321.73
8.2.180.0070.00725.92
8.2.170.0110.00418.94
8.2.160.0070.00722.96
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.77
8.2.110.0090.00021.10
8.2.100.0060.00617.78
8.2.90.0000.00818.04
8.2.80.0030.00617.97
8.2.70.0080.00017.63
8.2.60.0050.00517.68
8.2.50.0030.00618.07
8.2.40.0000.00918.22
8.2.30.0070.00018.09
8.2.20.0040.00418.07
8.2.10.0030.00518.93
8.2.00.0000.00717.99
8.1.280.0170.00725.92
8.1.270.0080.00020.49
8.1.260.0050.00326.35
8.1.250.0030.00628.09
8.1.240.0050.00322.55
8.1.230.0080.00420.89
8.1.220.0040.00417.74
8.1.210.0000.00818.87
8.1.200.0040.00717.35
8.1.190.0080.00017.23
8.1.180.0050.00318.10
8.1.170.0030.00618.56
8.1.160.0040.00418.81
8.1.150.0000.00818.89
8.1.140.0000.00720.33
8.1.130.0070.00020.13
8.1.120.0040.00417.37
8.1.110.0040.00417.45
8.1.100.0030.00617.48
8.1.90.0000.00717.29
8.1.80.0080.00017.46
8.1.70.0000.00717.50
8.1.60.0040.00417.48
8.1.50.0040.00417.52
8.1.40.0040.00417.55
8.1.30.0040.00417.51
8.1.20.0000.01117.63
8.1.10.0030.00517.48
8.1.00.0030.00517.41
8.0.300.0000.00720.03
8.0.290.0070.00016.63
8.0.280.0000.00818.49
8.0.270.0000.00717.16
8.0.260.0040.00418.46
8.0.250.0070.00016.92
8.0.240.0070.00016.93
8.0.230.0030.00316.97
8.0.220.0000.00716.79
8.0.210.0000.00916.78
8.0.200.0070.00016.93
8.0.190.0060.00316.95
8.0.180.0040.00416.93
8.0.170.0040.00416.81
8.0.160.0040.00416.89
8.0.150.0030.00316.83
8.0.140.0030.00516.84
8.0.130.0030.00313.36
8.0.120.0040.00416.88
8.0.110.0000.00816.93
8.0.100.0040.00416.78
8.0.90.0070.00016.93
8.0.80.0070.00716.89
8.0.70.0040.00416.76
8.0.60.0000.00716.79
8.0.50.0050.00216.70
8.0.30.0110.00717.01
8.0.20.0140.00516.95
8.0.10.0040.00416.76
8.0.00.0080.01316.85
7.4.330.0000.00615.55
7.4.320.0050.00516.52
7.4.300.0000.00616.53
7.4.290.0000.00816.44
7.4.280.0040.00416.35
7.4.270.0050.00316.45
7.4.260.0060.00316.50
7.4.250.0040.00316.49
7.4.240.0030.00316.59
7.4.230.0040.00416.47
7.4.220.0080.00016.41
7.4.210.0080.00916.47
7.4.200.0040.00416.44
7.4.160.0140.00516.40
7.4.130.0080.00816.46
7.4.120.0090.00916.46
7.4.110.0080.00816.68
7.4.100.0060.01216.48
7.4.90.0140.00316.60
7.4.80.0120.00619.39
7.4.70.0080.00816.53
7.4.60.0100.01416.30
7.4.50.0070.01016.54
7.4.40.0130.00316.15
7.4.10.0070.01115.09
7.4.00.0080.00914.96
7.3.330.0000.00513.06
7.3.320.0000.00613.16
7.3.310.0030.00316.39
7.3.300.0000.00616.24
7.3.290.0000.00716.23
7.3.280.0090.00816.29
7.3.260.0110.00616.43
7.3.240.0080.00916.48
7.3.230.0070.01016.44
7.3.210.0150.00316.70
7.3.200.0110.01116.56
7.3.190.0130.00416.43
7.3.180.0080.01216.32
7.3.170.0040.01216.65
7.3.160.0070.01016.27
7.3.130.0030.01314.44
7.3.120.0100.00515.50
7.3.110.0120.00515.30
7.3.100.0040.01015.42
7.3.90.0030.01015.46
7.3.80.0020.01115.35
7.3.70.0050.00815.39
7.3.60.0070.00715.37
7.3.50.0050.00915.29
7.3.40.0070.00915.29
7.3.30.0060.00715.13
7.3.20.0080.01016.38
7.3.10.0060.00916.35
7.3.00.0090.00616.28
7.2.330.0080.00816.73
7.2.320.0090.00916.46
7.2.310.0130.00316.79
7.2.300.0030.01316.77
7.2.290.0090.00916.73
7.2.260.0070.01314.95
7.2.250.0090.00715.04
7.2.240.0080.01015.60
7.2.230.0050.01115.62
7.2.220.0080.00615.59
7.2.210.0060.00815.55
7.2.200.0070.00815.56
7.2.190.0080.00515.58
7.2.180.0060.01015.32
7.2.170.0060.00915.48
7.2.160.0090.00515.76
7.2.150.0090.00916.42
7.2.140.0050.01116.43
7.2.130.0240.00616.31
7.2.120.0080.00916.28
7.2.110.0130.00416.31
7.2.100.0110.00516.28
7.2.90.0060.00916.33
7.2.80.0080.01016.38
7.2.70.0070.00816.31
7.2.60.0080.01016.46
7.2.50.0090.00716.28
7.2.40.0090.00816.34
7.2.30.0040.01216.44
7.2.20.0090.00716.32
7.2.10.0080.00816.37
7.2.00.0070.00816.34
7.1.330.0040.00916.09
7.1.320.0070.00316.09
7.1.310.0070.00716.13
7.1.300.0060.00715.98
7.1.290.0050.00816.03
7.1.280.0070.00715.66
7.1.270.0090.00615.66
7.1.260.0070.01115.75
7.1.250.0070.01215.51
7.1.240.0060.00315.76
7.1.230.0060.00815.87
7.1.220.0100.00315.65
7.1.210.0000.01215.80
7.1.200.0000.01015.53
7.1.190.0030.00615.69
7.1.180.0070.00715.45
7.1.170.0060.01015.55
7.1.160.0040.01215.69
7.1.150.0040.01115.92
7.1.140.0040.00815.81
7.1.130.0060.01015.80
7.1.120.0100.00315.63
7.1.110.0080.00815.77
7.1.100.0040.00415.99
7.1.90.0040.00715.71
7.1.80.0040.01115.78
7.1.70.0030.01015.77
7.1.60.0050.00515.74
7.1.50.0080.00415.73
7.1.40.0090.00415.63
7.1.30.0030.01015.85
7.1.20.0140.00015.82
7.1.10.0040.01115.93
7.1.00.0070.01015.80

preferences:
60.92 ms | 401 KiB | 5 Q