3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '[ { "title": "This is the first title", "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "date": "2015-07-30" }, { "title": "Another article", "body": "Quisqu porttitor dignissim massa rhoncus imperdiet.", "date": "2015-08-18" }, { "title": "The Final Title", "body": "In aliquam auctor ex quis consequat. Praesent non lobortis metus.", "date": "2015-08-30" } ]'; $date = "2015-09-04"; function returnTwoWeeksPrior($jsonString, $dateString) { $decode = json_decode($jsonString); forEach($decode as $decoded) { if (strtotime($decoded->date) > strtotime("$dateString -2 weeks")){ $result = json_encode($decoded); echo $result; } } } echo returnTwoWeeksPrior($json, $date);

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.61
8.3.60.0070.01316.88
8.3.50.0170.00318.07
8.3.40.0120.00318.92
8.3.30.0000.01518.88
8.3.20.0040.00420.80
8.3.10.0080.00023.61
8.3.00.0080.00022.46
8.2.190.0110.00416.88
8.2.180.0130.00725.92
8.2.170.0070.01119.12
8.2.160.0080.00522.11
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00421.20
8.2.120.0040.00426.35
8.2.110.0090.00019.33
8.2.100.0040.00817.97
8.2.90.0080.00017.88
8.2.80.0030.00517.97
8.2.70.0000.00818.16
8.2.60.0030.00618.26
8.2.50.0040.00418.10
8.2.40.0000.00821.23
8.2.30.0050.00219.43
8.2.20.0040.00718.20
8.2.10.0040.00419.44
8.2.00.0000.00818.17
8.1.280.0220.00025.92
8.1.270.0040.00420.51
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0070.00322.73
8.1.230.0080.00319.13
8.1.220.0030.00617.78
8.1.210.0050.00318.77
8.1.200.0030.00617.38
8.1.190.0000.00817.48
8.1.180.0000.00918.10
8.1.170.0060.00318.84
8.1.160.0040.00419.02
8.1.150.0040.00418.98
8.1.140.0050.00220.38
8.1.130.0030.00320.32
8.1.120.0040.00417.76
8.1.110.0000.00917.59
8.1.100.0030.00517.77
8.1.90.0000.01017.70
8.1.80.0030.00617.59
8.1.70.0030.00717.76
8.1.60.0000.00817.61
8.1.50.0080.00017.75
8.1.40.0040.00417.67
8.1.30.0040.00417.77
8.1.20.0000.01117.85
8.1.10.0040.00417.71
8.1.00.0040.00417.70
8.0.300.0020.00519.85
8.0.290.0080.00017.00
8.0.280.0000.00718.58
8.0.270.0070.00016.99
8.0.260.0000.00620.07
8.0.250.0000.00717.14
8.0.240.0080.00017.20
8.0.230.0070.00017.23
8.0.220.0030.00317.20
8.0.210.0030.00317.12
8.0.200.0050.00217.24
8.0.190.0080.00017.24
8.0.180.0030.00517.20
8.0.170.0000.00817.19
8.0.160.0040.00417.22
8.0.150.0040.00417.09
8.0.140.0040.00417.15
8.0.130.0000.00713.46
8.0.120.0000.00717.07
8.0.110.0040.00417.01
8.0.100.0040.00417.22
8.0.90.0040.00417.04
8.0.80.0100.01017.16
8.0.70.0020.00516.95
8.0.60.0030.00517.00
8.0.50.0000.00817.10
8.0.30.0080.01217.33
8.0.20.0130.00717.57
8.0.10.0040.00417.32
8.0.00.0120.00916.95
7.4.330.0060.00015.55
7.4.320.0000.00816.73
7.4.300.0000.00716.72
7.4.290.0050.00216.81
7.4.280.0050.00316.78
7.4.270.0080.00016.82
7.4.260.0070.00016.69
7.4.250.0070.00016.57
7.4.240.0080.00016.78
7.4.230.0000.00716.83
7.4.220.0040.00416.83
7.4.210.0080.00816.73
7.4.200.0000.00716.62
7.4.160.0070.00916.66
7.4.140.0150.00817.86
7.4.130.0080.01616.74
7.4.120.0110.01016.64
7.4.110.0120.00616.60
7.4.100.0000.01716.89
7.4.90.0150.00316.59
7.4.80.0080.01219.39
7.4.70.0060.01616.76
7.4.60.0070.01016.78
7.4.50.0080.00416.41
7.4.40.0150.00616.90
7.4.00.0030.01015.16
7.3.330.0050.00013.34
7.3.320.0030.00313.46
7.3.310.0030.00316.54
7.3.300.0030.00316.47
7.3.290.0040.00416.53
7.3.280.0080.00916.44
7.3.260.0060.01316.79
7.3.240.0100.00916.63
7.3.230.0110.01116.45
7.3.210.0100.00716.82
7.3.200.0130.00316.79
7.3.190.0110.00816.82
7.3.180.0120.00916.84
7.3.170.0070.01016.73
7.3.160.0120.00916.58
7.3.30.0100.01015.12
7.3.20.1060.00314.85
7.3.10.1050.00714.93
7.3.00.0700.01014.96
7.2.330.0060.01516.95
7.2.320.0030.01316.88
7.2.310.0100.01116.77
7.2.300.0100.00716.90
7.2.290.0130.00716.74
7.2.160.0120.00315.04
7.2.150.1180.01015.26
7.2.140.0860.00315.46
7.2.130.0720.01015.14
7.2.120.1070.01315.55
7.2.110.0970.01015.25
7.2.100.0930.00715.39
7.2.90.1480.01015.56
7.2.80.1110.00715.38
7.2.70.1450.00015.27
7.2.60.1260.01315.27
7.2.50.1590.01015.25
7.2.40.1570.00715.52
7.2.30.1780.00015.25
7.2.20.1440.01015.30
7.2.10.1510.00615.34
7.2.00.1690.00315.46
7.1.270.1110.00714.23
7.1.260.0750.00714.36
7.1.250.0930.01014.09

preferences:
49.85 ms | 401 KiB | 5 Q