3v4l.org

run code in 300+ PHP versions simultaneously
<?php $yearMonth = '2017-06'; $firstDayOfThisMonth = new \DateTime($yearMonth . '-01'); var_dump($firstDayOfThisMonth->format('W')); $lastDayOfThisMonth = clone $firstDayOfThisMonth; $lastDayOfThisMonth = $lastDayOfThisMonth->modify('last day of this month'); var_dump($lastDayOfThisMonth->format('W')); $startDate = new \DateTime($firstDayOfThisMonth->format('Y') . 'W' . $firstDayOfThisMonth->format('W')); $endDate = new \DateTime($lastDayOfThisMonth->format('Y') . 'W' . $lastDayOfThisMonth->format('W')); $endDate->modify('+6 days 23:59:59'); var_dump($startDate); var_dump($endDate); $startDate = new \DateTime($yearMonth . '-01'); $endDate = clone $startDate; $endDate->modify('last day of this month') $startDate->modify('monday this week'); $endDate->modify('sunday this week'); var_dump($startDate); var_dump($endDate);

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.1.70.0110.00317.09
7.1.60.0140.01434.96
7.1.50.0190.01334.40
7.1.40.0140.01434.31
7.1.30.0140.01434.39
7.1.20.0250.00334.50
7.1.10.0000.01516.39
7.1.00.0060.01216.18
7.0.200.0060.01116.68
7.0.190.0060.00916.48
7.0.180.0030.00916.13
7.0.170.0030.01015.96
7.0.160.0030.01016.00
7.0.150.0040.01116.11
7.0.140.0040.01116.10
7.0.130.0030.01616.38
7.0.120.0070.00716.39
7.0.110.0060.00916.05
7.0.100.0030.01216.16
7.0.90.0040.01116.07
7.0.80.0030.01016.06
7.0.70.0120.00616.18
7.0.60.0060.00915.96
7.0.50.0100.00716.16
7.0.40.0120.00416.54
7.0.30.0100.01016.08
7.0.20.0070.00716.42
7.0.10.0030.01116.02
7.0.00.0140.00016.42

preferences:
141.99 ms | 1398 KiB | 7 Q