3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $foo; private function __construct($spam){ $this->foo = $spam; } public function getFoo() { return $this->foo; } } function instantiatePrivateCtor($class /*, $...args */) { $args = array_slice(func_get_args(), 1); $extClass = $class . '__Ext'; if (!class_exists($extClass)) { $ns = dirname($extClass); $name = basename($extClass); var_dump($ns, $name); eval(" namespace $ns; class $name extends $class { public function __construct() { \$args = func_get_args(); call_user_func_array('parent::__construct', \$args); } } "); } $reflClass = new \ReflectionClass($extClass); return $reflClass->hewInstanceArgs($args); } $args = 'bacon'; $class = 'Foo'; $reflClass = new \ReflectionClass($class); $instance = instantiatePrivateCtor($class, 'bacon'); echo $instance->getFoo();

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.0110.01118.55
8.3.50.0050.01122.04
8.3.40.0030.01318.93
8.3.30.0110.00419.17
8.3.20.0000.00820.25
8.3.10.0000.00823.64
8.3.00.0030.00619.12
8.2.180.0130.01016.75
8.2.170.0150.00022.96
8.2.160.0130.00320.44
8.2.150.0040.00424.18
8.2.140.0120.00324.66
8.2.130.0000.00726.16
8.2.120.0040.00419.36
8.2.110.0080.00021.95
8.2.100.0030.00920.48
8.2.90.0000.00819.27
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0080.00018.04
8.2.50.0030.00618.07
8.2.40.0000.00819.88
8.2.30.0000.00818.31
8.2.20.0000.00717.67
8.2.10.0060.00318.14
8.2.00.0040.00419.66
8.1.280.0070.01025.92
8.1.270.0040.00423.88
8.1.260.0070.00026.35
8.1.250.0060.00328.09
8.1.240.0030.00722.18
8.1.230.0120.00019.06
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0090.00017.23
8.1.190.0050.00317.35
8.1.180.0000.00918.10
8.1.170.0000.00818.36
8.1.160.0070.00022.08
8.1.150.0040.00418.68
8.1.140.0000.00817.48
8.1.130.0040.00417.85
8.1.120.0000.00717.48
8.1.110.0040.00417.48
8.1.100.0000.00717.36
8.1.90.0000.00717.38
8.1.80.0080.00017.54
8.1.70.0000.00717.44
8.1.60.0000.00817.59
8.1.50.0030.00617.63
8.1.40.0040.00417.52
8.1.30.0000.00917.62
8.1.20.0000.00817.65
8.1.10.0030.00617.50
8.1.00.0050.00517.57
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0030.00318.39
8.0.270.0070.00017.26
8.0.260.0000.00617.28
8.0.250.0000.00717.04
8.0.240.0000.00816.99
8.0.230.0000.00717.05
8.0.220.0070.00017.02
8.0.210.0000.00717.01
8.0.200.0030.00317.02
8.0.190.0030.00517.06
8.0.180.0060.00617.04
8.0.170.0050.00316.91
8.0.160.0030.00316.98
8.0.150.0000.01116.94
8.0.140.0030.00316.90
8.0.130.0030.00613.54
8.0.120.0030.00315.24
8.0.110.0020.00515.27
8.0.100.0030.00515.22
8.0.90.0020.00515.11
8.0.80.0050.00915.21
8.0.70.0010.00615.29
8.0.60.0050.00215.23
8.0.50.0030.00415.18
8.0.30.0110.00415.80
8.0.20.0090.00616.09
8.0.10.0040.00315.29
8.0.00.0100.00515.95
7.4.330.0020.00215.21
7.4.320.0000.00616.46
7.4.300.0030.00316.54
7.4.290.0040.00416.51
7.4.280.0000.00816.54
7.4.270.0070.00016.63
7.4.260.0070.00016.46
7.4.250.0060.00214.89
7.4.240.0030.00315.53
7.4.230.0030.00314.97
7.4.220.0020.01015.06
7.4.210.0080.00315.08
7.4.200.0020.00514.94
7.4.190.0000.00613.42
7.4.180.0050.00013.43
7.4.160.0070.00415.02
7.4.150.0040.00815.42
7.4.140.0090.00616.33
7.4.130.0070.00615.44
7.4.120.0080.00615.46
7.4.110.0080.00314.94
7.4.100.0030.00914.92
7.4.90.0030.00914.97
7.4.80.0050.00816.38
7.4.70.0030.01314.87
7.4.60.0070.00515.04
7.4.50.0030.00314.96
7.4.40.0080.00314.77
7.4.30.0060.00514.96
7.4.20.0000.00513.36
7.4.10.0060.00714.82
7.4.00.0060.00314.95
7.3.330.0020.00213.46
7.3.320.0050.00013.53
7.3.310.0000.00714.82
7.3.300.0050.00214.91
7.3.290.0070.00614.81
7.3.280.0070.01015.67
7.3.270.0060.00715.40
7.3.260.0090.00314.95
7.3.250.0070.00715.37
7.3.240.0080.00314.94
7.3.230.0050.00614.88
7.3.220.0050.00313.30
7.3.210.0060.00514.89
7.3.200.0050.00916.29
7.3.190.0050.00714.97
7.3.180.0070.00514.92
7.3.170.0020.00914.79
7.3.160.0050.00614.80
7.3.150.0040.00413.18
7.3.140.0040.00213.11
7.3.130.0070.00514.83
7.3.120.0070.00414.78
7.3.110.0060.00514.70
7.3.100.0020.01014.90
7.3.90.0040.00715.03
7.3.80.0040.00614.80
7.3.70.0060.00314.88
7.3.60.0030.00914.89
7.3.50.0040.00814.86
7.3.40.0040.00514.99
7.3.30.0030.00414.94
7.3.20.0070.00416.61
7.3.10.0090.00216.72
7.3.00.0020.00716.69
7.2.340.0080.00413.26
7.2.330.0090.00614.89
7.2.320.0070.00715.04
7.2.310.0080.00815.02
7.2.300.0060.01015.04
7.2.290.0060.00815.13
7.2.280.0120.00013.37
7.2.270.0080.00413.36
7.2.260.0060.00815.01
7.2.250.0140.00215.04
7.2.240.0070.00814.92
7.2.230.0060.00815.00
7.2.220.0050.00915.03
7.2.210.0060.00714.94
7.2.200.0070.00615.01
7.2.190.0070.00415.11
7.2.180.0080.00615.10
7.2.170.0040.01015.10
7.2.160.0100.00215.12
7.2.150.0090.00416.95
7.2.140.0070.00816.89
7.2.130.0100.00316.86
7.2.120.0080.00616.95
7.2.110.0040.00716.89
7.2.100.0060.00716.88
7.2.90.0100.00716.94
7.2.80.0130.00516.85
7.2.70.0080.00416.94
7.2.60.0060.00716.81
7.2.50.0080.00716.88
7.2.40.0100.00316.94
7.2.30.0030.01117.00
7.2.20.0070.00616.91
7.2.10.0100.00516.90
7.2.00.0070.00717.77
7.1.330.0020.01115.89
7.1.320.0060.00815.95
7.1.310.0030.00715.91
7.1.300.0090.00315.85
7.1.290.0090.00315.88
7.1.280.0070.00416.00
7.1.270.0080.00516.03
7.1.260.0090.00415.87
7.1.250.0060.00515.79
7.1.240.0090.00415.82
7.1.230.0070.00315.92
7.1.220.0070.00615.83
7.1.210.0060.00915.78
7.1.200.0060.00615.65
7.1.190.0070.00715.96
7.1.180.0060.00415.75
7.1.170.0080.00515.84
7.1.160.0060.00715.86
7.1.150.0020.01015.75
7.1.140.0110.00115.78
7.1.130.0070.00715.91
7.1.120.0040.00715.88
7.1.110.0070.00715.90
7.1.100.0070.00516.65
7.1.90.0080.00515.84
7.1.80.0060.00815.87
7.1.70.0060.00616.28
7.1.60.0060.01017.13
7.1.50.0080.00916.29
7.1.40.0080.00515.90
7.1.30.0060.00815.96
7.1.20.0040.00915.79
7.1.10.0120.00215.85
7.1.00.0060.03218.02
7.0.330.0100.00315.54
7.0.320.0070.00315.48
7.0.310.0070.00615.61
7.0.300.0040.00915.66
7.0.290.0090.00615.56
7.0.280.0080.00315.71
7.0.270.0080.00815.56
7.0.260.0100.00415.66
7.0.250.0050.00815.64
7.0.240.0070.00315.74
7.0.230.0060.00415.75
7.0.220.0080.00515.63
7.0.210.0090.00415.69
7.0.200.0020.00915.88
7.0.190.0050.00515.69
7.0.180.0100.00415.68
7.0.170.0110.00315.73
7.0.160.0060.00615.67
7.0.150.0090.00515.71
7.0.140.0060.02717.71
7.0.130.0090.00515.68
7.0.120.0070.00615.73
7.0.110.0090.00515.53
7.0.100.0070.00615.44
7.0.90.0080.00615.50
7.0.80.0080.00515.53
7.0.70.0080.00415.55
7.0.60.0100.02617.04
7.0.50.0100.02716.36
7.0.40.0070.03116.52
7.0.30.0230.02616.45
7.0.20.0130.02116.49
7.0.10.0050.03416.56
7.0.00.0060.02816.47
5.6.400.0050.00614.45
5.6.390.0080.00514.13
5.6.380.0060.00814.37
5.6.370.0060.00714.27
5.6.360.0050.00714.53
5.6.350.0070.00414.28
5.6.340.0060.00614.29
5.6.330.0050.00914.23
5.6.320.0090.00514.38
5.6.310.0100.00314.33
5.6.300.0080.00514.36
5.6.290.0060.00614.20
5.6.280.0060.03016.48
5.6.270.0120.00314.38
5.6.260.0050.00914.28
5.6.250.0070.00714.24
5.6.240.0040.00714.30
5.6.230.0050.00714.31
5.6.220.0080.00514.29
5.6.210.0090.02816.52
5.6.200.0050.02515.71
5.6.190.0040.02216.43
5.6.180.1480.01516.49
5.6.170.0110.03316.38
5.6.160.0080.01516.43
5.6.150.0030.02515.64
5.6.140.0090.02915.53
5.6.130.0050.03215.63
5.6.120.0070.01716.66
5.6.110.0090.02816.57
5.6.100.0080.03116.75
5.6.90.0060.03516.63
5.6.80.0050.02416.33
5.6.70.1530.01416.37
5.6.60.0070.00414.23
5.6.50.0040.00714.28
5.6.40.0080.00414.27
5.6.30.0050.00714.24
5.6.20.0080.00514.29
5.6.10.0080.00514.32
5.6.00.0090.00514.34
5.5.380.0080.00314.22
5.5.370.0070.00514.22
5.5.360.0080.00514.17
5.5.350.0080.03316.25
5.5.340.0040.03115.55
5.5.330.0090.01816.10
5.5.320.0180.02416.10
5.5.310.0070.02016.12
5.5.300.0070.01615.57
5.5.290.0050.02215.40
5.5.280.0030.01916.51
5.5.270.0030.02416.45
5.5.260.0120.02116.43
5.5.250.0040.01916.39
5.5.240.0120.03016.21
5.5.230.0060.00714.04
5.5.220.0060.00714.14
5.5.210.0060.00814.18
5.5.200.0070.00714.25
5.5.190.0090.00414.14
5.5.180.0110.00414.28
5.5.170.0070.00614.04
5.5.160.0050.00814.20
5.5.150.0100.00314.01
5.5.140.0080.00314.14
5.5.130.0080.00514.12
5.5.120.0070.00314.07
5.5.110.0080.00614.12
5.5.100.0080.00314.00
5.5.90.0030.00814.06
5.5.80.0020.01114.09
5.5.70.0080.00514.25
5.5.60.0070.00514.16
5.5.50.0040.01014.26
5.5.40.0050.00713.97
5.5.30.0060.00414.16
5.5.20.0050.00514.08
5.5.10.0070.00314.25
5.5.00.0050.00814.08
5.4.450.0090.02021.23
5.4.440.0130.01620.04
5.4.430.0330.02415.29
5.4.420.0160.01520.00
5.4.410.0170.01919.93
5.4.400.0390.01515.12
5.4.390.0120.01819.18
5.4.380.0150.01714.98
5.4.370.0120.02014.94
5.4.360.0140.01714.99
5.4.350.0140.01914.90
5.4.340.0140.01815.04
5.4.330.0090.00313.05
5.4.320.0060.01412.98
5.4.310.0090.01412.93
5.4.300.0080.01312.88
5.4.290.0060.01712.96
5.4.280.0080.01512.84
5.4.270.0050.01912.92
5.4.260.0070.01512.88
5.4.250.0050.01712.87
5.4.240.0060.01612.90
5.4.230.0050.01712.81
5.4.220.0060.01612.81
5.4.210.0080.01312.76
5.4.200.0070.01612.77
5.4.190.0040.02012.84
5.4.180.0050.01812.80
5.4.170.0090.01512.86
5.4.160.0060.01412.81
5.4.150.0060.01512.81
5.4.140.0070.01612.70
5.4.130.0050.01512.72
5.4.120.0060.01712.71
5.4.110.0050.01412.75
5.4.100.0050.01612.80
5.4.90.0070.01512.67
5.4.80.0050.01612.76
5.4.70.0050.01712.77
5.4.60.0050.01512.72
5.4.50.0040.01712.72
5.4.40.0090.01412.75
5.4.30.0060.01412.81
5.4.20.0060.01412.81
5.4.10.0070.01612.71
5.4.00.0010.01912.51
5.3.290.0080.01513.21
5.3.280.0070.01613.13
5.3.270.0090.01713.09
5.3.260.0040.01813.08
5.3.250.0050.01813.06
5.3.240.0070.01713.09
5.3.230.0070.01513.06
5.3.220.0070.01613.01
5.3.210.0030.02213.11
5.3.200.0070.01613.03
5.3.190.0040.01813.13
5.3.180.0060.01513.07
5.3.170.0050.01613.15
5.3.160.0080.01413.07
5.3.150.0080.01413.17
5.3.140.0080.01413.14
5.3.130.0070.01413.04
5.3.120.0080.01513.11
5.3.110.0050.01713.13
5.3.100.0040.02012.95
5.3.90.0040.01812.95
5.3.80.0050.01512.93
5.3.70.0070.01612.87
5.3.60.0060.01612.87
5.3.50.0070.01612.84
5.3.40.0080.01512.84
5.3.30.0050.01612.92
5.3.20.0050.01812.75
5.3.10.0050.01612.76
5.3.00.0040.01812.75
5.2.170.0060.01810.57
5.2.160.0050.01710.68
5.2.150.0040.01810.60
5.2.140.0040.01810.65
5.2.130.0030.01910.55
5.2.120.0060.01510.51
5.2.110.0060.01810.61
5.2.100.0020.01810.67
5.2.90.0040.01710.66
5.2.80.0060.01610.48
5.2.70.0080.01810.47
5.2.60.0040.01910.46
5.2.50.0080.01410.58
5.2.40.0050.01610.58
5.2.30.0080.01710.50
5.2.20.0040.01710.40
5.2.10.0060.01510.38
5.2.00.0090.01510.31
5.1.60.0060.0129.62
5.1.50.0020.0209.50
5.1.40.0040.0169.67
5.1.30.0050.0159.86
5.1.20.0070.0139.77
5.1.10.0080.0149.57
5.1.00.0060.0179.64
5.0.50.0040.0128.59
5.0.40.0040.0118.52
5.0.30.0040.0198.43
5.0.20.0050.0108.41
5.0.10.0050.0138.40
5.0.00.0050.0158.39
4.4.90.0010.0107.64
4.4.80.0030.0097.62
4.4.70.0020.0087.62
4.4.60.0010.0107.63
4.4.50.0020.0097.63
4.4.40.0020.0177.60
4.4.30.0020.0127.63
4.4.20.0020.0117.67
4.4.10.0020.0107.67
4.4.00.0010.0147.62
4.3.110.0020.0127.58
4.3.100.0020.0097.58
4.3.90.0020.0127.56
4.3.80.0010.0157.54
4.3.70.0030.0087.56
4.3.60.0020.0117.56
4.3.50.0040.0077.56
4.3.40.0030.0137.51
4.3.30.0020.0096.90
4.3.20.0020.0086.88
4.3.10.0020.0096.86
4.3.00.0020.00920.87

preferences:
50.16 ms | 401 KiB | 5 Q