3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$text = file_get_contents('yourfile.txt'); $text = ' 1} ABC Answer: More Words *NEXT* 1} DEF Answer: More Stuff '; //Split each question/answer by the *NEXT* separator $parts = explode('*NEXT*', $text); $result = []; foreach ($parts as $part){ //Split the question and aswer by the Answer: separator list($q, $a) = explode('Answer:', $part, 2); //Remove the #} from the question $q = preg_replace('/^\s*\d+}/', '', $q); //Trim whitespace $q = trim($q); $a = trim($a); $result[$q] = $a; } var_dump($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.5.10.0160.00216.66
8.5.00.0130.00820.15
8.4.150.0030.00014.05
8.4.140.0130.00817.73
8.4.130.0130.00918.05
8.4.120.0110.00823.96
8.4.110.0120.00718.99
8.4.100.0100.00518.87
8.4.90.0060.00320.75
8.4.80.0070.00518.83
8.4.70.0100.00618.86
8.4.60.0120.00818.89
8.4.50.0130.00718.72
8.4.40.0160.00317.86
8.4.30.0050.00517.89
8.4.20.0170.00319.86
8.4.10.0090.00020.65
8.3.280.0110.00918.73
8.3.270.0120.00716.67
8.3.260.0040.00416.83
8.3.250.0050.00316.86
8.3.240.0100.00917.29
8.3.230.0090.01218.37
8.3.220.0070.01118.97
8.3.210.0130.00518.59
8.3.200.0060.00217.01
8.3.190.0070.01217.25
8.3.180.0130.00618.89
8.3.170.0070.01116.75
8.3.160.0140.00417.09
8.3.150.0160.00317.13
8.3.140.0030.00718.85
8.3.130.0030.00518.60
8.3.120.0060.00318.89
8.3.110.0060.00620.94
8.3.100.0130.00618.64
8.3.90.0050.00318.43
8.3.80.0060.00318.56
8.3.70.0190.01016.75
8.3.60.0120.00318.41
8.3.50.0090.00818.37
8.3.40.0090.00618.96
8.3.30.0070.00718.82
8.3.20.0050.00319.15
8.3.10.0040.00421.61
8.3.00.0040.00418.04
8.2.290.0080.00120.58
8.2.280.0130.00620.38
8.2.270.0060.00316.79
8.2.260.0110.00416.75
8.2.250.0070.00416.86
8.2.240.0000.00917.34
8.2.230.0060.00322.58
8.2.220.0100.01024.06
8.2.210.0090.00926.77
8.2.200.0040.00418.41
8.2.190.0090.01216.73
8.2.180.0120.00616.63
8.2.170.0110.00422.96
8.2.160.0070.00719.29
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00419.77
8.2.120.0040.00426.35
8.2.110.0030.00720.41
8.2.100.0090.00318.03
8.2.90.0040.00419.20
8.2.80.0000.00817.97
8.2.70.0080.00017.88
8.2.60.0090.00017.80
8.2.50.0040.00418.07
8.2.40.0060.00318.35
8.2.30.0050.00318.07
8.2.20.0000.00818.22
8.2.10.0000.00818.04
8.2.00.0030.00419.52
8.1.330.0080.01022.02
8.1.320.0100.00917.95
8.1.310.0090.00916.62
8.1.300.0070.00418.56
8.1.290.0030.00618.88
8.1.280.0150.00625.92
8.1.270.0040.00422.19
8.1.260.0040.00426.35
8.1.250.0180.00428.09
8.1.240.0030.00723.84
8.1.230.0030.00721.04
8.1.220.0060.00317.79
8.1.210.0080.00018.77
8.1.200.0030.00617.47
8.1.190.0050.00317.48
8.1.180.0090.00018.10
8.1.170.0030.00518.71
8.1.160.0030.00618.84
8.1.150.0070.00018.94
8.1.140.0040.00417.78
8.1.130.0070.00018.94
8.1.120.0040.00417.52
8.1.110.0040.00417.59
8.1.100.0000.00717.63
8.1.90.0050.00517.52
8.1.80.0050.00517.55
8.1.70.0000.00717.51
8.1.60.0070.00417.80
8.1.50.0000.00717.71
8.1.40.0060.00317.58
8.1.30.0000.00817.69
8.1.20.0030.00517.71
8.1.10.0040.00417.78
8.1.00.0060.00317.68
8.0.300.0000.00718.77
8.0.290.0070.00016.75
8.0.280.0000.00818.40
8.0.270.0020.00717.20
8.0.260.0000.00717.28
8.0.250.0000.00817.02
8.0.240.0020.00517.13
8.0.230.0030.00317.10
8.0.220.0040.00417.02
8.0.210.0000.00717.12
8.0.200.0030.00317.05
8.0.190.0040.00417.00
8.0.180.0000.00717.09
8.0.170.0060.00317.09
8.0.160.0000.00717.05
8.0.150.0040.00417.04
8.0.140.0040.00417.06
8.0.130.0000.00513.56
8.0.120.0070.00017.04
8.0.110.0040.00417.10
8.0.100.0030.00517.08
8.0.90.0050.00217.02
8.0.80.0030.01716.91
8.0.70.0040.00417.12
8.0.60.0000.00817.10
8.0.50.0000.00817.06
8.0.30.0100.00917.30
8.0.20.0140.00617.48
8.0.10.0050.00217.00
8.0.00.0100.00816.90
7.4.330.0030.00315.55
7.4.320.0050.00216.79
7.4.300.0000.00616.82
7.4.290.0030.00316.80
7.4.280.0030.00616.81
7.4.270.0030.00616.66
7.4.260.0030.00316.72
7.4.250.0000.00716.84
7.4.240.0030.00716.76
7.4.230.0000.00816.58
7.4.220.0030.00616.84
7.4.210.0120.00616.83
7.4.200.0040.00416.66
7.4.160.0060.01216.74
7.4.140.0120.00817.86
7.4.130.0090.01316.86
7.4.120.0080.01116.77
7.4.110.0130.00716.76
7.4.100.0060.01016.76
7.4.90.0130.01016.86
7.4.80.0170.00019.39
7.4.70.0070.01016.82
7.4.60.0040.01216.63
7.4.50.0070.00716.64
7.4.40.0170.00616.54
7.4.00.0040.00815.17
7.3.330.0050.00013.33
7.3.320.0000.00713.23
7.3.310.0000.00816.36
7.3.300.0030.00316.49
7.3.290.0030.00316.41
7.3.280.0100.01016.58
7.3.260.0160.00316.61
7.3.240.0100.00816.59
7.3.230.0130.00516.71
7.3.210.0090.00916.40
7.3.200.0100.01016.50
7.3.190.0030.01916.43
7.3.180.0140.00516.63
7.3.170.0060.00916.37
7.3.160.0130.00616.64
7.2.330.0120.00616.75
7.2.320.0090.01316.77
7.2.310.0170.00716.87
7.2.300.0110.00616.70
7.2.290.0030.01316.79
7.2.60.0040.01216.85
7.2.40.1040.00818.11
7.2.30.0940.01118.12
7.2.20.1110.01118.23
7.2.10.0990.00518.33
7.2.00.0960.00518.20
7.1.200.0040.00415.95
7.1.160.0980.01017.18
7.1.150.1370.00716.96
7.1.140.0850.01017.17
7.1.130.0990.01017.08
7.1.120.0830.00616.79
7.1.110.0870.00716.54
7.1.100.0860.00816.11
7.1.90.0920.00916.23
7.1.80.1200.00716.26
7.1.70.1000.01215.48
7.1.60.1170.01333.63
7.1.50.1290.01133.32
7.1.40.1260.00532.95
7.1.30.1280.00832.75
7.1.20.1310.01233.00
7.1.10.1360.00814.94
7.1.00.1150.00815.03

preferences:
34.86 ms | 403 KiB | 5 Q