3v4l.org

run code in 300+ PHP versions simultaneously
<?php function decorate(callable $fn, array $decorators, array $arguments = array()) { foreach (array_reverse($decorators) as $decorator) { if (is_callable($decorator)) { $fn = $decorator($fn); } } return call_user_func_array($fn, $arguments); } function decorator(callable $decorator) { // This function replaces 'trace' return function($wrapped) use ($decorator) { // This function replaces the function which 'trace' is used on. return function() use ($wrapped, $decorator) { $arguments = func_get_args(); return call_user_func($decorator, $wrapped, $arguments); }; }; } function _trace(callable $fn, array $arguments) { printf("Calling %s with arguments %s\n", print_r($fn, true), print_r($arguments, true)); return call_user_func_array($fn, $arguments); } function trace() { return decorate('_trace', ['decorator'], func_get_args()); } function _foo() { echo "Foo"; } function foo() { return decorate('_foo', ['trace'], func_get_args()); }

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.0070.01018.15
8.3.50.0110.00521.99
8.3.40.0060.00918.67
8.3.30.0060.00918.79
8.3.20.0050.00320.20
8.3.10.0080.00021.97
8.3.00.0070.00322.39
8.2.180.0080.00816.50
8.2.170.0170.00722.96
8.2.160.0060.00920.71
8.2.150.0030.00624.18
8.2.140.0060.00324.66
8.2.130.0050.00326.16
8.2.120.0060.00319.24
8.2.110.0090.00022.11
8.2.100.0090.00317.66
8.2.90.0000.00818.92
8.2.80.0040.00417.97
8.2.70.0030.00617.38
8.2.60.0000.00817.91
8.2.50.0030.00618.07
8.2.40.0050.00517.97
8.2.30.0040.00417.93
8.2.20.0040.00417.54
8.2.10.0070.00017.56
8.2.00.0000.00817.66
8.1.280.0160.00625.92
8.1.270.0040.00424.00
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0070.00323.87
8.1.230.0070.00419.14
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0090.00017.23
8.1.190.0080.00017.27
8.1.180.0050.00318.10
8.1.170.0030.00618.57
8.1.160.0000.00721.87
8.1.150.0040.00418.57
8.1.140.0000.00917.39
8.1.130.0030.00317.72
8.1.120.0000.00717.39
8.1.110.0000.00817.32
8.1.100.0000.00717.34
8.1.90.0040.00417.25
8.1.80.0030.00317.35
8.1.70.0030.00317.23
8.1.60.0040.00417.43
8.1.50.0050.00517.29
8.1.40.0040.00417.39
8.1.30.0040.00417.56
8.1.20.0040.00417.56
8.1.10.0030.00617.30
8.1.00.0080.00017.33
8.0.300.0000.00718.77
8.0.290.0000.00717.05
8.0.280.0030.00318.32
8.0.270.0030.00317.14
8.0.260.0000.00716.64
8.0.250.0030.00516.75
8.0.240.0070.00016.75
8.0.230.0070.00016.86
8.0.220.0050.00316.86
8.0.210.0070.00016.84
8.0.200.0000.00716.75
8.0.190.0000.00716.90
8.0.180.0040.00416.84
8.0.170.0060.00316.65
8.0.160.0040.00416.70
8.0.150.0040.00416.69
8.0.140.0040.00416.71
8.0.130.0000.00513.17
8.0.120.0040.00416.69
8.0.110.0030.00516.76
8.0.100.0050.00216.73
8.0.90.0050.00216.69
8.0.80.0030.01216.75
8.0.70.0000.00816.82
8.0.60.0040.00416.77
8.0.50.0040.00416.74
8.0.30.0100.01117.01
8.0.20.0120.00717.40
8.0.10.0000.00716.77
8.0.00.0090.01216.65
7.4.330.0060.00015.00
7.4.320.0030.00516.50
7.4.300.0000.00616.50
7.4.290.0040.00416.40
7.4.280.0040.00216.53
7.4.270.0000.00716.49
7.4.260.0000.00716.42
7.4.250.0070.00016.41
7.4.240.0030.00516.49
7.4.230.0030.00316.43
7.4.220.0100.01016.48
7.4.210.0070.00716.36
7.4.200.0030.00316.51
7.4.190.0050.00316.67
7.4.160.0070.00716.41
7.4.150.0110.00617.40
7.4.140.0150.00817.86
7.4.130.0090.01116.33
7.4.120.0090.00916.51
7.4.110.0100.01316.41
7.4.100.0090.00916.38
7.4.90.0100.00716.57
7.4.80.0100.00716.23
7.4.70.0100.01316.23
7.4.60.0110.00616.39
7.4.50.0060.00316.29
7.4.40.0030.01422.77
7.4.30.0130.00316.48
7.4.00.0110.00014.54
7.3.330.0000.00613.30
7.3.320.0050.00013.21
7.3.310.0030.00316.06
7.3.300.0000.00716.22
7.3.290.0100.00316.22
7.3.280.0100.00816.19
7.3.270.0060.01217.40
7.3.260.0090.00816.25
7.3.250.0140.01016.43
7.3.240.0070.01116.51
7.3.230.0040.01416.39
7.3.210.0100.01316.07
7.3.200.0000.02419.39
7.3.190.0070.01016.36
7.3.180.0130.00616.14
7.3.170.0100.00616.27
7.3.160.0000.01616.35
7.3.120.0070.00715.03
7.2.330.0130.00316.35
7.2.320.0060.01216.50
7.2.310.0080.01116.57
7.2.300.0080.00816.55
7.2.290.0100.00616.29
7.2.00.0040.00819.26
7.1.200.0060.00915.62
7.1.100.0090.00617.62
7.1.70.0040.00416.78
7.1.60.0060.00919.82
7.1.50.0100.01016.55
7.1.00.0030.07322.42
7.0.200.0040.00416.62
7.0.140.0130.06322.08
7.0.60.0130.07019.98
7.0.50.0100.04317.86
7.0.40.0100.04020.04
7.0.30.0270.05720.21
7.0.20.0230.08020.06
7.0.10.0030.04320.23
7.0.00.0030.08720.18
5.6.280.0000.07721.09
5.6.210.0030.08020.75
5.6.200.0100.05018.25
5.6.190.0100.07320.55
5.6.180.0200.07320.43
5.6.170.0270.05320.46
5.6.160.0030.08020.55
5.6.150.0070.03718.29
5.6.140.0070.08018.18
5.6.130.0030.08718.15
5.6.120.0030.05021.01
5.6.110.0030.04021.10
5.6.100.0130.07721.00
5.6.90.0130.05321.00
5.6.80.0070.03720.46
5.5.350.0000.04320.46
5.5.340.0100.04018.05
5.5.330.0100.07720.36
5.5.320.0230.03720.28
5.5.310.0200.05320.27
5.5.300.0000.04318.01
5.5.290.0100.07318.04
5.5.280.0000.04720.79
5.5.270.0030.07720.66
5.5.260.0030.06320.89
5.5.250.0130.07020.80
5.5.240.0030.08320.29
5.4.450.0170.03719.28
5.4.440.0170.03719.46
5.4.430.0170.04019.24
5.4.420.0130.04719.39
5.4.410.0170.07319.35
5.4.400.0270.07019.07
5.4.390.0230.06019.18
5.4.380.0130.04319.22
5.4.370.0230.05318.87
5.4.360.0330.05319.24
5.4.350.0230.04019.31
5.4.340.0230.06319.00
5.4.320.0500.04019.16
5.4.310.0270.04318.99
5.4.300.0270.05719.16
5.4.290.0270.06718.98
5.4.280.0170.04019.08
5.4.270.0100.05019.13
5.4.260.0170.05018.84
5.4.250.0170.05319.16
5.4.240.0230.06318.98
5.4.230.0130.04718.84
5.4.220.0200.04019.08
5.4.210.0300.07019.26
5.4.200.0270.07018.98
5.4.190.0270.06318.86
5.4.180.0170.04718.97
5.4.170.0330.04719.12
5.4.160.0200.03719.04
5.4.150.0230.06019.12
5.4.140.0300.06716.72
5.4.130.0330.05316.40
5.4.120.0370.03716.46
5.4.110.0170.04016.59
5.4.100.0270.04016.43
5.4.90.0230.04016.61
5.4.80.0230.03716.60
5.4.70.0170.04016.59
5.4.60.0200.04016.61
5.4.50.0300.04316.34
5.4.40.0130.04016.52
5.4.30.0200.07316.50
5.4.20.0430.04016.52
5.4.10.0200.07316.52
5.4.00.0270.04315.81
5.3.290.0230.05014.78
5.3.280.0230.07014.65
5.3.270.0100.05014.54
5.3.260.0330.06714.61
5.3.250.0170.07014.71
5.3.240.0230.07014.78
5.3.230.0270.05014.62
5.3.220.0230.07014.55
5.3.210.0170.05314.51
5.3.200.0170.07014.77
5.3.190.0300.03714.53
5.3.180.0230.06714.66
5.3.170.0200.05014.48
5.3.160.0300.06014.50
5.3.150.0300.06714.66
5.3.140.0230.05014.50
5.3.130.0200.04014.65
5.3.120.0230.07314.54
5.3.110.0200.04314.61
5.3.100.0230.05013.97
5.3.90.0230.03314.12
5.3.80.0370.05013.90
5.3.70.0230.04714.05
5.3.60.0230.03314.00
5.3.50.0230.05313.98
5.3.40.0230.07713.88
5.3.30.0130.07313.85
5.3.20.0370.04013.69
5.3.10.0200.03013.72
5.3.00.0300.03013.68
5.2.170.0100.03312.71
5.2.160.0270.05312.71
5.2.150.0130.03712.71
5.2.140.0200.06312.71
5.2.130.0170.04012.71
5.2.120.0200.02312.71
5.2.110.0230.02712.71
5.2.100.0230.03012.71
5.2.90.0170.06312.71
5.2.80.0130.03712.71
5.2.70.0200.03312.71
5.2.60.0200.03712.71
5.2.50.0170.06012.71
5.2.40.0130.04712.71
5.2.30.0170.06312.71
5.2.20.0230.04712.71
5.2.10.0100.04712.71
5.2.00.0170.03012.71
5.1.60.0170.02712.71
5.1.50.0170.05012.71
5.1.40.0170.03712.71
5.1.30.0100.03012.71
5.1.20.0130.04712.71
5.1.10.0130.04312.71
5.1.00.0230.03312.71
5.0.50.0070.03712.71
5.0.40.0200.02312.71
5.0.30.0100.05712.71
5.0.20.0100.02312.71
5.0.10.0100.04012.71
5.0.00.0100.05012.71
4.4.90.0070.02312.71
4.4.80.0100.03312.71
4.4.70.0100.01712.71
4.4.60.0170.03012.71
4.4.50.0070.02712.71
4.4.40.0070.02712.71
4.4.30.0070.03712.71
4.4.20.0100.02712.71
4.4.10.0070.02712.71
4.4.00.0130.04312.71
4.3.110.0100.01312.71
4.3.100.0070.03712.71
4.3.90.0130.02712.71
4.3.80.0100.03012.71
4.3.70.0070.02312.71
4.3.60.0030.02312.71
4.3.50.0030.03312.71
4.3.40.0030.03712.71
4.3.30.0000.03012.71
4.3.20.0030.03312.71
4.3.10.0070.02312.71
4.3.00.0070.02712.71

preferences:
37.17 ms | 401 KiB | 5 Q