3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function getBarClass() { return Bar::class; } public function getClassName() { return get_class($this); } } class Bar { protected $name; public function __construct(string $name) { $this->name = $name; } public static function getInstance(...$parameters) { return new Static(...$parameters); } public function getName(): string { return $this->name; } } $foo = new Foo; var_dump($foo->getClassName()::getBarClass()::getInstance('someName')->getName());

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.0150.00018.55
8.3.50.0120.01021.27
8.3.40.0040.01118.56
8.3.30.0000.01618.68
8.3.20.0040.00420.34
8.3.10.0080.00021.90
8.3.00.0080.00019.68
8.2.180.0070.01016.50
8.2.170.0000.01422.96
8.2.160.0070.00720.37
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0030.00517.50
8.2.110.0000.01122.20
8.2.100.0060.00619.51
8.2.90.0050.00319.05
8.2.80.0080.00017.97
8.2.70.0030.00617.63
8.2.60.0050.00317.80
8.2.50.0040.00418.07
8.2.40.0030.00621.07
8.2.30.0040.00418.02
8.2.20.0050.00317.69
8.2.10.0000.00717.95
8.2.00.0070.00017.89
8.1.280.0130.00725.92
8.1.270.0090.00020.32
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00323.66
8.1.230.0040.00822.82
8.1.220.0040.00417.74
8.1.210.0090.00018.77
8.1.200.0080.00017.23
8.1.190.0030.00817.00
8.1.180.0090.00018.10
8.1.170.0100.00018.53
8.1.160.0070.00022.15
8.1.150.0000.00718.76
8.1.140.0040.00417.28
8.1.130.0000.00717.59
8.1.120.0080.00017.30
8.1.110.0070.00317.44
8.1.100.0040.00417.30
8.1.90.0040.00417.42
8.1.80.0050.00317.29
8.1.70.0040.00417.30
8.1.60.0040.00417.63
8.1.50.0030.00617.48
8.1.40.0060.00317.56
8.1.30.0040.00417.63
8.1.20.0030.00517.59
8.1.10.0050.00317.48
8.1.00.0030.00617.38
8.0.300.0080.00018.77
8.0.290.0000.00716.75
8.0.280.0000.00718.36
8.0.270.0000.00716.71
8.0.260.0000.00717.13
8.0.250.0040.00416.93
8.0.240.0070.00316.82
8.0.230.0070.00016.86
8.0.220.0070.00016.86
8.0.210.0030.00316.76
8.0.200.0000.00716.89
8.0.190.0040.00416.90
8.0.180.0000.00816.85
8.0.170.0060.00316.82
8.0.160.0030.00316.74
8.0.150.0000.00716.77
8.0.140.0000.00716.87
8.0.130.0000.00613.34
8.0.120.0040.00416.71
8.0.110.0000.00716.86
8.0.100.0000.00716.73
8.0.90.0050.00316.79
8.0.80.0060.01016.82
8.0.70.0000.00716.86
8.0.60.0000.00716.74
8.0.50.0030.00516.73
8.0.30.0070.01317.02
8.0.20.0110.00717.40
8.0.10.0030.00516.91
8.0.00.0100.00816.78
7.4.330.0000.00615.08
7.4.320.0030.00316.45
7.4.300.0000.00616.43
7.4.290.0000.00716.56
7.4.280.0000.00716.64
7.4.270.0000.00716.61
7.4.260.0050.00216.61
7.4.250.0050.00316.51
7.4.240.0040.00316.49
7.4.230.0050.00316.54
7.4.220.0100.01616.55
7.4.210.0100.00516.54
7.4.200.0070.00016.60
7.4.160.0060.00916.52
7.4.150.0100.00717.40
7.4.140.0090.00917.86
7.4.130.0100.01016.58
7.4.120.0100.00816.52
7.4.110.0060.01016.63
7.4.100.0100.01416.72
7.4.90.0110.00816.47
7.4.80.0120.00619.39
7.4.70.0100.00716.62
7.4.60.0070.01016.34
7.4.50.0060.00316.20
7.4.40.0130.00716.45
7.4.30.0130.01016.67
7.4.00.0060.00914.78
7.3.330.0000.00613.26
7.3.320.0000.00513.22
7.3.310.0000.00716.14
7.3.300.0050.00316.20
7.3.290.0040.00416.29
7.3.280.0080.00716.24
7.3.270.0060.01217.40
7.3.260.0050.01316.16
7.3.250.0060.01216.27
7.3.240.0060.01016.21
7.3.230.0070.01016.48
7.3.210.0090.01216.23
7.3.200.0130.00319.39
7.3.190.0130.00316.21
7.3.180.0070.01116.38
7.3.170.0030.02016.32
7.3.160.0070.01016.33
7.3.10.0050.01416.07
7.3.00.0080.00416.01
7.2.330.0120.00616.67
7.2.320.0090.00916.75
7.2.310.0090.00616.41
7.2.300.0190.00316.48
7.2.290.0180.00016.62
7.2.130.0200.00016.06
7.2.120.0170.00316.74
7.2.110.0090.00916.08
7.2.100.0170.00016.38
7.2.90.0100.00316.77
7.2.80.0240.00916.61
7.2.70.0260.00616.55
7.2.60.0080.00716.94
7.2.50.0100.00216.89
7.2.40.0140.00616.64
7.2.30.0220.00616.28
7.2.20.0180.00816.23
7.2.10.0090.00916.39
7.2.00.0090.01018.15
7.1.250.0060.01015.13
7.1.200.0030.00615.73
7.1.100.0130.01318.07
7.1.70.0060.00917.19
7.1.60.0100.01420.03
7.1.50.0040.00716.86
7.1.00.0000.08022.50
7.0.200.0030.00616.48
7.0.60.0070.08319.88
7.0.50.0100.07717.87
7.0.40.0070.08020.11
7.0.30.0270.04320.09
7.0.20.0400.06020.12
7.0.10.0000.07020.30
7.0.00.0100.08020.21
5.6.280.0030.07021.14
5.6.210.0030.05020.52
5.6.200.0000.05318.19
5.6.190.0030.04320.42
5.6.180.0330.06320.46
5.6.170.0400.07020.40
5.6.160.0030.04020.61
5.6.150.0070.03718.18
5.6.140.0100.08318.14
5.6.130.0030.07718.23
5.6.120.0100.06320.89
5.6.110.0170.07721.12
5.6.100.0070.07720.98
5.6.90.0030.04020.99
5.6.80.0100.07720.39
5.5.350.0000.04320.47
5.5.340.0100.04718.00
5.5.330.0070.05720.42
5.5.320.0100.07720.35
5.5.310.0200.03720.34
5.5.300.0000.05017.97
5.5.290.0070.04018.06
5.5.280.0070.07020.87
5.5.270.0100.07720.86
5.5.260.0070.09020.77
5.5.250.0070.08020.69
5.5.240.0030.04720.16
5.4.450.0600.05319.46
5.4.440.0700.06319.61
5.4.430.0830.04319.59
5.4.420.0530.05719.63
5.4.410.0500.06019.18
5.4.400.0770.05019.16
5.4.390.0670.05719.36
5.4.380.0800.05018.84
5.4.370.0730.05719.29
5.4.360.0700.06719.26
5.4.350.0730.05319.30
5.4.340.0570.05718.84
5.4.320.0600.05718.84
5.4.310.0670.04719.06
5.4.300.0070.05319.15
5.4.290.0200.05019.01
5.4.280.0330.05318.86
5.4.270.0670.05719.37
5.4.260.0630.05318.88
5.4.250.0670.06319.00
5.4.240.0500.06718.97
5.4.230.0700.05718.85
5.4.220.0630.06019.37
5.4.210.0630.06319.08
5.4.200.0800.03016.72
5.4.190.0600.05319.11
5.4.180.0300.05319.07
5.4.170.0200.04318.98
5.4.160.0100.05018.97
5.4.150.0730.05319.10
5.4.140.0770.06316.36
5.4.130.0770.06016.34
5.4.120.0730.05716.38
5.4.110.0770.04716.33
5.4.100.0700.05316.44
5.4.90.0770.05316.36
5.4.80.0670.05016.46
5.4.70.0800.05716.35
5.4.60.0500.05316.39
5.4.50.0500.05316.45
5.4.40.0570.05016.36
5.4.30.0530.05016.41
5.4.20.0570.05316.28
5.4.10.0600.06316.35
5.4.00.0770.04015.75

preferences:
81.9 ms | 401 KiB | 5 Q