3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Enter your code here, enjoy! $firstDayInMonth = new DateTime("first day of this month"); $lastDayInMonth = new DateTime("last day of this month"); $currentDate = new DateTime(); $registryCollection = []; /* Better way */ $registryCollection = unserialize(""); // file_get_contents.. warning about "" // 2|1. User add in current day something: - Check if something is there ! array_key_exists! $registryCollection[$currentDate->format("d.m.Y")] = 120.0; // Test for another day; $otherDay = clone $currentDate; $otherDay->modify("-7 day"); $registryCollection[$otherDay->format("d.m.Y")] = (float)rand()%199; // Sort Array by keys ksort($registryCollection); // 1. User want to see all data stored: foreach($registryCollection as $date => $money){ echo "For date: {$date} you spent: {$money} PLN\n"; } // Sum all $sum = array_sum($registryCollection); echo "\nSUM: {$sum} PLN\n"; // We want to store data.. $data = serialize($registryCollection); // file_put_contents with content -> //print_r($data);

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)
7.3.10.0000.01516.91
7.3.00.0040.00817.03
7.2.130.0030.01416.93
7.2.120.0110.00416.91
7.2.110.0100.00616.88
7.2.100.0060.00917.02
7.2.90.0000.01717.23
7.2.80.0060.00616.93
7.2.70.0090.00617.30
7.2.60.0040.01117.02
7.2.50.0000.01016.87
7.2.40.0070.00717.22
7.2.30.0040.01117.33
7.2.20.0100.00716.99
7.2.10.0000.01416.95
7.2.00.0080.00817.20
7.1.250.0040.01115.77
7.1.240.0030.01016.12
7.1.230.0070.00715.72
7.1.220.0030.01015.99
7.1.210.0100.00315.85
7.1.200.0000.01315.89
7.1.190.0000.01316.16
7.1.180.0070.00716.00
7.1.170.0000.00816.26
7.1.160.0000.01515.89
7.1.150.0070.00715.79
7.1.140.0090.00416.11
7.1.130.0090.00915.97
7.1.120.0080.00416.09
7.1.110.0030.00515.75
7.1.100.0030.00716.13
7.1.90.0070.00416.20
7.1.80.0060.00315.97
7.1.70.0280.00515.73
7.1.60.0290.01015.94
7.1.50.0220.00815.72
7.1.40.0240.01215.62
7.1.30.0340.01115.49
7.1.20.0240.01015.43
7.1.10.0380.00815.61
7.1.00.0260.00715.67
7.0.330.0030.01015.58
7.0.320.0150.00015.54
7.0.310.0110.00315.50
7.0.300.0040.00715.25
7.0.290.0160.00015.29
7.0.280.0060.00615.57
7.0.270.0030.00615.57
7.0.260.0080.00415.54
7.0.250.0030.00615.64
7.0.240.0000.01315.55
7.0.230.0030.00615.33
7.0.220.0110.00415.22
7.0.210.0030.00915.84
7.0.200.0330.00515.46
7.0.190.0260.00515.25
7.0.180.0200.00915.12
7.0.170.0320.00515.17
7.0.160.0290.00715.09
7.0.150.0390.00515.07
7.0.140.0270.00715.10
7.0.130.0320.00315.26
7.0.120.0170.01015.31
7.0.110.0250.00915.04
7.0.100.0340.00715.01
7.0.90.1590.01115.02
7.0.80.0430.00715.21
7.0.70.0340.01014.95
7.0.60.0360.00614.86
7.0.50.0390.00415.09
7.0.40.0050.00813.90
7.0.30.0120.00313.87
7.0.20.0080.00613.88
7.0.10.0030.01114.13
7.0.00.0110.00314.09
5.6.380.0000.01614.75

preferences:
32.82 ms | 401 KiB | 5 Q