3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "[vc_tab [vc_tab [vc_tab [vc_tab [vc_tab [vc_tab"; $active = 3; $needle = "[vc_tab"; $replace = '[vc_tab active="true"'; if( substr_count( $string, $needle) < $active) { throw new Exception("There aren't enough needles in the string to do this replacement"); } $count = 0; $index = 0; while( $count++ < $active) { $index = strpos( $string, $needle, $index) + strlen( $needle); } $result = substr( $string, $index - strlen( $needle)) . $replace . substr( $string, $index); echo "Index: ", $index, " ", $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)
8.3.70.0070.01116.50
8.3.60.0090.01218.07
8.3.50.0140.00522.04
8.3.40.0090.00618.68
8.3.30.0070.00718.90
8.3.20.0040.00420.39
8.3.10.0070.00023.70
8.3.00.0080.00022.47
8.2.190.0160.00318.18
8.2.180.0120.00316.63
8.2.170.0070.01422.96
8.2.160.0100.00322.02
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0080.00019.23
8.2.110.0030.00620.52
8.2.100.0070.00417.78
8.2.90.0040.00419.08
8.2.80.0080.00017.97
8.2.70.0040.00417.37
8.2.60.0030.00518.03
8.2.50.0060.00318.07
8.2.40.0000.00818.16
8.2.30.0040.00418.07
8.2.20.0040.00417.55
8.2.10.0070.00017.64
8.2.00.0000.00717.81
8.1.280.0140.00725.92
8.1.270.0000.00722.20
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0050.00523.91
8.1.230.0110.00020.92
8.1.220.0000.00817.74
8.1.210.0090.00018.77
8.1.200.0060.00317.35
8.1.190.0000.00817.50
8.1.180.0030.00518.10
8.1.170.0030.00518.52
8.1.160.0030.00521.88
8.1.150.0030.00618.53
8.1.140.0070.00017.38
8.1.130.0070.00017.91
8.1.120.0000.00717.48
8.1.110.0000.00817.46
8.1.100.0040.00417.45
8.1.90.0040.00417.38
8.1.80.0000.00717.39
8.1.70.0030.00317.41
8.1.60.0030.00617.63
8.1.50.0050.00317.50
8.1.40.0030.00617.45
8.1.30.0030.00617.53
8.1.20.0040.00417.56
8.1.10.0050.00317.54
8.1.00.0070.00017.50
8.0.300.0070.00018.77
8.0.290.0050.00217.16
8.0.280.0030.00318.46
8.0.270.0030.00317.15
8.0.260.0030.00316.75
8.0.250.0000.00716.86
8.0.240.0050.00516.86
8.0.230.0000.00716.96
8.0.220.0030.00316.85
8.0.210.0030.00316.88
8.0.200.0030.00316.89
8.0.190.0040.00416.99
8.0.180.0040.00416.83
8.0.170.0000.00716.84
8.0.160.0040.00416.91
8.0.150.0030.00316.87
8.0.140.0070.00016.89
8.0.130.0050.00313.34
8.0.120.0000.00716.72
8.0.110.0040.00416.87
8.0.100.0080.00016.96
8.0.90.0000.00716.70
8.0.80.0100.01016.91
8.0.70.0040.00416.81
8.0.60.0030.00516.93
8.0.50.0050.00216.86
8.0.30.0120.00717.12
8.0.20.0050.01417.40
8.0.10.0040.00416.91
8.0.00.0100.01116.68
7.4.330.0000.00515.09
7.4.320.0000.00716.43
7.4.300.0000.00716.53
7.4.290.0070.00016.64
7.4.280.0000.00816.61
7.4.270.0050.00216.69
7.4.260.0030.00316.60
7.4.250.0050.00316.61
7.4.240.0020.00616.58
7.4.230.0000.00716.36
7.4.220.0180.01216.66
7.4.210.0080.00916.47
7.4.200.0070.00016.66
7.4.190.0040.00416.43
7.4.160.0030.01716.48
7.4.150.0140.00317.40
7.4.140.0110.01117.86
7.4.130.0110.00916.50
7.4.120.0090.01316.51
7.4.110.0100.00716.30
7.4.100.0100.00716.45
7.4.90.0070.01016.51
7.4.80.0140.00416.54
7.4.70.0130.00316.57
7.4.60.0070.01016.40
7.4.50.0000.00516.45
7.4.40.0120.00422.77
7.4.30.0070.01016.72
7.4.00.0040.01115.02
7.3.330.0060.00013.25
7.3.320.0030.00313.20
7.3.310.0040.00416.31
7.3.300.0060.00016.45
7.3.290.0070.00716.38
7.3.280.0130.00516.38
7.3.270.0030.01417.40
7.3.260.0060.01216.33
7.3.250.0090.00816.32
7.3.240.0060.00916.55
7.3.230.0130.00316.45
7.3.210.0110.00616.47
7.3.200.0060.01419.39
7.3.190.0070.01116.61
7.3.180.0110.00516.43
7.3.170.0030.01316.42
7.3.160.0130.00316.49
7.3.120.0100.00614.53
7.3.110.0100.00714.79
7.3.100.0100.00015.11
7.3.90.0000.01414.98
7.3.80.0090.00614.84
7.3.70.0000.01514.82
7.3.60.0060.00614.63
7.3.50.0100.00614.72
7.3.40.0070.00315.02
7.3.30.0070.00714.88
7.3.20.0060.00316.77
7.3.10.0060.00516.50
7.3.00.0020.00916.42
7.2.330.0110.00616.51
7.2.320.0100.01316.82
7.2.310.0060.01216.42
7.2.300.0160.00716.80
7.2.290.0000.01616.54
7.2.240.0040.01115.08
7.2.230.0030.01214.94
7.2.220.0030.00615.20
7.2.210.0130.00014.95
7.2.200.0070.00715.14
7.2.190.0090.00615.03
7.2.180.0090.00315.09
7.2.170.0070.01015.08
7.2.160.0040.00914.98
7.2.150.0000.01817.07
7.2.140.0030.01016.68
7.2.130.0100.00516.87
7.2.120.0050.01116.66
7.2.110.0040.00916.97
7.2.100.0090.00316.75
7.2.90.0030.01116.73
7.2.80.0070.00716.79
7.2.70.0090.00616.92
7.2.60.0040.00916.89
7.2.50.0030.01016.86
7.2.40.0100.00316.77
7.2.30.0030.01016.93
7.2.20.0050.00916.87
7.2.10.0020.00716.94
7.2.00.0080.00717.59
7.1.330.0080.00315.57
7.1.320.0060.00916.01
7.1.310.0000.01716.04
7.1.300.0100.00615.81
7.1.290.0000.01515.58
7.1.280.0030.01416.00
7.1.270.0060.00615.70
7.1.260.0040.00815.89
7.1.250.0020.00715.86
7.1.200.0060.00315.94
7.1.100.0070.01018.09
7.1.70.0060.00317.19
7.1.60.0060.01919.24
7.1.50.0000.01116.85
7.1.00.0000.07722.44
7.0.200.0100.00316.76
7.0.140.0000.07722.15
7.0.60.0170.07019.94
7.0.50.0100.07017.88
7.0.40.0100.08720.27
7.0.30.0300.04020.17
7.0.20.0370.05020.18
7.0.10.0230.08020.33
7.0.00.0100.08020.16
5.6.280.0070.07020.96
5.6.210.0100.07020.51
5.6.200.0130.07018.12
5.6.190.0070.04320.46
5.6.180.0070.04720.39
5.6.170.0500.06720.47
5.6.160.0130.07720.55
5.6.150.0070.03718.16
5.6.140.0200.06318.16
5.6.130.0030.05018.21
5.6.120.0070.08020.98
5.6.110.0130.07321.01
5.6.100.0100.08020.98
5.6.90.0100.07020.99
5.6.80.0070.03720.53
5.6.70.4130.03720.43
5.5.350.0000.09020.35
5.5.340.0030.05317.98
5.5.330.0030.04320.15
5.5.320.0070.07320.32
5.5.310.0200.03320.20
5.5.300.0070.05317.97
5.5.290.0030.05017.95
5.5.280.0070.04020.98
5.5.270.0030.06320.65
5.5.260.0070.09020.88
5.5.250.0100.06020.58
5.5.240.0070.08020.35
5.4.450.0270.04719.45
5.4.440.0900.04719.03
5.4.430.0670.04719.38
5.4.420.1000.04319.45
5.4.410.1030.03719.33
5.4.400.0470.04318.85
5.4.390.0500.05318.66
5.4.380.0300.04018.66
5.4.370.0270.05318.77
5.4.360.0130.04718.67
5.4.350.0130.06018.61
5.4.340.0170.05718.46
5.4.320.0040.03912.45
5.4.310.0060.03912.45
5.4.300.0040.03812.45
5.4.290.0030.04812.45
5.4.280.0050.03812.35
5.4.270.0090.03312.35
5.4.260.0050.03812.35
5.4.250.0040.03912.35
5.4.240.0060.03512.35
5.4.230.0050.03912.34
5.4.220.0090.04112.34
5.4.210.0050.03612.34
5.4.200.0060.04812.34
5.4.190.0080.04012.34
5.4.180.0070.03512.34
5.4.170.0140.04612.34
5.4.160.0130.04712.33
5.4.150.0150.04312.33
5.4.140.0150.04212.01
5.4.130.0220.06612.00
5.4.120.0170.03911.96
5.4.110.0160.04111.95
5.4.100.0110.04711.96
5.4.90.0150.04311.95
5.4.80.0180.03911.95
5.4.70.0200.03911.95
5.4.60.0130.04511.95
5.4.50.0140.04611.95
5.4.40.0220.09511.94
5.4.30.0190.03911.93
5.4.20.0160.04011.93
5.4.10.0150.04111.93
5.4.00.0120.04311.43
5.3.290.0060.04512.80
5.3.280.0040.03912.71
5.3.270.0130.04712.72
5.3.260.0150.04512.72
5.3.250.0140.04612.71
5.3.240.0250.06512.72
5.3.230.0210.04012.71
5.3.220.0180.04112.68
5.3.210.0140.07612.68
5.3.200.0190.04112.68
5.3.190.0190.04312.68
5.3.180.0170.04412.67
5.3.170.0190.04012.67
5.3.160.0310.06212.68
5.3.150.0170.04812.68
5.3.140.0230.04012.66
5.3.130.0180.04712.66
5.3.120.0210.04512.66
5.3.110.0280.06812.66
5.3.100.0190.04112.12
5.3.90.0140.04512.08
5.3.80.0170.04812.07
5.3.70.0160.04612.07
5.3.60.0190.04612.06
5.3.50.0190.04112.00
5.3.40.0170.04412.00
5.3.30.0160.04711.95
5.3.20.0150.04311.73
5.3.10.0290.08811.68
5.3.00.0160.04311.67
5.2.170.0100.0379.18
5.2.160.0150.0319.18
5.2.150.0150.0349.18
5.2.140.0270.0819.18
5.2.130.0120.0369.14
5.2.120.0090.0389.14
5.2.110.0130.0359.14
5.2.100.0150.0629.14
5.2.90.0110.0349.14
5.2.80.0110.0359.13
5.2.70.0130.0339.13
5.2.60.0110.0359.08
5.2.50.0130.0359.06
5.2.40.0170.0309.03
5.2.30.0100.0369.00
5.2.20.0130.0339.00
5.2.10.0150.0318.93
5.2.00.0160.0298.79
5.1.60.0110.0288.07
5.1.50.0080.0338.07
5.1.40.0110.0288.05
5.1.30.0080.0348.40
5.1.20.0120.0318.43
5.1.10.0100.0328.15
5.1.00.0090.0328.15
5.0.50.0110.0226.63
5.0.40.0110.0216.49
5.0.30.0150.0596.31
5.0.20.0090.0236.28
5.0.10.0070.0246.25
5.0.00.0080.0356.25
4.4.90.0110.0144.77
4.4.80.0080.0164.75
4.4.70.0080.0174.75
4.4.60.0070.0184.75
4.4.50.0070.0174.77
4.4.40.0030.0324.71
4.4.30.0070.0184.76
4.4.20.0080.0184.84
4.4.10.0050.0204.85
4.4.00.0090.0264.76
4.3.110.0060.0184.67
4.3.100.0060.0184.66
4.3.90.0090.0154.63
4.3.80.0060.0304.58
4.3.70.0070.0184.63
4.3.60.0090.0154.63
4.3.50.0040.0214.63
4.3.40.0070.0274.54
4.3.30.0020.0213.30
4.3.20.0070.0163.29
4.3.10.0040.0193.25
4.3.00.0130.01313.39

preferences:
45.28 ms | 401 KiB | 5 Q