3v4l.org

run code in 300+ PHP versions simultaneously
<?php $Code ='Q) A. We were watching television last night. B. We was watching television last night. A) a) A b) B Q) Four words are given below out of which three words have similar meaning. Find the odd word which has a different meaning. E.g.: A) a) speak b) discuss c) converse d) comprehend '; function explodeX($delimiters,$string) { $return_array = Array($string); // The array to return $d_count = 0; while (isset($delimiters[$d_count])) // Loop to loop through all delimiters { $new_return_array = Array(); foreach($return_array as $el_to_split) // Explode all returned elements by the next delimiter { $put_in_new_return_array = explode($delimiters[$d_count],$el_to_split); foreach($put_in_new_return_array as $substr) // Put all the exploded elements in array to return { $new_return_array[] = $substr; } } $return_array = $new_return_array; // Replace the previous return array by the next version $d_count++; } return $return_array; // Return the exploded elements } $output = explodeX(Array("Q)","A)"), $Code); //Calling the function using the split parameters echo $output[1]; //echo $output[2]; $your_array = explode(") ", $output[2]); echo $your_array[1]; ?>

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.00716.75
8.3.60.0080.00816.75
8.3.50.0090.00921.17
8.3.40.0040.01818.82
8.3.30.0000.01418.67
8.3.20.0050.00318.73
8.3.10.0070.00021.71
8.3.00.0050.00318.05
8.2.180.0120.00916.32
8.2.170.0070.00722.96
8.2.160.0040.01121.07
8.2.150.0050.00324.18
8.2.140.0050.00224.66
8.2.130.0000.00826.16
8.2.120.0100.00321.01
8.2.110.0090.00020.38
8.2.100.0080.00417.91
8.2.90.0080.00019.17
8.2.80.0050.00317.97
8.2.70.0000.00817.38
8.2.60.0040.00418.05
8.2.50.0080.00018.07
8.2.40.0030.00620.01
8.2.30.0000.00818.01
8.2.20.0020.00517.76
8.2.10.0030.00518.14
8.2.00.0000.00718.15
8.1.280.0070.01125.92
8.1.270.0080.00023.76
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0060.00323.91
8.1.230.0110.00022.59
8.1.220.0000.00817.74
8.1.210.0090.00018.77
8.1.200.0090.00017.23
8.1.190.0040.00417.38
8.1.180.0070.00018.10
8.1.170.0080.00018.55
8.1.160.0040.00421.96
8.1.150.0040.00418.88
8.1.140.0070.00419.46
8.1.130.0040.00417.78
8.1.120.0000.00717.41
8.1.110.0080.00017.47
8.1.100.0020.00517.51
8.1.90.0040.00417.50
8.1.80.0030.00517.52
8.1.70.0030.00317.40
8.1.60.0000.00817.66
8.1.50.0060.00617.51
8.1.40.0050.00317.44
8.1.30.0090.00017.56
8.1.20.0000.00817.64
8.1.10.0040.00417.46
8.1.00.0030.00617.52
8.0.300.0070.00018.77
8.0.290.0070.00016.75
8.0.280.0030.00318.37
8.0.270.0000.00717.27
8.0.260.0000.00817.36
8.0.250.0060.00016.95
8.0.240.0000.00817.01
8.0.230.0050.00316.90
8.0.220.0000.00716.82
8.0.210.0000.00716.92
8.0.200.0070.00016.93
8.0.190.0110.00016.96
8.0.180.0040.00416.97
8.0.170.0040.00416.93
8.0.160.0030.00516.95
8.0.150.0020.00516.84
8.0.140.0000.00716.79
8.0.130.0000.00813.37
8.0.120.0000.00716.89
8.0.110.0000.00716.80
8.0.100.0070.00016.80
8.0.90.0000.00716.97
8.0.80.0100.00716.95
8.0.70.0040.00416.91
8.0.60.0030.00516.95
8.0.50.0000.00716.87
8.0.30.0060.01117.15
8.0.20.0120.00817.40
8.0.10.0000.00717.06
8.0.00.0030.01616.69
7.4.330.0000.00515.08
7.4.320.0000.00616.51
7.4.300.0030.00316.57
7.4.290.0040.00416.50
7.4.280.0070.00316.41
7.4.270.0040.00416.53
7.4.260.0100.00016.64
7.4.250.0000.00716.50
7.4.240.0030.00316.61
7.4.230.0070.00016.26
7.4.220.0100.01416.55
7.4.210.0060.00916.63
7.4.200.0030.00316.72
7.4.160.0080.00816.74
7.4.150.0120.00617.40
7.4.140.0130.00417.86
7.4.130.0140.00416.54
7.4.120.0110.00816.56
7.4.110.0100.01316.59
7.4.100.0070.01716.54
7.4.90.0070.01016.57
7.4.80.0090.01419.39
7.4.70.0070.01016.40
7.4.60.0050.01116.59
7.4.50.0060.01016.48
7.4.40.0150.00616.43
7.4.30.0040.01216.38
7.4.00.0070.01015.16
7.3.330.0030.00313.45
7.3.320.0030.00313.41
7.3.310.0070.00016.43
7.3.300.0030.00316.43
7.3.290.0070.01216.39
7.3.280.0050.01116.38
7.3.270.0080.00817.40
7.3.260.0180.00416.35
7.3.250.0110.01116.52
7.3.240.0060.01016.56
7.3.230.0130.00316.63
7.3.210.0130.00316.54
7.3.200.0110.00719.39
7.3.190.0100.00716.52
7.3.180.0100.01316.46
7.3.170.0170.00316.56
7.3.160.0090.00616.56
7.3.00.0090.00616.68
7.2.330.0070.01116.81
7.2.320.0130.00316.73
7.2.310.0120.00916.72
7.2.300.0140.00816.80
7.2.290.0110.00516.73
7.2.130.0030.01116.87
7.2.120.0090.00617.04
7.2.110.0090.00916.66
7.2.100.0030.00916.92
7.2.90.0070.01017.14
7.2.80.0070.00917.12
7.2.70.0090.00616.96
7.2.60.0100.00516.77
7.2.50.0120.00616.77
7.2.40.0030.01416.49
7.2.30.0070.00416.81
7.2.20.0160.00517.06
7.2.10.0090.00216.79
7.2.00.0040.00918.21
7.1.250.0000.01415.75
7.1.240.0060.00915.62
7.1.230.0000.01515.84
7.1.220.0070.01115.61
7.1.210.0060.01215.74
7.1.200.0040.01315.87
7.1.190.0030.00915.88
7.1.180.0080.01115.81
7.1.170.0030.01015.77
7.1.160.0100.00015.67
7.1.150.0000.01215.85
7.1.140.0050.00315.80
7.1.130.0100.00315.58
7.1.120.0060.00615.71
7.1.110.0180.00015.70
7.1.100.0040.00716.82
7.1.90.0110.00615.52
7.1.80.0070.01115.79
7.1.70.0080.01016.36
7.1.60.0050.01417.67
7.1.50.0060.00915.52
7.1.40.0110.00715.86
7.1.30.0000.01715.75
7.1.20.0050.00915.37
7.1.10.0060.00615.54
7.1.00.0050.04319.07
7.0.330.0080.01215.00
7.0.320.0040.01115.26
7.0.310.0100.00715.37
7.0.300.0060.00915.38
7.0.290.0030.01215.34
7.0.280.0090.00915.29
7.0.270.0090.00315.26
7.0.260.0030.01215.29
7.0.250.0070.01014.91
7.0.240.0080.00815.02
7.0.230.0070.00715.18
7.0.220.0040.01115.43
7.0.210.0080.00215.35
7.0.200.0040.00815.91
7.0.190.0090.00915.42
7.0.180.0000.01115.21
7.0.170.0070.01015.43
7.0.160.0110.00615.31
7.0.150.0110.00315.52
7.0.140.0070.00415.36
7.0.130.0090.00614.88
7.0.120.0070.01015.36
7.0.110.0000.01215.14
7.0.100.0120.00315.38
7.0.90.0120.00315.13
7.0.80.0080.00315.36
7.0.70.0120.00315.05
7.0.60.0030.04318.61
7.0.50.0190.03217.78
7.0.40.0150.03116.92
7.0.30.0080.04316.87
7.0.20.0170.03416.88
7.0.10.0130.03716.89
7.0.00.0050.03716.88
5.6.380.0040.01114.19
5.6.370.0060.01214.38
5.6.360.0000.01414.29
5.6.350.0060.00614.05
5.6.340.0040.00814.01
5.6.330.0060.00613.92
5.6.320.0090.00514.22
5.6.310.0060.00914.25
5.6.300.0040.00914.00
5.6.290.0060.00613.84
5.6.280.0050.04017.89
5.6.270.0070.01114.35
5.6.260.0030.01014.57
5.6.250.0080.00814.20
5.6.240.0100.00714.00
5.6.230.0050.00814.29
5.6.220.0070.00314.17
5.6.210.0060.04917.21
5.6.200.0220.02817.69
5.6.190.0110.03017.60
5.6.180.0110.03117.76
5.6.170.0090.03917.81
5.6.160.0130.03317.69
5.6.150.0230.02817.82
5.6.140.0250.03517.71
5.6.130.0150.03417.59
5.6.120.0150.03217.62
5.6.110.0220.02817.64
5.6.100.0170.03217.87
5.6.90.0180.03117.86
5.6.80.0190.02917.30
5.6.70.0190.03017.49
5.6.60.0210.02917.28
5.6.50.0130.02817.37
5.6.40.0140.03217.29
5.6.30.0180.03217.25
5.6.20.0170.03117.28
5.6.10.0200.02717.44
5.6.00.0120.03517.28
5.5.380.0000.00911.18
5.5.370.0060.00311.18
5.5.360.0040.00411.18
5.5.350.0150.04115.85
5.5.340.0150.02816.04
5.5.330.0140.02916.03
5.5.320.0090.02916.03
5.5.310.0210.02516.12
5.5.300.0160.03116.03
5.5.290.0140.03416.02
5.5.280.0080.03716.02
5.5.270.0220.03016.02
5.5.260.0120.02915.93
5.5.250.0180.03015.93
5.5.240.0120.04115.66
5.5.230.0180.02715.69
5.5.220.0170.03115.71
5.5.210.0030.03815.65
5.5.200.0100.03115.66
5.5.190.0180.02815.68
5.5.180.0150.03415.68
5.5.170.0000.00811.18
5.5.160.0130.03515.71
5.5.150.0200.02315.78
5.5.140.0130.03315.73
5.5.130.0150.02815.70
5.5.120.0180.02815.61
5.5.110.0180.03415.66
5.5.100.0100.03315.64
5.5.90.0110.03015.63
5.5.80.0120.02715.81
5.5.70.0100.03315.73
5.5.60.0150.03015.61
5.5.50.0150.02815.59
5.5.40.0200.02815.68
5.5.30.0190.02515.72
5.5.20.0170.03015.62
5.5.10.0180.02515.57
5.5.00.0130.03315.67

preferences:
63.9 ms | 401 KiB | 5 Q