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[0]; 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.60.0130.00316.75
8.3.50.0070.01221.19
8.3.40.0070.01418.80
8.3.30.0070.00718.64
8.3.20.0050.00318.73
8.3.10.0040.00421.91
8.3.00.0080.00017.93
8.2.180.0120.00916.88
8.2.170.0070.01122.96
8.2.160.0030.01020.95
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0040.00418.03
8.2.120.0000.00826.35
8.2.110.0030.00722.08
8.2.100.0060.00617.63
8.2.90.0080.00019.17
8.2.80.0080.00017.97
8.2.70.0060.00317.63
8.2.60.0040.00417.93
8.2.50.0050.00318.07
8.2.40.0000.00820.07
8.2.30.0040.00418.19
8.2.20.0000.00717.80
8.2.10.0050.00318.01
8.2.00.0000.00718.13
8.1.280.0100.01325.92
8.1.270.0090.00023.87
8.1.260.0040.00428.09
8.1.250.0050.00328.09
8.1.240.0040.00423.79
8.1.230.0040.00717.79
8.1.220.0000.00717.79
8.1.210.0050.00518.77
8.1.200.0060.00317.23
8.1.190.0030.00517.23
8.1.180.0030.00518.10
8.1.170.0000.00818.62
8.1.160.0040.00422.04
8.1.150.0040.00418.84
8.1.140.0070.00319.56
8.1.130.0070.00017.75
8.1.120.0000.00717.37
8.1.110.0070.00017.37
8.1.100.0040.00417.54
8.1.90.0030.00517.42
8.1.80.0030.00317.53
8.1.70.0000.00717.51
8.1.60.0080.00017.59
8.1.50.0040.00817.50
8.1.40.0040.00417.53
8.1.30.0030.00617.55
8.1.20.0000.00717.70
8.1.10.0080.00017.48
8.1.00.0060.00317.51
8.0.300.0040.00418.77
8.0.290.0000.00716.63
8.0.280.0030.00318.33
8.0.270.0070.00017.34
8.0.260.0030.00317.27
8.0.250.0030.00317.00
8.0.240.0070.00016.90
8.0.230.0000.00816.96
8.0.220.0000.00716.78
8.0.210.0030.00316.97
8.0.200.0030.00316.86
8.0.190.0080.00316.86
8.0.180.0030.00316.91
8.0.170.0050.00316.96
8.0.160.0030.00316.94
8.0.150.0040.00416.89
8.0.140.0070.00016.74
8.0.130.0060.00313.41
8.0.120.0080.00016.78
8.0.110.0040.00416.87
8.0.100.0000.00716.77
8.0.90.0040.00416.76
8.0.80.0030.01316.78
8.0.70.0000.00716.92
8.0.60.0040.00416.92
8.0.50.0030.00617.02
8.0.30.0130.00717.02
8.0.20.0080.01117.41
8.0.10.0000.00716.96
8.0.00.0040.01316.79
7.4.330.0050.00015.08
7.4.320.0030.00316.60
7.4.300.0000.00616.55
7.4.290.0000.00716.59
7.4.280.0030.00616.52
7.4.270.0030.00316.52
7.4.260.0070.00016.39
7.4.250.0040.00416.61
7.4.240.0070.00016.63
7.4.230.0040.00416.35
7.4.220.0070.01116.68
7.4.210.0120.00316.63
7.4.200.0070.00016.50
7.4.160.0060.00916.45
7.4.150.0100.00717.40
7.4.140.0130.00717.86
7.4.130.0110.00616.53
7.4.120.0080.01016.50
7.4.110.0100.01316.45
7.4.100.0030.01316.54
7.4.90.0120.00416.44
7.4.80.0090.00919.39
7.4.70.0130.00416.45
7.4.60.0060.00916.50
7.4.50.0070.00716.41
7.4.40.0100.00716.37
7.4.30.0090.00616.44
7.4.00.0060.01014.92
7.3.330.0030.00313.40
7.3.320.0020.00213.37
7.3.310.0000.00716.40
7.3.300.0060.00016.24
7.3.290.0070.00916.36
7.3.280.0100.00716.41
7.3.270.0130.00517.40
7.3.260.0140.00316.46
7.3.250.0100.01116.35
7.3.240.0150.00416.63
7.3.230.0100.00716.48
7.3.210.0030.01416.45
7.3.200.0110.00719.39
7.3.190.0040.01216.54
7.3.180.0150.00316.55
7.3.170.0160.00016.31
7.3.160.0120.00616.42
7.3.120.0060.01215.13
7.3.110.0060.01115.00
7.3.100.0110.00414.66
7.3.90.0070.00414.76
7.3.80.0040.01114.57
7.3.70.0030.01015.07
7.3.60.0030.00714.71
7.3.50.0100.00314.74
7.3.40.0070.01014.47
7.3.30.0040.01414.97
7.3.20.0030.00616.72
7.3.10.0070.00916.63
7.3.00.0100.00616.60
7.2.330.0070.01016.80
7.2.320.0030.01316.61
7.2.310.0190.02516.77
7.2.300.0030.01316.84
7.2.290.0070.01016.76
7.2.250.0000.01715.21
7.2.240.0000.01715.27
7.2.230.0050.00515.20
7.2.220.0030.01215.20
7.2.210.0070.00615.26
7.2.200.0090.00315.11
7.2.190.0000.00915.04
7.2.180.0030.01314.97
7.2.170.0130.00315.02
7.2.130.0100.00516.66
7.2.120.0100.00816.78
7.2.110.0100.00616.56
7.2.100.0030.01116.85
7.2.90.0090.00516.76
7.2.80.0150.00716.79
7.2.70.0100.01316.80
7.2.60.0110.00816.67
7.2.50.0050.01216.68
7.2.40.0130.00516.65
7.2.30.0120.01116.66
7.2.20.0100.01016.72
7.2.10.0130.00616.51
7.2.00.0090.00717.75
7.1.330.0090.00615.65
7.1.320.0100.00715.82
7.1.310.0030.01015.88
7.1.300.0060.00615.68
7.1.290.0060.01215.92
7.1.280.0030.01315.80
7.1.270.0040.00816.00
7.1.260.0070.00715.85
7.1.250.0080.00615.69
7.1.240.0060.00315.71
7.1.230.0060.00615.84
7.1.220.0000.00715.69
7.1.210.0120.00015.80
7.1.200.0080.00415.92
7.1.190.0000.01015.90
7.1.180.0070.00715.91
7.1.170.0040.00715.84
7.1.160.0060.00315.74
7.1.150.0060.00915.93
7.1.140.0070.00315.98
7.1.130.0070.00715.69
7.1.120.0030.01015.79
7.1.110.0100.00315.82
7.1.100.0060.00816.91
7.1.90.0030.00715.75
7.1.80.0000.01215.86
7.1.70.0030.01316.59
7.1.60.0090.00917.54
7.1.50.0030.00715.75
7.1.40.0030.00715.80
7.1.30.0040.00815.57
7.1.20.0060.00615.74
7.1.10.0070.00715.68
7.1.00.0050.04119.14
7.0.330.0000.01115.30
7.0.320.0090.00615.17
7.0.310.0070.00415.17
7.0.300.0080.00015.05
7.0.290.0000.01415.40
7.0.280.0030.00915.34
7.0.270.0040.00415.27
7.0.260.0030.00615.37
7.0.250.0040.00815.56
7.0.240.0000.01315.34
7.0.230.0030.01115.30
7.0.220.0040.00415.41
7.0.210.0000.00915.30
7.0.200.0060.00616.12
7.0.190.0060.00615.38
7.0.180.0070.00715.23
7.0.170.0080.00415.52
7.0.160.0000.01415.57
7.0.150.0030.01015.49
7.0.140.0100.00015.45
7.0.130.0030.00615.46
7.0.120.0040.00415.21
7.0.110.0030.00715.46
7.0.100.0030.00715.46
7.0.90.0030.01015.49
7.0.80.0030.00715.30
7.0.70.0060.00615.35
7.0.60.0050.03218.61
7.0.50.0160.02717.97
7.0.40.0180.03017.01
7.0.30.0270.03016.92
7.0.20.0180.03716.93
7.0.10.0220.03516.87
7.0.00.0180.03817.02
5.6.380.0070.00714.72
5.6.370.0110.00414.32
5.6.360.0030.01014.49
5.6.350.0030.01013.98
5.6.340.0040.00414.56
5.6.330.0000.01114.38
5.6.320.0040.00814.32
5.6.310.0000.00814.39
5.6.300.0060.00614.69
5.6.290.0030.00714.25
5.6.280.0080.03517.60
5.6.270.0030.01414.45
5.6.260.0040.00414.40
5.6.250.0100.00614.35
5.6.240.0060.00614.55
5.6.230.0060.00614.16
5.6.220.0040.00714.50
5.6.210.0050.03317.47
5.6.200.0130.02717.62
5.6.190.0150.03217.76
5.6.180.0180.02717.69
5.6.170.0230.04117.81
5.6.160.0140.03117.68
5.6.150.0210.02917.83
5.6.140.0170.03017.78
5.6.130.0210.04417.77
5.6.120.0160.03217.76
5.6.110.0210.02817.79
5.6.100.0200.02817.82
5.6.90.0200.03717.81
5.6.80.0260.03017.37
5.6.70.0260.02717.45
5.6.60.0240.02817.23
5.6.50.0160.02317.32
5.6.40.0130.03117.29
5.6.30.0150.02917.29
5.6.20.0250.02717.28
5.6.10.0210.03117.33
5.6.00.0200.03117.32
5.5.380.0050.00510.94
5.5.370.0040.00411.22
5.5.360.0040.00411.30
5.5.350.0170.04015.63
5.5.340.0130.03015.97
5.5.330.0170.02815.99
5.5.320.0170.02816.04
5.5.310.0150.03216.03
5.5.300.0140.03416.00
5.5.290.0180.04816.18
5.5.280.0080.03515.90
5.5.270.0230.02916.09
5.5.260.0150.03715.95
5.5.250.0220.03315.96
5.5.240.0200.03015.74
5.5.230.0250.03315.83
5.5.220.0210.02315.81
5.5.210.0120.03315.75
5.5.200.0080.03015.63
5.5.190.0250.03115.65
5.5.180.0170.03415.75
5.5.170.0030.00311.06
5.5.160.0180.03115.66
5.5.150.0180.04315.59
5.5.140.0300.03515.79
5.5.130.0120.03215.75
5.5.120.0130.03115.52
5.5.110.0150.03415.75
5.5.100.0130.02815.34
5.5.90.0200.02815.67
5.5.80.0160.03215.55
5.5.70.0150.03315.63
5.5.60.0180.02515.56
5.5.50.0100.03515.62
5.5.40.0120.03215.56
5.5.30.0100.03515.74
5.5.20.0170.03015.64
5.5.10.0120.03215.35
5.5.00.0100.03315.58

preferences:
35.49 ms | 401 KiB | 5 Q