3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dumpMappedRow($mappedRow) { var_dump([ 'created' => $mappedRow['created']->format(DateTime::ISO8601), 'modified' => $mappedRow['modified']->format(DateTime::ISO8601) ]); } function mutableDemo() { $date = DateTime::createFromFormat("Y-m-d", "2015-11-24"); $mappedRow['created'] = $date; $mappedRow['modified'] = $date; dumpMappedRow($mappedRow); $mappedRow['modified']->setDate("2015", "11", "15"); dumpMappedRow($mappedRow); if ($mappedRow['created']->getTimestamp() === $mappedRow['modified']->getTimestamp()) { echo "\nCreated and Modified are set to the same value."; } } function immutableDemo() { $date = DateTimeImmutable::createFromFormat("Y-m-d", "2015-11-24"); $mappedRow['created'] = $date; $mappedRow['modified'] = $date; dumpMappedRow($mappedRow); // This actually returns a new object rather than modifying the existing one. $mappedRow['modified'] = $mappedRow['modified']->setDate("2015", "11", "15"); dumpMappedRow($mappedRow); if ($mappedRow['created']->getTimestamp() === $mappedRow['modified']->getTimestamp()) { echo "\nCreated and Modified are set to the same value."; } } mutableDemo(); echo "\n\n==========\n\n"; immutableDemo();

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.50
8.3.50.0100.00616.49
8.3.40.0110.01119.09
8.3.30.0130.01018.95
8.3.20.0070.00020.35
8.3.10.0040.01421.77
8.3.00.0000.00819.81
8.2.180.0090.00616.63
8.2.170.0130.01022.96
8.2.160.0110.01120.32
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0080.00017.63
8.2.110.0060.00322.11
8.2.100.0070.00417.75
8.2.90.0000.00919.17
8.2.80.0000.00817.97
8.2.70.0040.00417.88
8.2.60.0000.00818.05
8.2.50.0030.00618.07
8.2.40.0080.00019.52
8.2.30.0040.00418.05
8.2.20.0050.00317.96
8.2.10.0040.00418.21
8.2.00.0070.00018.16
8.1.280.0170.00025.92
8.1.270.0050.00520.20
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0040.00722.51
8.1.230.0000.01317.61
8.1.220.0080.00017.74
8.1.210.0000.00918.77
8.1.200.0030.00717.48
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0060.00318.49
8.1.160.0000.00722.04
8.1.150.0040.00418.87
8.1.140.0050.00317.54
8.1.130.0040.00417.69
8.1.120.0000.00717.56
8.1.110.0030.00517.52
8.1.100.0040.00417.58
8.1.90.0040.00417.55
8.1.80.0000.00717.49
8.1.70.0000.00717.42
8.1.60.0040.00417.59
8.1.50.0040.00417.49
8.1.40.0000.00817.63
8.1.30.0000.00917.69
8.1.20.0040.00417.79
8.1.10.0000.00817.62
8.1.00.0030.00617.67
8.0.300.0070.00318.77
8.0.290.0060.00316.75
8.0.280.0030.00318.44
8.0.270.0020.00517.25
8.0.260.0040.00417.29
8.0.250.0000.00716.98
8.0.240.0000.00716.97
8.0.230.0070.00017.10
8.0.220.0000.00817.04
8.0.210.0050.00317.06
8.0.200.0000.00617.02
8.0.190.0050.00217.03
8.0.180.0070.00017.08
8.0.170.0040.00417.04
8.0.160.0000.00817.09
8.0.150.0030.00316.91
8.0.140.0000.00716.91
8.0.130.0070.00013.36
8.0.120.0050.00317.04
8.0.110.0080.00017.06
8.0.100.0040.00417.04
8.0.90.0070.00017.01
8.0.80.0070.01017.08
8.0.70.0030.00516.92
8.0.60.0050.00216.98
8.0.50.0000.00817.07
8.0.30.0050.01317.21
8.0.20.0100.00917.42
8.0.10.0000.00717.20
8.0.00.0080.00916.86
7.4.330.0060.00015.08
7.4.320.0070.00016.59
7.4.300.0070.00016.52
7.4.290.0050.00316.46
7.4.280.0000.00716.59
7.4.270.0070.00016.55
7.4.260.0030.00316.66
7.4.250.0050.00316.65
7.4.240.0020.00616.62
7.4.230.0030.00316.67
7.4.220.0070.01816.58
7.4.210.0130.00616.71
7.4.200.0040.00416.76
7.4.160.0100.00716.59
7.4.150.0130.00617.40
7.4.140.0070.01217.86
7.4.130.0130.00916.67
7.4.120.0140.00716.62
7.4.110.0120.00916.66
7.4.100.0150.00416.64
7.4.90.0050.01616.66
7.4.80.0120.00619.39
7.4.70.0030.01316.76
7.4.60.0000.01616.61
7.4.50.0000.00816.78
7.4.40.0100.00716.64
7.4.30.0140.00916.79
7.4.00.0030.01215.05
7.3.330.0000.00613.46
7.3.320.0050.00013.46
7.3.310.0030.00316.31
7.3.300.0030.00316.46
7.3.290.0100.00616.42
7.3.280.0050.01316.45
7.3.270.0030.01617.40
7.3.260.0150.00316.64
7.3.250.0070.01016.59
7.3.240.0060.01316.65
7.3.230.0120.01216.87
7.3.210.0060.01216.55
7.3.200.0040.01816.65
7.3.190.0040.01316.63
7.3.180.0100.00616.69
7.3.170.0070.01616.66
7.3.160.0110.00716.67
7.3.120.0100.00915.15
7.3.110.0090.00614.94
7.3.100.0060.01015.13
7.3.90.0010.00715.06
7.3.80.0030.01115.11
7.3.70.0060.00614.98
7.3.60.0070.00714.97
7.3.50.0020.01215.03
7.3.40.0060.00915.10
7.3.30.0030.00815.10
7.3.20.0050.00916.76
7.3.10.0020.01216.69
7.3.00.0070.00616.84
7.2.330.0030.01616.63
7.2.320.0110.00716.99
7.2.310.0060.01116.54
7.2.300.0100.00716.52
7.2.290.0060.01116.52
7.2.250.0070.01415.52
7.2.240.0100.01015.14
7.2.230.0100.00515.24
7.2.220.0070.00315.28
7.2.210.0080.00715.36
7.2.200.0000.01215.32
7.2.190.0100.00515.14
7.2.180.0010.01115.02
7.2.170.0050.00715.13
7.2.160.0070.00415.16
7.2.150.0070.01017.12
7.2.140.0030.00617.08
7.2.130.0040.00817.11
7.2.120.0030.01217.16
7.2.110.0090.00616.97
7.2.100.0050.00516.89
7.2.90.0040.01117.15
7.2.80.0060.00317.06
7.2.70.0000.01016.68
7.2.60.0080.00417.04
7.2.50.0110.00316.81
7.2.40.0060.00917.21
7.2.30.0120.00016.95
7.2.20.0000.01516.84
7.2.10.0100.00717.24
7.2.00.0030.00918.09
7.1.330.0040.01116.03
7.1.320.0050.00815.68
7.1.310.0010.01016.14
7.1.300.0040.01115.69
7.1.290.0030.01015.99
7.1.280.0060.00715.80
7.1.270.0020.01015.93
7.1.260.0090.00415.89
7.1.250.0060.00915.71
7.1.200.0090.00615.86
7.1.100.0000.01517.92
7.1.70.0000.01017.05
7.1.60.0090.01219.13
7.1.50.0250.00635.04
7.1.00.0030.07322.32
7.0.200.0050.00317.02
7.0.60.0030.05720.00
7.0.50.0100.07717.97
7.0.40.0070.08720.05
7.0.30.0270.06720.07
7.0.20.0300.08020.19
7.0.10.0100.08320.21
7.0.00.0070.07720.06
5.6.280.0100.02320.83
5.6.210.0100.07720.48
5.6.200.0030.06018.23
5.6.190.0030.04720.60
5.6.180.0230.08320.64
5.6.170.0130.04320.57
5.6.160.0130.06720.50
5.6.150.0100.08018.19
5.6.140.0030.05318.14
5.6.130.0100.05318.17
5.6.120.0030.07021.06
5.6.110.0100.07320.95
5.6.100.0030.04021.02
5.6.90.0100.08021.09
5.6.80.0200.06320.39
5.5.350.0300.07020.42
5.5.340.0070.04018.02
5.5.330.0070.07020.19
5.5.320.1670.06020.34
5.5.310.0170.04020.42
5.5.300.0100.06317.98
5.5.290.0030.04018.09
5.5.280.0030.06020.79
5.5.270.0070.04720.86
5.5.260.0230.07020.88
5.5.250.0130.08020.63
5.5.240.0000.03320.30
5.4.450.0670.05319.56
5.4.440.0870.05019.34
5.4.430.0600.06019.54
5.4.420.0600.05319.54
5.4.410.0500.06019.17
5.4.400.0600.05319.01
5.4.390.0600.05319.14
5.4.380.0700.05718.98
5.4.370.0570.05718.97
5.4.360.0730.06319.21
5.4.350.0570.06019.04
5.4.340.0670.04719.23
5.4.320.0670.05018.87
5.4.310.0570.05719.22
5.4.300.0630.06319.14
5.4.290.0600.05318.96
5.4.280.0630.05718.84
5.4.270.0730.04319.23
5.4.260.0700.04719.23
5.4.250.0730.04019.14
5.4.240.0600.07019.15
5.4.230.0700.05719.29
5.4.220.0670.05719.00
5.4.210.0800.04719.31
5.4.200.0800.05019.13
5.4.190.0800.05018.96
5.4.180.0570.05319.13
5.4.170.0570.05719.13
5.4.160.0530.05719.28
5.4.150.0670.06019.19
5.4.140.0800.04716.38
5.4.130.0700.05316.62
5.4.120.0670.04316.60
5.4.110.0570.05716.57
5.4.100.0770.07016.57
5.4.90.0800.04316.24
5.4.80.0700.05016.46
5.4.70.0270.06716.59
5.4.60.0330.05316.48
5.4.50.0000.04716.56
5.4.40.0200.03716.24
5.4.30.0070.05016.43
5.4.20.0400.04316.38
5.4.10.0230.04716.35

preferences:
63.47 ms | 400 KiB | 5 Q