3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a='I love you'; echo str_replace_first('z','ea',$a); function str_replace_first($thiss,$that,$where) { return substr($where,0,strpos($where,$thiss)). $that. substr($where,strpos($where,$thiss)+strlen($thiss)); }

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.70.0110.00416.63
8.3.60.0120.00318.43
8.3.50.0070.00718.02
8.3.40.0150.00618.45
8.3.30.0040.01118.67
8.3.20.0040.00421.77
8.3.10.0080.00020.48
8.3.00.0040.00419.50
8.2.180.0090.00618.29
8.2.170.0110.00422.96
8.2.160.0100.00719.49
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0030.00621.12
8.2.110.0070.00321.04
8.2.100.0110.00017.78
8.2.90.0080.00020.50
8.2.80.0000.00820.41
8.2.70.0070.00018.05
8.2.60.0080.00018.16
8.2.50.0000.00818.10
8.2.40.0030.00519.30
8.2.30.0000.00719.31
8.2.20.0040.00418.17
8.2.10.0020.00519.29
8.2.00.0000.00718.01
8.1.280.0170.00325.92
8.1.270.0060.00320.40
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0130.00322.13
8.1.230.0040.00720.89
8.1.220.0080.00017.79
8.1.210.0080.00019.03
8.1.200.0060.00317.35
8.1.190.0060.00317.25
8.1.180.0050.00318.10
8.1.170.0040.00418.70
8.1.160.0040.00418.78
8.1.150.0080.00018.88
8.1.140.0050.00318.90
8.1.130.0000.00720.18
8.1.120.0030.00617.43
8.1.110.0080.00017.35
8.1.100.0040.00317.37
8.1.90.0050.00317.37
8.1.80.0030.00617.42
8.1.70.0060.00317.48
8.1.60.0040.00417.49
8.1.50.0040.00417.58
8.1.40.0040.00417.53
8.1.30.0040.00417.49
8.1.20.0030.00517.68
8.1.10.0000.00717.50
8.1.00.0040.00417.50
8.0.300.0030.00620.06
8.0.290.0070.00016.75
8.0.280.0000.00718.52
8.0.270.0000.00716.81
8.0.260.0050.00218.39
8.0.250.0070.00016.98
8.0.240.0000.00716.99
8.0.230.0030.00316.99
8.0.220.0000.00717.02
8.0.210.0000.00716.84
8.0.200.0030.00316.99
8.0.190.0070.00017.04
8.0.180.0000.00716.86
8.0.170.0030.00617.03
8.0.160.0000.00716.99
8.0.150.0070.00016.91
8.0.140.0030.00316.93
8.0.130.0000.00713.36
8.0.120.0040.00416.95
8.0.110.0040.00416.93
8.0.100.0040.00416.93
8.0.90.0040.00417.01
8.0.80.0060.00917.01
8.0.70.0020.00516.96
8.0.60.0000.00716.92
8.0.50.0040.00416.78
8.0.30.0130.00617.11
8.0.20.0100.01017.21
8.0.10.0030.00316.98
8.0.00.0110.01116.90
7.4.330.0030.00315.55
7.4.320.0000.00716.62
7.4.300.0040.00416.50
7.4.290.0000.00616.58
7.4.280.0040.00416.55
7.4.270.0040.00416.59
7.4.260.0030.00316.43
7.4.250.0030.00316.46
7.4.240.0000.00716.53
7.4.230.0000.00816.50
7.4.220.0030.00616.60
7.4.210.0110.00616.63
7.4.200.0040.00416.68
7.4.160.0090.00716.48
7.4.140.0140.00817.86
7.4.130.0160.00316.57
7.4.120.0130.00816.64
7.4.110.0130.00916.63
7.4.100.0070.01716.54
7.4.90.0100.00616.42
7.4.80.0040.01819.39
7.4.70.0040.02016.71
7.4.60.0150.00616.38
7.4.50.0110.00016.35
7.4.40.0150.00916.48
7.4.10.0120.00616.73
7.4.00.0030.01115.85
7.3.330.0050.00013.20
7.3.320.0030.00313.33
7.3.310.0000.00716.43
7.3.300.0030.00316.38
7.3.290.0000.00716.43
7.3.280.0090.00916.39
7.3.260.0090.01016.43
7.3.240.0110.00816.53
7.3.230.0140.00316.59
7.3.210.0130.00316.29
7.3.200.0100.00716.58
7.3.190.0060.01016.39
7.3.180.0110.01016.45
7.3.170.0090.01416.37
7.3.160.0030.01416.64
7.3.130.0060.00616.53
7.3.120.0050.00916.50
7.3.110.0040.01116.45
7.3.100.0030.00716.49
7.3.90.0030.01616.38
7.3.80.0030.00716.32
7.3.70.0120.00616.40
7.3.60.0000.01616.41
7.3.50.0070.01016.24
7.3.40.0060.00916.41
7.3.30.0130.00016.33
7.3.20.0380.00916.67
7.3.10.0520.00816.43
7.3.00.0390.00516.47
7.2.330.0030.01516.74
7.2.320.0100.00716.76
7.2.310.0040.01116.72
7.2.300.0120.00616.79
7.2.290.0060.01316.48
7.2.260.0130.00616.55
7.2.250.0100.01016.34
7.2.240.0090.00616.47
7.2.230.0000.01516.74
7.2.220.0070.01116.73
7.2.210.0070.00716.76
7.2.200.0030.01016.45
7.2.190.0000.01716.43
7.2.180.0090.00316.32
7.2.170.0100.00316.50
7.2.160.0080.00816.32
7.2.150.0430.00816.58
7.2.140.0350.00816.58
7.2.130.0450.00816.68
7.2.120.0360.00616.52
7.2.110.0480.01016.71
7.2.100.0670.00916.66
7.2.90.0620.01016.58
7.2.80.0470.00816.55
7.2.70.0480.00816.56
7.2.60.0580.00816.68
7.2.50.0400.00716.79
7.2.40.0460.00316.63
7.2.30.0410.00716.59
7.2.20.0430.00716.71
7.2.10.0400.01116.72
7.2.00.0640.00616.67
7.1.330.0030.01017.41
7.1.320.0110.00417.34
7.1.310.0100.00317.45
7.1.300.0000.01617.36
7.1.290.0000.01617.15
7.1.280.0070.01117.50
7.1.270.0060.00917.29
7.1.260.0030.00617.24
7.1.250.0490.00915.54
7.1.240.0000.01417.27
7.1.230.0060.00617.32
7.1.220.0090.00617.43
7.1.210.0030.01417.20
7.1.200.0080.00317.33
7.1.190.0090.00617.44
7.1.180.0040.01117.16
7.1.170.0070.00717.45
7.1.160.0070.01117.32
7.1.150.0030.01617.48
7.1.140.0040.01217.25
7.1.130.0090.00617.37
7.1.120.0060.01217.27
7.1.110.0060.00917.34
7.1.100.0090.00617.32
7.1.90.0040.01117.28
7.1.80.0070.00717.22
7.1.70.0050.00717.24
7.1.60.0030.00617.30
7.1.50.0000.01317.43
7.1.40.0110.00417.47
7.1.30.0030.01317.32
7.1.20.0060.00617.13
7.1.10.0040.01217.31
7.1.00.0040.01217.29

preferences:
57.74 ms | 401 KiB | 5 Q