3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace ns1 { class JsonDumpTransformer{}; }; namespace ns2 { class SingleElementTransformer{}; }; namespace{ $lookup = [ 't-JsonDump' => \ns1\JsonDumpTransformer::class, 't-SingleElement' => \ns2\SingleElementTransformer::class, ]; $key = 't-SingleElement'; $class = $lookup[$key]; // Instantiate a object of type \ns1\JsonDumpTransformer #$object = ???; }

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.0030.01216.36
8.3.50.0110.00721.89
8.3.40.0120.00618.52
8.3.30.0070.00718.64
8.3.20.0060.00320.16
8.3.10.0090.00018.79
8.3.00.0040.00420.57
8.2.180.0140.00716.63
8.2.170.0090.00622.96
8.2.160.0100.01020.22
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0060.00318.98
8.2.120.0000.00726.35
8.2.110.0090.00019.21
8.2.100.0030.01217.84
8.2.90.0040.00419.22
8.2.80.0080.00017.97
8.2.70.0060.00317.50
8.2.60.0030.00617.80
8.2.50.0040.00418.10
8.2.40.0000.00922.32
8.2.30.0030.00619.50
8.2.20.0020.00517.60
8.2.10.0030.00517.92
8.2.00.0050.00317.97
8.1.280.0080.00825.92
8.1.270.0040.00423.97
8.1.260.0020.00528.09
8.1.250.0060.00328.09
8.1.240.0100.00023.92
8.1.230.0040.00819.61
8.1.220.0000.00817.76
8.1.210.0060.00318.77
8.1.200.0090.00017.25
8.1.190.0000.00817.10
8.1.180.0030.00618.10
8.1.170.0040.00418.43
8.1.160.0000.00720.87
8.1.150.0050.00218.83
8.1.140.0040.00419.45
8.1.130.0000.00717.63
8.1.120.0050.00317.35
8.1.110.0070.00017.43
8.1.100.0040.00417.38
8.1.90.0040.00417.42
8.1.80.0040.00417.38
8.1.70.0030.00317.38
8.1.60.0070.00017.47
8.1.50.0060.00317.46
8.1.40.0040.00417.41
8.1.30.0040.00417.43
8.1.20.0040.00417.46
8.1.10.0040.00417.43
8.1.00.0120.00017.42
8.0.300.0040.00418.77
8.0.290.0030.00616.63
8.0.280.0030.00318.37
8.0.270.0040.00417.10
8.0.260.0060.00317.19
8.0.250.0030.00316.93
8.0.240.0000.00716.89
8.0.230.0000.00716.82
8.0.220.0040.00416.82
8.0.210.0030.00516.78
8.0.200.0060.00016.88
8.0.190.0080.00316.81
8.0.180.0040.00416.89
8.0.170.0000.00716.77
8.0.160.0000.00716.71
8.0.150.0070.00016.72
8.0.140.0000.00716.80
8.0.130.0000.00613.29
8.0.120.0030.00616.79
8.0.110.0040.00416.67
8.0.100.0070.00016.61
8.0.90.0000.00716.84
8.0.80.0030.01216.87
8.0.70.0000.00716.77
8.0.60.0000.00716.84
8.0.50.0070.00016.70
8.0.30.0080.01416.88
8.0.20.0080.01017.40
8.0.10.0070.00016.82
8.0.00.0070.01116.55
7.4.330.0050.00016.66
7.4.320.0000.00616.43
7.4.300.0030.00316.43
7.4.290.0000.00716.54
7.4.280.0000.00916.32
7.4.270.0060.00016.44
7.4.260.0070.00416.42
7.4.250.0040.00416.33
7.4.240.0030.00316.46
7.4.230.0000.00716.60
7.4.220.0070.01116.32
7.4.210.0080.01116.52
7.4.200.0020.00516.27
7.4.160.0120.00316.50
7.4.150.0190.00017.40
7.4.140.0140.00617.86
7.4.130.0110.00716.36
7.4.120.0070.01016.40
7.4.110.0060.01016.47
7.4.100.0130.00616.53
7.4.90.0130.00316.19
7.4.80.0110.00719.39
7.4.70.0100.00716.38
7.4.60.0060.00916.25
7.4.50.0060.00916.41
7.4.40.0040.01516.29
7.4.30.0090.00816.44
7.4.00.0070.01014.85
7.3.330.0050.00313.21
7.3.320.0060.00013.21
7.3.310.0030.00316.13
7.3.300.0030.00316.15
7.3.290.0070.00016.25
7.3.280.0110.00916.22
7.3.270.0130.00717.40
7.3.260.0130.01016.36
7.3.250.0100.01216.24
7.3.240.0110.00616.41
7.3.230.0150.00616.39
7.3.210.0080.00816.14
7.3.200.0030.01319.39
7.3.190.0030.01416.48
7.3.180.0060.00916.12
7.3.170.0050.00616.32
7.3.160.0090.00616.42
7.3.120.0130.00714.75
7.3.110.0090.00914.44
7.3.100.0070.00714.96
7.3.90.0040.01415.00
7.3.80.0090.00614.34
7.3.70.0080.00414.78
7.3.60.0030.01014.83
7.3.50.0040.00814.64
7.3.40.0000.00814.62
7.3.30.0000.01514.78
7.3.20.0100.00316.60
7.3.10.0110.00416.42
7.3.00.0100.00316.39
7.2.330.0120.01216.75
7.2.320.0070.01016.70
7.2.310.0130.00716.57
7.2.300.0070.01416.40
7.2.290.0070.01316.48
7.2.250.0090.00915.21
7.2.240.0080.00815.17
7.2.230.0120.00314.91
7.2.220.0070.01115.11
7.2.210.0070.00715.11
7.2.200.0090.00614.89
7.2.190.0100.00014.88
7.2.180.0070.00714.93
7.2.170.0040.00814.93
7.2.160.0070.00715.04
7.2.150.0100.00316.89
7.2.140.0030.00616.48
7.2.130.0060.00316.73
7.2.120.0030.01016.49
7.2.110.0080.00416.71
7.2.100.0030.01016.64
7.2.90.0070.01016.79
7.2.80.0100.00716.44
7.2.70.0060.01016.65
7.2.60.0040.01116.64
7.2.50.0030.00617.00
7.2.40.0040.00816.92
7.2.30.0060.00916.85
7.2.20.0000.01316.82
7.2.10.0060.01216.91
7.2.00.0030.01316.88
7.1.330.0080.00815.55
7.1.320.0070.01015.62
7.1.310.0040.00415.58
7.1.300.0050.00315.83
7.1.290.0030.01415.76
7.1.280.0000.01615.73
7.1.270.0040.00715.57
7.1.260.0080.00015.78
7.1.250.0090.00615.59
7.1.240.0030.01015.82
7.1.230.0000.00815.51
7.1.220.0040.00815.42
7.1.210.0070.00715.36
7.1.200.0050.00615.66
7.1.190.0080.00315.76
7.1.180.0100.00315.62
7.1.170.0000.01515.68
7.1.160.0000.01715.72
7.1.150.0070.00715.73
7.1.140.0130.00315.79
7.1.130.0000.01215.54
7.1.120.0070.00415.80
7.1.110.0040.00415.51
7.1.100.0060.01015.67
7.1.90.0130.00615.52
7.1.80.0070.01015.40
7.1.70.0080.00716.17
7.1.60.0060.01317.52
7.1.50.0020.01416.17
7.1.40.0060.00615.57
7.1.30.0060.00615.85
7.1.20.0040.00715.51
7.1.10.0070.00715.46
7.1.00.0050.04219.04
7.0.330.0000.00915.37
7.0.320.0070.00715.31
7.0.310.0090.00015.12
7.0.300.0000.01415.11
7.0.290.0050.00515.18
7.0.280.0090.00015.45
7.0.270.0070.01015.31
7.0.260.0120.00415.23
7.0.250.0030.01015.43
7.0.240.0000.01815.34
7.0.230.0090.00915.40
7.0.220.0030.01215.36
7.0.210.0090.00615.13
7.0.200.0000.01015.75
7.0.190.0080.00015.23
7.0.180.0040.01115.41
7.0.170.0030.00615.30
7.0.160.0040.00715.38
7.0.150.0070.00315.19
7.0.140.0000.01015.32
7.0.130.0070.00015.45
7.0.120.0100.00315.50
7.0.110.0120.00315.49
7.0.100.0080.00815.45
7.0.90.0030.01015.48
7.0.80.0030.01415.43
7.0.70.0070.00715.35
7.0.60.0220.03717.58
7.0.50.0060.04116.59
7.0.40.0080.02616.85
7.0.30.0180.03316.73
7.0.20.0150.04716.84
7.0.10.0030.02916.54
7.0.00.0090.02916.74
5.6.400.0080.00614.25
5.6.390.0060.00914.22
5.6.380.0000.01614.01
5.6.370.0100.00313.86
5.6.360.0060.01214.34
5.6.350.0060.00614.05
5.6.340.0100.00313.98
5.6.330.0080.00814.16
5.6.320.0030.01314.30
5.6.310.0090.00413.91
5.6.300.0110.00414.43
5.6.290.0090.00314.22
5.6.280.0020.04017.47
5.6.270.0040.01413.99
5.6.260.0030.01114.03
5.6.250.0070.00714.08
5.6.240.0030.01014.13
5.6.230.0100.00314.09
5.6.220.0060.00814.14
5.6.210.0100.04017.45
5.6.200.0050.03916.09
5.6.190.0110.02617.25
5.6.180.0180.03217.31
5.6.170.0170.02217.18
5.6.160.0030.02917.26
5.6.150.0070.04416.07
5.6.140.0070.03816.07
5.6.130.0050.04716.13
5.6.120.0120.03917.64
5.6.110.0080.02317.70
5.6.100.0080.03017.55
5.6.90.0130.04017.68
5.6.80.0100.04017.03
5.6.70.0090.00913.80
5.6.60.0060.00914.14
5.6.50.0030.01013.95
5.6.40.0000.01013.80
5.6.30.0000.01114.04
5.6.20.0060.00613.90
5.6.10.0060.00913.95
5.6.00.0030.00913.95
5.5.380.0090.00614.03
5.5.370.0030.01313.71
5.5.360.0040.01113.89
5.5.350.0160.04117.09
5.5.340.0120.03116.15
5.5.330.0080.03017.19
5.5.320.0180.03817.18
5.5.310.0170.03417.00
5.5.300.0080.02816.00
5.5.290.0050.03515.98
5.5.280.0070.03217.26
5.5.270.0120.04217.44
5.5.260.0100.03517.34
5.5.250.0130.04017.13
5.5.240.0220.03717.26
5.5.230.0100.00313.87
5.5.220.0100.00314.04
5.5.210.0040.00814.00
5.5.200.0040.00814.11
5.5.190.0030.00513.71
5.5.180.0040.00713.96
5.5.170.0040.00413.78
5.5.160.0090.00613.95
5.5.150.0030.00713.96
5.5.140.0000.01413.91
5.5.130.0000.01413.98
5.5.120.0040.00713.77
5.5.110.0060.00313.94
5.5.100.0040.00814.02
5.5.90.0040.00813.77
5.5.80.0070.00413.94
5.5.70.0060.00613.86
5.5.60.0000.00813.82
5.5.50.0050.00513.85
5.5.40.0100.00314.06
5.5.30.0040.00814.05
5.5.20.0030.01413.93
5.5.10.0050.00313.92
5.5.00.0060.00314.10

preferences:
67.87 ms | 401 KiB | 5 Q