3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo\Bar\Baz; $closureBeforeDefined = function () { return constant('A_RELATIVE_CONSTANT'); }; define('A_RELATIVE_CONSTANT', 'IN GLOBAL NAMESPACE'); var_dump($closureBeforeDefined()); define('Foo\\Bar\\Baz\\A_RELATIVE_CONSTANT', 'IN RELATIVE NAMESPACE'); $closureAfterDefined = function () { return constant('A_RELATIVE_CONSTANT'); }; var_dump($closureBeforeDefined()); var_dump($closureAfterDefined()); $constants = get_defined_constants(true); var_dump($constants['user']);

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.0120.00916.75
8.3.50.0090.00722.83
8.3.40.0140.00018.61
8.3.30.0080.00619.22
8.3.20.0040.00420.34
8.3.10.0040.00423.52
8.3.00.0060.00319.38
8.2.180.0060.01316.88
8.2.170.0090.00622.96
8.2.160.0030.01020.39
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0110.00426.16
8.2.120.0040.00421.10
8.2.110.0030.00622.29
8.2.100.0090.00317.88
8.2.90.0000.00819.47
8.2.80.0000.00817.97
8.2.70.0000.00917.50
8.2.60.0080.00018.03
8.2.50.0060.00318.07
8.2.40.0000.00818.28
8.2.30.0070.00018.16
8.2.20.0040.00417.93
8.2.10.0040.00418.20
8.2.00.0000.00817.68
8.1.280.0070.01425.92
8.1.270.0050.00323.77
8.1.260.0080.00026.35
8.1.250.0070.00728.09
8.1.240.0060.00323.70
8.1.230.0110.00019.18
8.1.220.0040.00417.91
8.1.210.0040.00418.77
8.1.200.0060.00317.47
8.1.190.0040.00417.47
8.1.180.0000.00819.01
8.1.170.0030.00518.62
8.1.160.0050.00322.01
8.1.150.0070.00018.81
8.1.140.0040.00417.43
8.1.130.0040.00417.96
8.1.120.0040.00417.45
8.1.110.0000.00817.53
8.1.100.0030.00617.45
8.1.90.0000.00717.53
8.1.80.0000.00717.54
8.1.70.0040.00417.51
8.1.60.0060.00317.64
8.1.50.0040.00417.58
8.1.40.0040.00417.61
8.1.30.0030.00517.65
8.1.20.0040.00417.61
8.1.10.0000.00817.59
8.1.00.0000.00717.53
8.0.300.0070.00018.77
8.0.290.0040.00416.58
8.0.280.0040.00418.45
8.0.270.0050.00517.18
8.0.260.0030.00317.19
8.0.250.0040.00416.94
8.0.240.0050.00316.89
8.0.230.0000.00816.89
8.0.220.0030.00316.86
8.0.210.0040.00416.91
8.0.200.0030.00316.93
8.0.190.0040.00416.91
8.0.180.0040.00416.94
8.0.170.0060.00317.04
8.0.160.0030.00716.95
8.0.150.0000.00716.91
8.0.140.0040.00416.80
8.0.130.0000.00613.35
8.0.120.0060.00316.80
8.0.110.0000.00716.84
8.0.100.0050.00216.91
8.0.90.0070.00016.99
8.0.80.0090.00617.00
8.0.70.0040.00416.86
8.0.60.0040.00416.84
8.0.50.0070.00016.82
8.0.30.0090.01117.02
8.0.20.0090.01117.40
8.0.10.0000.00717.07
8.0.00.0060.01116.74
7.4.330.0050.00015.07
7.4.320.0030.00316.51
7.4.300.0000.00616.43
7.4.290.0040.00416.63
7.4.280.0040.00416.57
7.4.270.0040.00416.59
7.4.260.0030.00316.47
7.4.250.0040.00416.52
7.4.240.0040.00316.57
7.4.230.0030.00316.50
7.4.220.0150.00416.69
7.4.210.0040.01216.71
7.4.200.0030.00316.77
7.4.160.0060.00916.63
7.4.150.0110.00717.40
7.4.140.0120.00517.86
7.4.130.0120.00416.56
7.4.120.0090.01016.46
7.4.110.0090.00916.72
7.4.100.0080.00916.52
7.4.90.0060.01116.59
7.4.80.0130.01319.39
7.4.70.0130.00316.66
7.4.60.0060.01716.60
7.4.50.0030.00316.41
7.4.40.0160.00616.52
7.4.30.0000.02216.43
7.4.00.0120.00315.15
7.3.330.0060.00013.22
7.3.320.0050.00013.38
7.3.310.0070.00016.27
7.3.300.0030.00316.28
7.3.290.0170.00316.36
7.3.280.0100.00516.31
7.3.270.0120.00617.40
7.3.260.0120.00616.34
7.3.250.0130.00916.47
7.3.240.0140.00316.64
7.3.230.0050.01116.44
7.3.210.0110.00716.32
7.3.200.0100.01419.39
7.3.190.0070.01316.55
7.3.180.0120.00316.32
7.3.170.0100.00616.50
7.3.160.0080.00916.52
7.2.330.0140.01016.39
7.2.320.0100.01016.63
7.2.310.0070.01616.74
7.2.300.0070.01016.63
7.2.290.0090.00916.34
7.2.00.0120.00619.26
7.1.100.0000.01117.87
7.1.70.0040.00417.18
7.1.60.0060.01019.40
7.1.50.0060.01616.73
7.1.00.0000.08022.43
7.0.200.0000.00916.86
7.0.140.0070.07322.00
7.0.60.0070.08720.05
7.0.50.0070.05017.99
7.0.40.0100.06020.51
7.0.30.0300.07720.34
7.0.20.0170.08020.06
7.0.10.0100.04320.06
7.0.00.0100.05720.11
5.6.280.0000.07720.92
5.6.210.0030.08020.60
5.6.200.0070.06018.19
5.6.190.0030.09020.39
5.6.180.0370.06320.34
5.6.170.0270.08320.56
5.6.160.0030.06720.51
5.6.150.0230.06318.29
5.6.140.0100.06318.18
5.6.130.0030.04718.25
5.6.120.0130.05321.04
5.6.110.0070.08321.14
5.6.100.0070.06721.05
5.6.90.0100.04721.16
5.6.80.0200.07320.43
5.5.350.3630.04020.48
5.5.340.0100.04017.97
5.5.330.0030.04320.59
5.5.320.0230.04020.42
5.5.310.0400.04720.32
5.5.300.0100.08317.98
5.5.290.0030.07017.96
5.5.280.0070.08320.93
5.5.270.0070.04020.71
5.5.260.0030.08720.90
5.5.250.0070.03720.65
5.5.240.0000.06720.10
5.4.450.0700.05319.55
5.4.440.0670.04719.32
5.4.430.0530.06319.53
5.4.420.0730.05719.54
5.4.410.0570.06019.52
5.4.400.0600.05019.06
5.4.390.0230.04719.09
5.4.380.0130.05318.91
5.4.370.0070.04718.95
5.4.360.0300.04718.91
5.4.350.0170.11012.20
5.4.340.0140.04612.19
5.4.320.0110.03512.70
5.4.310.0080.04112.69
5.4.300.0070.04312.70
5.4.290.0080.03712.70
5.4.280.0050.04212.60
5.4.270.0030.04012.60
5.4.260.0070.04012.59
5.4.250.0060.04112.59
5.4.240.0060.04112.59
5.4.230.0060.03812.59
5.4.220.0040.03912.59
5.4.210.0080.03712.59
5.4.200.0030.04312.58
5.4.190.0040.04012.58
5.4.180.0090.03312.58
5.4.170.0080.03612.58
5.4.160.0070.03612.59
5.4.150.0090.03512.59
5.4.140.0050.03912.27
5.4.130.0080.03612.25
5.4.120.0070.03512.21
5.4.110.0100.03312.21
5.4.100.0090.03312.21
5.4.90.0050.04112.20
5.4.80.0060.03712.21
5.4.70.0030.03712.20
5.4.60.0040.04012.20
5.4.50.0040.04512.20
5.4.40.0090.03412.19
5.4.30.0050.04012.18
5.4.20.0040.04112.18
5.4.10.0080.03212.18
5.4.00.0070.03411.67
5.3.290.0140.04112.93
5.3.280.0030.04512.86
5.3.270.0060.04112.87
5.3.260.0040.04212.88
5.3.250.0060.03912.88
5.3.240.0070.04212.88
5.3.230.0090.04012.87
5.3.220.0090.03912.83
5.3.210.0090.03912.84
5.3.200.0080.04312.83
5.3.190.0090.04212.84
5.3.180.0090.03612.83
5.3.170.0080.04112.83
5.3.160.0080.04012.83
5.3.150.0070.04012.84
5.3.140.0120.03312.82
5.3.130.0080.04312.81
5.3.120.0070.04212.82
5.3.110.0070.03812.82
5.3.100.0050.04012.30
5.3.90.0100.03612.29
5.3.80.0050.04512.27
5.3.70.0110.03812.27
5.3.60.0070.03812.26
5.3.50.0070.03912.22
5.3.40.0060.03812.20
5.3.30.0090.03712.16
5.3.20.0070.03611.94
5.3.10.0080.03311.90
5.3.00.0050.03711.89
5.2.170.0090.0319.18
5.2.160.0030.0369.18
5.2.150.0060.0319.18
5.2.140.0060.0339.18
5.2.130.0050.0299.14
5.2.120.0030.0319.14
5.2.110.0050.0309.14
5.2.100.0050.0289.14
5.2.90.0050.0289.14
5.2.80.0070.0339.14
5.2.70.0050.0379.14
5.2.60.0080.0299.09
5.2.50.0050.0309.06
5.2.40.0070.0279.04
5.2.30.0050.0369.01
5.2.20.0100.0339.00
5.2.10.0060.0328.93
5.2.00.0040.0298.78
5.1.60.0050.0238.07
5.1.50.0030.0268.07
5.1.40.0050.0238.05
5.1.30.0040.0258.39
5.1.20.0060.0288.42
5.1.10.0060.0248.14
5.1.00.0060.0248.14
5.0.50.0050.0196.62
5.0.40.0040.0226.48
5.0.30.0050.0336.29
5.0.20.0030.0206.27
5.0.10.0050.0196.24
5.0.00.0030.0316.23
4.4.90.0020.0164.78
4.4.80.0040.0144.75
4.4.70.0030.0154.76
4.4.60.0020.0164.75
4.4.50.0040.0184.77
4.4.40.0070.0234.71
4.4.30.0050.0154.76
4.4.20.0050.0144.84
4.4.10.0030.0154.84
4.4.00.0030.0254.76
4.3.110.0050.0134.67
4.3.100.0030.0154.66
4.3.90.0020.0154.63
4.3.80.0040.0234.58
4.3.70.0030.0144.63
4.3.60.0020.0154.63
4.3.50.0020.0164.62
4.3.40.0040.0234.54
4.3.30.0010.0173.28
4.3.20.0020.0163.26
4.3.10.0040.0183.22
4.3.00.0100.0237.13

preferences:
47.12 ms | 401 KiB | 5 Q