3v4l.org

run code in 300+ PHP versions simultaneously
<?php // $str = file_get_contents("text.txt"); $str = "1. Abuja, the Federal Capital Territory has -- -- -- -- -- area Council A. 4 B. 6 C. 7 D. 2 ANSWER: B 2. The Federal Capital Territory is associated with-- -- -- -- -- -- -- vegetation belt A. Sahel savanna B. Rainforest C. Guinea savanna D. Sudan savanna ANSWER: C 3. The most significant factor responsible for the ever increasing population of FCT is A. High birth rate B. Immigration C. Death rate D. CENSUS ANSWER: B"; $arr = explode("\n", $str); $res=[]; Foreach($arr as $line){ If($line != ""){ If(is_numeric($line[0])){ $res[$line[0]] =["QUESTION" =>explode(" ", $line,2)[1]]; $q = $line[0]; }Else if(ctype_alpha($line[0]) && $line[1] == "."){ $res[$q]["OPTIONS"][$line[0]] = explode(" ", $line, 2)[1]; }Else{ $res[$q]["ANSWER"] = explode(" ", $line, 2)[1]; } } } Var_dump($res);

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.0060.00916.75
8.3.50.0090.00916.30
8.3.40.0150.00018.83
8.3.30.0140.00018.89
8.3.20.0050.00320.21
8.3.10.0050.00323.51
8.3.00.0040.00423.56
8.2.180.0120.00318.37
8.2.170.0120.00322.96
8.2.160.0040.01120.39
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0000.00822.13
8.2.120.0040.00426.35
8.2.110.0050.00519.25
8.2.100.0030.01018.16
8.2.90.0040.00419.26
8.2.80.0050.00317.97
8.2.70.0000.00817.63
8.2.60.0030.00618.03
8.2.50.0030.00618.10
8.2.40.0000.00820.52
8.2.30.0000.00819.33
8.2.20.0080.00018.24
8.2.10.0000.00818.02
8.2.00.0040.00418.19
8.1.280.0160.00325.92
8.1.270.0030.00523.96
8.1.260.0040.00426.35
8.1.250.0030.00628.09
8.1.240.0060.00323.98
8.1.230.0060.00617.52
8.1.220.0000.00917.79
8.1.210.0030.00518.77
8.1.200.0000.01017.23
8.1.190.0030.00519.01
8.1.180.0040.00418.10
8.1.170.0040.00418.54
8.1.160.0050.00319.07
8.1.150.0050.00318.90
8.1.140.0090.00017.73
8.1.130.0040.00418.91
8.1.120.0040.00417.48
8.1.110.0050.00217.50
8.1.100.0000.00917.36
8.1.90.0040.00417.34
8.1.80.0070.00317.45
8.1.70.0040.00417.45
8.1.60.0030.00617.56
8.1.50.0070.00017.54
8.1.40.0040.00417.50
8.1.30.0040.00417.56
8.1.20.0050.00317.54
8.1.10.0030.00517.54
8.1.00.0050.00317.50
8.0.300.0060.00318.77
8.0.290.0040.00416.63
8.0.280.0000.00718.34
8.0.270.0030.00617.34
8.0.260.0030.00318.84
8.0.250.0000.00716.96
8.0.240.0000.00716.96
8.0.230.0000.00716.84
8.0.220.0070.00016.87
8.0.210.0070.00016.95
8.0.200.0000.00616.94
8.0.190.0040.00417.01
8.0.180.0040.00416.91
8.0.170.0030.00516.92
8.0.160.0000.00717.03
8.0.150.0030.00616.76
8.0.140.0060.00316.70
8.0.130.0030.00313.38
8.0.120.0000.00716.88
8.0.110.0040.00416.79
8.0.100.0040.00416.85
8.0.90.0030.00517.02
8.0.80.0080.00816.89
8.0.70.0000.00716.79
8.0.60.0000.00816.74
8.0.50.0040.00416.95
8.0.30.0080.01117.13
8.0.20.0120.01117.40
8.0.10.0080.00016.92
8.0.00.0120.00616.86
7.4.330.0030.00316.84
7.4.320.0030.00316.57
7.4.300.0030.00316.56
7.4.290.0040.00416.56
7.4.280.0040.00416.52
7.4.270.0030.00316.55
7.4.260.0030.00616.56
7.4.250.0070.00016.45
7.4.240.0040.00416.61
7.4.230.0000.00716.43
7.4.220.0070.02016.71
7.4.210.0070.00716.58
7.4.200.0030.00316.68
7.4.160.0130.01016.49
7.4.150.0090.00917.40
7.4.140.0140.00917.86
7.4.130.0120.01316.50
7.4.120.0120.01016.53
7.4.110.0120.00616.55
7.4.100.0140.01116.58
7.4.90.0100.00716.64
7.4.80.0070.01119.39
7.4.70.0160.00716.65
7.4.60.0100.00716.67
7.4.50.0060.00716.55
7.4.40.0070.01116.55
7.4.30.0100.00716.59
7.4.00.0070.00715.13
7.3.330.0000.00613.18
7.3.320.0060.00013.28
7.3.310.0070.00016.34
7.3.300.0040.00416.36
7.3.290.0050.00216.34
7.3.280.0090.00816.32
7.3.270.0080.01117.40
7.3.260.0100.00816.42
7.3.250.0120.00916.45
7.3.240.0110.00916.58
7.3.230.0090.00916.65
7.3.210.0160.00316.30
7.3.200.0100.00716.24
7.3.190.0060.00916.24
7.3.180.0110.00816.44
7.3.170.0040.01416.51
7.3.160.0100.00716.30
7.2.330.0040.01616.57
7.2.320.0200.00316.73
7.2.310.0100.01316.40
7.2.300.0170.00816.69
7.2.290.0140.00516.58
7.2.60.0120.00316.93
7.2.50.0040.01117.14
7.1.200.0060.00315.86
7.1.110.0040.01517.96
7.1.100.0050.00817.81
7.1.90.0060.00817.87
7.1.80.0880.01015.94
7.1.70.0250.00915.10
7.1.60.0260.00335.13
7.1.50.0350.01632.97
7.1.40.1010.01032.54
7.1.30.1060.00934.47
7.1.20.0230.00734.53
7.1.10.0060.00916.54
7.1.00.0040.01116.72
7.0.250.0030.01217.53
7.0.240.0070.00717.79
7.0.230.0130.00617.86
7.0.220.0000.01617.24
7.0.210.0250.00814.77
7.0.200.0300.01015.03
7.0.190.0450.00515.02
7.0.180.0820.01414.54
7.0.170.0060.00916.18
7.0.160.0070.01016.30
7.0.150.0080.00816.26
7.0.140.0080.00816.48
7.0.130.0070.01016.45
7.0.120.0030.01416.46
7.0.110.0050.01416.11
7.0.100.0080.00816.21
7.0.90.0040.01116.54
7.0.80.0130.00316.52
7.0.70.0030.01416.22
7.0.60.0150.00416.11
7.0.50.0070.01016.43
7.0.40.0050.01116.53
7.0.30.0050.01116.53
7.0.20.1220.01016.30
7.0.10.0060.01416.32
7.0.00.0150.00616.43

preferences:
76.38 ms | 401 KiB | 5 Q