3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."; $iLoc = strpos($string, 'I'); $mLoc = strpos($string, 'm', $iLoc); $ipsum = substr($string,$iLoc, $mLoc-$iLoc+1); // Replace all Ipsums $string = str_ireplace( $ipsum, 'String', $string); // Loop through string like an array, using the index to replace 's' values for($i = 0; $i < strlen($string); $i++){ if($string[$i] === 's' || $string[$i] === 'S' ){ $string[$i-1] = "\\"; $string[$i] = '$'; } } $string = str_replace( (stristr($string, '\\', true)), 'P_H+?P', $string); var_dump($string);

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.130.0030.00618.29
8.3.120.0100.00620.84
8.3.110.0040.00420.94
8.3.100.0080.00024.06
8.3.90.0030.00726.77
8.3.80.0030.00617.97
8.3.70.0160.00616.58
8.3.60.0110.01118.30
8.3.50.0090.00816.39
8.3.40.0140.00418.69
8.3.30.0180.00318.71
8.3.20.0070.00021.79
8.3.10.0050.00319.15
8.3.00.0050.00221.85
8.2.250.0050.00316.89
8.2.240.0080.00017.36
8.2.230.0030.00622.58
8.2.220.0090.00037.54
8.2.210.0090.00926.77
8.2.200.0090.00016.50
8.2.190.0120.00316.58
8.2.180.0180.00025.92
8.2.170.0040.01122.96
8.2.160.0140.00022.08
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0130.00326.16
8.2.120.0040.00419.95
8.2.110.0030.00719.39
8.2.100.0110.00417.97
8.2.90.0000.00818.12
8.2.80.0040.00418.91
8.2.70.0000.00817.63
8.2.60.0090.00517.43
8.2.50.0040.00417.63
8.2.40.0000.00719.38
8.2.30.0000.00820.34
8.2.20.0000.01018.12
8.2.10.0040.00418.93
8.2.00.0040.00418.11
8.1.300.0000.00818.58
8.1.290.0060.00330.84
8.1.280.0090.00625.92
8.1.270.0080.00022.05
8.1.260.0000.00826.35
8.1.250.0090.00028.09
8.1.240.0090.00022.20
8.1.230.0080.00420.96
8.1.220.0060.00317.77
8.1.210.0030.00518.77
8.1.200.0100.00017.25
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0030.00618.60
8.1.160.0070.00018.88
8.1.150.0040.00418.79
8.1.140.0060.00320.19
8.1.130.0000.00819.13
8.1.120.0040.00717.46
8.1.110.0040.00417.41
8.1.100.0000.01017.48
8.1.90.0040.00717.35
8.1.80.0000.00717.43
8.1.70.0100.00017.49
8.1.60.0090.00017.49
8.1.50.0000.00717.53
8.1.40.0040.00417.45
8.1.30.0070.00017.47
8.1.20.0050.00317.62
8.1.10.0050.00217.58
8.1.00.0000.00717.54
8.0.300.0040.00420.16
8.0.290.0020.00516.75
8.0.280.0040.00418.43
8.0.270.0040.00416.79
8.0.260.0050.00316.80
8.0.250.0000.00716.95
8.0.240.0040.00416.89
8.0.230.0000.00716.87
8.0.220.0030.00316.94
8.0.210.0030.00316.76
8.0.200.0030.00316.95
8.0.190.0000.00816.91
8.0.180.0000.00816.94
8.0.170.0030.00616.90
8.0.160.0000.00716.84
8.0.150.0040.00416.75
8.0.140.0040.00416.85
8.0.130.0030.00313.27
8.0.120.0000.00816.84
8.0.110.0040.00416.93
8.0.100.0030.00516.99
8.0.90.0080.00016.76
8.0.80.0060.00816.87
8.0.70.0060.00316.77
8.0.60.0000.00716.78
8.0.50.0070.00016.94
8.0.30.0110.00917.13
8.0.20.0110.01117.23
8.0.10.0000.00716.84
8.0.00.0090.01016.64
7.4.330.0000.00515.55
7.4.320.0080.00016.39
7.4.300.0060.00016.48
7.4.290.0050.00216.59
7.4.280.0000.00816.57
7.4.270.0020.00816.46
7.4.260.0040.00416.54
7.4.250.0000.00816.55
7.4.240.0040.00416.35
7.4.230.0000.00716.70
7.4.220.0040.00416.60
7.4.210.0080.00816.61
7.4.200.0030.00316.62
7.4.160.0120.00616.52
7.4.140.0080.01617.86
7.4.130.0060.01216.54
7.4.120.0150.00416.64
7.4.110.0030.01316.50
7.4.100.0110.00716.61
7.4.90.0140.00916.46
7.4.80.0100.01019.39
7.4.70.0070.01716.62
7.4.60.0100.01016.43
7.4.50.0080.00816.32
7.4.40.0140.00916.73
7.4.00.0070.00715.16
7.3.330.0060.00013.20
7.3.320.0000.00513.25
7.3.310.0000.00716.33
7.3.300.0070.00016.37
7.3.290.0000.01516.43
7.3.280.0050.01516.32
7.3.260.0100.00916.45
7.3.240.0080.00916.40
7.3.230.0170.00716.43
7.3.210.0130.00916.43
7.3.200.0050.01316.55
7.3.190.0120.00916.59
7.3.180.0130.00316.32
7.3.170.0120.01116.22
7.3.160.0040.01216.43
7.3.50.0150.00714.56
7.3.40.0060.00614.98
7.3.30.0110.00014.63
7.3.20.0070.01016.50
7.3.10.0180.00316.55
7.3.00.0130.01016.78
7.2.330.0060.01216.77
7.2.320.0070.01016.52
7.2.310.0070.00716.78
7.2.300.0040.01216.47
7.2.290.0120.00916.47
7.2.180.0000.01315.17
7.2.170.0100.00315.14
7.2.160.0170.00615.18
7.2.150.0030.00916.82
7.2.140.0030.01216.96
7.2.130.0040.00816.91
7.2.120.0090.01217.07
7.2.110.0060.01616.83
7.2.100.0100.01216.98
7.2.90.0060.01316.95
7.2.80.0000.01516.80
7.2.70.0070.01416.86
7.2.60.0130.00917.03
7.2.50.0180.00617.04
7.2.40.0090.01316.55
7.2.30.0060.00616.79
7.2.20.0090.00316.74
7.2.10.0180.00316.93
7.2.00.0130.00716.64
7.1.280.0080.00315.96
7.1.270.0150.01215.82
7.1.260.0100.01015.74
7.1.250.0090.01315.83

preferences:
29.64 ms | 403 KiB | 5 Q