3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { const FIELD_1 = 'field1'; const FIELD_2 = 'field2'; const FIELD_A = 'fieldA'; const FIELD_B = 'fieldB'; private $field = array( self::FIELD_1 => self::FIELD_A, self::FIELD_2 => self::FIELD_B ); public function getField() { return $this->field; } } $a = new A; $str = var_export($a->getField(), true); echo '$field = ' . $str . ';';

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.00.0140.00820.09
8.4.150.0020.00014.05
8.4.140.0020.00617.65
8.4.130.0110.00917.88
8.4.120.0050.00422.53
8.4.110.0170.00318.86
8.4.100.0130.00818.80
8.4.90.0120.00820.63
8.4.80.0120.00919.37
8.4.70.0080.00317.89
8.4.60.0140.00718.71
8.4.50.0050.00417.77
8.4.40.0130.00619.40
8.4.30.0160.00317.63
8.4.20.0070.01417.55
8.4.10.0060.00317.39
8.3.280.0130.00918.39
8.3.270.0120.00716.69
8.3.260.0120.00816.27
8.3.250.0040.00518.88
8.3.240.0120.00816.77
8.3.230.0130.00716.48
8.3.220.0080.01017.25
8.3.210.0120.00916.56
8.3.200.0050.00316.52
8.3.190.0130.00616.95
8.3.180.0130.00516.40
8.3.170.0150.00317.07
8.3.160.0110.00716.45
8.3.150.0140.00417.13
8.3.140.0000.00817.20
8.3.130.0040.00418.28
8.3.120.0030.00620.89
8.3.110.0060.00320.94
8.3.100.0040.00416.61
8.3.90.0070.00726.77
8.3.80.0030.00716.50
8.3.70.0090.00616.63
8.3.60.0140.00018.53
8.3.50.0150.00521.14
8.3.40.0040.01118.42
8.3.30.0120.00318.91
8.3.20.0080.00020.29
8.3.10.0050.00320.54
8.3.00.0080.00019.38
8.2.290.0120.00620.38
8.2.280.0070.00418.64
8.2.270.0120.00919.07
8.2.260.0080.00018.63
8.2.250.0030.00618.38
8.2.240.0090.00019.01
8.2.230.0120.00322.58
8.2.220.0080.00024.06
8.2.210.0040.00426.77
8.2.200.0030.00616.75
8.2.190.0090.00916.63
8.2.180.0140.00416.63
8.2.170.0110.01122.96
8.2.160.0130.00320.53
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00421.89
8.2.110.0100.00019.13
8.2.100.0060.00617.67
8.2.90.0050.00319.05
8.2.80.0040.00417.97
8.2.70.0000.00917.75
8.2.60.0090.00018.04
8.2.50.0080.00518.07
8.2.40.0050.00318.34
8.2.30.0100.00018.17
8.2.20.0080.00017.62
8.2.10.0000.00818.12
8.2.00.0040.00417.55
8.1.330.0050.00422.04
8.1.320.0090.01116.06
8.1.310.0040.00416.66
8.1.300.0060.00316.11
8.1.290.0040.00718.88
8.1.280.0070.01325.92
8.1.270.0040.00423.96
8.1.260.0040.00426.35
8.1.250.0070.01128.09
8.1.240.0000.00922.13
8.1.230.0040.00818.91
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0080.00017.23
8.1.190.0080.00017.23
8.1.180.0050.00518.10
8.1.170.0070.00018.65
8.1.160.0070.00021.93
8.1.150.0070.00018.84
8.1.140.0050.00317.40
8.1.130.0040.00419.19
8.1.120.0000.00717.37
8.1.110.0030.00617.42
8.1.100.0000.00717.45
8.1.90.0000.00717.47
8.1.80.0040.00417.43
8.1.70.0000.00717.33
8.1.60.0040.00417.45
8.1.50.0060.00317.40
8.1.40.0050.00217.57
8.1.30.0000.00817.52
8.1.20.0040.00417.69
8.1.10.0080.00017.61
8.1.00.0050.00317.48
8.0.300.0020.00520.08
8.0.290.0030.00516.75
8.0.280.0030.00518.36
8.0.270.0030.00317.30
8.0.260.0000.00716.75
8.0.250.0030.00316.89
8.0.240.0030.00316.94
8.0.230.0030.00316.94
8.0.220.0060.00016.89
8.0.210.0040.00416.85
8.0.200.0000.00816.99
8.0.190.0040.00416.97
8.0.180.0070.00016.89
8.0.170.0050.00316.89
8.0.160.0070.00016.94
8.0.150.0070.00016.84
8.0.140.0070.00016.88
8.0.130.0000.00713.36
8.0.120.0030.00516.73
8.0.110.0000.00816.83
8.0.100.0000.00716.91
8.0.90.0040.00416.76
8.0.80.0100.01016.79
8.0.70.0020.00516.68
8.0.60.0000.00716.65
8.0.50.0050.00216.77
8.0.30.0100.00917.18
8.0.20.0120.00817.40
8.0.10.0040.00416.84
8.0.00.0070.01016.57
7.4.330.0050.00015.03
7.4.320.0030.00316.31
7.4.300.0030.00316.39
7.4.290.0070.00016.59
7.4.280.0040.00416.63
7.4.270.0020.00516.64
7.4.260.0000.00616.40
7.4.250.0060.00316.52
7.4.240.0010.00616.54
7.4.230.0030.00316.50
7.4.220.0060.01316.46
7.4.210.0070.00616.52
7.4.200.0050.00216.30
7.4.160.0040.01116.43
7.4.150.0120.00617.40
7.4.140.0100.00717.86
7.4.130.0120.00916.59
7.4.120.0120.00616.50
7.4.110.0060.01016.54
7.4.100.0080.00816.42
7.4.90.0030.01316.41
7.4.80.0060.01119.39
7.4.70.0110.00716.55
7.4.60.0110.00416.66
7.4.50.0020.00516.46
7.4.40.0060.01016.46
7.4.30.0100.01316.54
7.4.00.0070.01014.97
7.3.330.0050.00013.25
7.3.320.0050.00013.25
7.3.310.0070.00016.16
7.3.300.0000.00616.31
7.3.290.0000.01416.25
7.3.280.0080.01216.31
7.3.270.0100.00617.40
7.3.260.0120.01016.39
7.3.250.0090.00916.52
7.3.240.0170.00016.26
7.3.230.0130.00316.39
7.3.210.0060.01116.59
7.3.200.0200.00319.39
7.3.190.0090.00816.50
7.3.180.0040.01116.24
7.3.170.0100.00516.39
7.3.160.0090.00916.55
7.3.10.0040.01116.41
7.3.00.0030.00916.82
7.2.330.0030.01316.71
7.2.320.0180.00616.52
7.2.310.0060.01116.81
7.2.300.0100.01316.71
7.2.290.0180.00416.50
7.2.130.0040.00416.82
7.2.120.0100.00316.89
7.2.110.0100.00316.96
7.2.100.0000.01416.87
7.2.90.0070.00316.87
7.2.80.0030.00616.86
7.2.70.0040.00816.84
7.2.60.0060.00817.02
7.2.50.0060.00317.09
7.2.40.0070.01017.05
7.2.30.0090.00916.97
7.2.20.0090.00616.98
7.2.10.0120.00016.62
7.2.00.0060.00718.14
7.1.250.0070.00415.76
7.1.200.0030.01015.79
7.1.100.0000.01018.04
7.1.70.0030.00716.83
7.1.60.0060.01019.32
7.1.50.0130.01316.99
7.1.00.0030.07722.45
7.0.200.0040.00416.87
7.0.140.0030.07021.99
7.0.60.0070.08020.04
7.0.50.0070.08317.88
7.0.40.0030.04320.10
7.0.30.0270.06020.09
7.0.20.0230.06720.08
7.0.10.0030.07320.15
7.0.00.0070.06020.05
5.6.280.0000.07320.99
5.6.210.0100.07720.77
5.6.200.0030.09018.20
5.6.190.0030.07020.47
5.6.180.0230.05320.55
5.6.170.0230.05720.50
5.6.160.0070.07020.43
5.6.150.0070.08318.17
5.6.140.0030.07718.15
5.6.130.0030.08718.14
5.6.120.0030.08020.89
5.6.110.0070.08720.86
5.6.100.0070.03720.98
5.6.90.0070.07720.92
5.6.80.0070.08320.51
5.5.350.0200.08320.44
5.5.340.0070.08317.98
5.5.330.0100.05020.42
5.5.320.0370.07320.25
5.5.310.0230.07720.31
5.5.300.0030.06017.98
5.5.290.0100.07017.95
5.5.280.0070.08320.88
5.5.270.0100.04720.95
5.5.260.0130.07720.97
5.5.250.0070.03720.70
5.5.240.0170.08020.13
5.4.450.0670.03719.39
5.4.440.0800.05719.57
5.4.430.0900.05019.19
5.4.420.0630.00019.39
5.4.410.0670.00019.45
5.4.400.0600.00019.09
5.4.390.0630.00019.07
5.4.380.0670.00019.11
5.4.370.0630.00019.24
5.4.360.0630.00019.00
5.4.350.0630.00019.24
5.4.340.0630.00019.07
5.4.320.0020.04012.50
5.4.310.0070.03612.50
5.4.300.0060.03512.50
5.4.290.0070.03612.50
5.4.280.0050.03712.39
5.4.270.0050.03612.40
5.4.260.0110.03912.39
5.4.250.0050.03812.39
5.4.240.0050.03712.40
5.4.230.0100.03412.39
5.4.220.0080.03512.39
5.4.210.0050.03612.39
5.4.200.0100.03312.38
5.4.190.0090.03212.39
5.4.180.0060.03612.38
5.4.170.0050.04212.39
5.4.160.0070.03412.39
5.4.150.0090.03712.38
5.4.140.0130.03112.07
5.4.130.0050.03712.06
5.4.120.0050.03612.02
5.4.110.0080.03412.01
5.4.100.0060.03512.01
5.4.90.0090.03912.02
5.4.80.0070.03812.01
5.4.70.0090.03312.01
5.4.60.0080.03312.01
5.4.50.0080.03312.01
5.4.40.0050.04311.99
5.4.30.0050.03511.99
5.4.20.0030.03611.99
5.4.10.0030.03612.00
5.4.00.0040.03611.48
5.3.290.0080.03612.80
5.3.280.0070.04212.70
5.3.270.0100.03812.72
5.3.260.0070.03812.72
5.3.250.0060.03712.72
5.3.240.0070.04312.72
5.3.230.0050.03712.71
5.3.220.0050.03712.68
5.3.210.0050.03912.68
5.3.200.0060.03612.68
5.3.190.0060.03812.68
5.3.180.0080.04812.68
5.3.170.0100.03712.67
5.3.160.0050.03712.68
5.3.150.0040.03812.67
5.3.140.0100.03412.66
5.3.130.0080.03712.66
5.3.120.0050.03912.66
5.3.110.0060.03812.66
5.3.100.0060.03712.12
5.3.90.0070.03812.10
5.3.80.0050.03612.09
5.3.70.0090.04112.09
5.3.60.0080.03912.07
5.3.50.0030.03812.02
5.3.40.0040.03812.02
5.3.30.0070.03711.98
5.3.20.0040.03811.77
5.3.10.0080.03211.73
5.3.00.0030.03811.71
5.2.170.0030.0319.21
5.2.160.0050.0289.21
5.2.150.0080.0379.22
5.2.140.0060.0299.21
5.2.130.0010.0329.18
5.2.120.0040.0289.18
5.2.110.0030.0309.18
5.2.100.0060.0299.18
5.2.90.0050.0369.18
5.2.80.0080.0269.18
5.2.70.0050.0299.18
5.2.60.0040.0309.13
5.2.50.0060.0299.10
5.2.40.0050.0279.07
5.2.30.0070.0359.05
5.2.20.0050.0289.04
5.2.10.0060.0268.95
5.2.00.0030.0308.81
5.1.60.0020.0268.09
5.1.50.0050.0248.09
5.1.40.0050.0298.07
5.1.30.0070.0228.42
5.1.20.0040.0258.44
5.1.10.0010.0318.16
5.1.00.0040.0258.16
5.0.50.0030.0216.64
5.0.40.0060.0166.50
5.0.30.0030.0316.32
5.0.20.0020.0206.28
5.0.10.0050.0216.25
5.0.00.0050.0356.25
4.4.90.0040.0134.78
4.4.80.0030.0204.75
4.4.70.0020.0154.75
4.4.60.0030.0144.75
4.4.50.0040.0144.77
4.4.40.0020.0254.71
4.4.30.0020.0234.76
4.4.20.0040.0144.84
4.4.10.0050.0124.85
4.4.00.0010.0264.76
4.3.110.0020.0214.66
4.3.100.0030.0144.67
4.3.90.0030.0144.63
4.3.80.0040.0234.58
4.3.70.0020.0144.63
4.3.60.0020.0144.62
4.3.50.0010.0164.63
4.3.40.0030.0234.54
4.3.30.0020.0163.30
4.3.20.0010.0163.28
4.3.10.0020.0153.24
4.3.00.0070.01716.50

preferences:
31.63 ms | 403 KiB | 5 Q