3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Visitor { public final function __call(string $method, array $args) { if ($method === 'visit') { $class = substr(strrchr(static::class, '\\'), 1); $method .= $class; die(static::class); if (method_exists($this, $method)) { return call_user_func_array([$this, $method], $args); } } throw new Exception('Unknown method ' . $method); } } interface Visitable { public function accept(Visitor $v); } class FooVisitor extends Visitor { public function visitFoo(Foo $foo) { print 'visit Foo' . PHP_EOL; } } class Foo implements Visitable { public function accept(Visitor $v) { $v->visit($this); } } $fv = new FooVisitor(); $f = new Foo(); $f->accept($fv);

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.00716.50
8.3.50.0160.00921.99
8.3.40.0100.01019.00
8.3.30.0040.01418.86
8.3.20.0000.00720.29
8.3.10.0050.00321.85
8.3.00.0040.00421.01
8.2.180.0140.00716.63
8.2.170.0110.00422.96
8.2.160.0030.01019.06
8.2.150.0070.00025.66
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0040.00421.00
8.2.110.0160.00022.26
8.2.100.0000.01218.16
8.2.90.0030.00519.34
8.2.80.0040.00417.97
8.2.70.0030.00617.50
8.2.60.0100.00018.04
8.2.50.0030.00618.10
8.2.40.0040.00420.65
8.2.30.0070.00420.63
8.2.20.0040.00417.83
8.2.10.0040.00418.20
8.2.00.0040.00418.12
8.1.280.0100.00325.92
8.1.270.0000.00923.88
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.96
8.1.230.0040.00719.10
8.1.220.0000.00817.89
8.1.210.0060.00318.77
8.1.200.0030.00617.36
8.1.190.0060.00317.35
8.1.180.0090.00018.10
8.1.170.0030.00618.61
8.1.160.0040.00420.83
8.1.150.0050.00218.90
8.1.140.0040.00419.59
8.1.130.0070.00017.73
8.1.120.0040.00417.38
8.1.110.0000.00717.48
8.1.100.0040.00417.40
8.1.90.0000.00817.51
8.1.80.0040.00417.37
8.1.70.0000.00717.47
8.1.60.0000.00717.48
8.1.50.0050.00317.54
8.1.40.0050.00317.59
8.1.30.0030.00617.63
8.1.20.0080.00017.67
8.1.10.0040.00417.32
8.1.00.0040.00417.41
8.0.300.0000.01018.77
8.0.290.0000.00716.75
8.0.280.0000.00718.38
8.0.270.0000.00817.18
8.0.260.0040.00417.31
8.0.250.0030.00317.02
8.0.240.0000.00717.09
8.0.230.0030.00316.89
8.0.220.0000.00716.86
8.0.210.0040.00416.95
8.0.200.0000.00816.87
8.0.190.0040.00416.93
8.0.180.0040.00417.02
8.0.170.0030.00516.93
8.0.160.0050.00316.93
8.0.150.0030.00616.95
8.0.140.0050.00316.89
8.0.130.0030.00313.43
8.0.120.0050.00316.86
8.0.110.0000.00816.96
8.0.100.0000.00717.02
8.0.90.0040.00416.95
8.0.80.0060.00917.00
8.0.70.0030.00516.76
8.0.60.0000.00816.88
8.0.50.0070.00016.84
8.0.30.0110.00517.20
8.0.20.0130.00617.40
8.0.10.0040.00417.14
8.0.00.0100.01016.89
7.4.330.0050.00015.08
7.4.320.0040.00416.61
7.4.300.0000.00616.49
7.4.290.0080.00016.54
7.4.280.0000.00716.50
7.4.270.0000.00616.45
7.4.260.0030.00616.50
7.4.250.0070.00016.53
7.4.240.0030.00516.49
7.4.230.0030.00316.44
7.4.220.0120.00616.55
7.4.210.0120.00816.67
7.4.200.0040.00416.52
7.4.160.0130.00316.63
7.4.150.0110.00717.40
7.4.140.0110.01117.86
7.4.130.0140.00316.55
7.4.120.0070.01316.61
7.4.110.0120.00616.52
7.4.100.0090.00916.75
7.4.90.0120.01316.61
7.4.80.0110.00619.39
7.4.70.0160.00016.57
7.4.60.0110.00616.54
7.4.50.0070.01016.73
7.4.40.0060.01816.52
7.4.30.0130.00716.66
7.4.00.0070.01114.90
7.3.330.0000.00513.38
7.3.320.0060.00013.25
7.3.310.0030.00316.24
7.3.300.0000.00716.40
7.3.290.0070.01016.36
7.3.280.0080.01316.38
7.3.270.0090.00917.40
7.3.260.0100.00716.71
7.3.250.0150.00716.53
7.3.240.0130.00816.52
7.3.230.0180.00416.39
7.3.210.0150.00616.54
7.3.200.0130.00316.55
7.3.190.0100.01016.40
7.3.180.0070.01016.38
7.3.170.0060.01316.60
7.3.160.0030.01316.57
7.2.330.0120.00916.63
7.2.320.0120.01216.58
7.2.310.0100.00616.67
7.2.300.0110.00616.45
7.2.290.0080.00816.75
7.2.60.0000.01516.75
7.2.00.0090.00319.53
7.1.200.0000.00815.77
7.1.70.0040.00417.26
7.1.60.0070.00416.96
7.1.50.0150.00616.93
7.1.00.0100.07022.36
7.0.200.0000.00816.67
7.0.60.0000.04721.67
7.0.50.0030.07017.88
7.0.40.0170.05320.25
7.0.30.0600.04720.23
7.0.20.0500.05720.22
7.0.10.0470.06020.29
7.0.00.0570.06020.06
5.6.280.0030.07321.14
5.6.210.0100.06720.51
5.6.200.0070.08318.22
5.6.190.0330.05720.45
5.6.180.0200.05720.70
5.6.170.0470.05320.43
5.6.160.0370.06720.77
5.6.150.0470.05320.58
5.6.140.0370.06020.36
5.6.130.0370.06020.35
5.6.120.0130.05720.57
5.6.110.0130.05320.34
5.6.100.0230.05720.30
5.6.90.0570.06020.38
5.6.80.0430.06319.82
5.6.70.0130.06019.75
5.6.60.0470.04319.77
5.6.50.0070.06319.74
5.6.40.0330.06319.80
5.6.30.0430.04719.68
5.6.20.0300.07019.68
5.6.10.0200.06319.93
5.6.00.0230.05019.75
5.5.350.0070.09020.40
5.5.340.0030.04017.99
5.5.330.0500.05020.36
5.5.320.0530.06020.34
5.5.310.0430.05020.36
5.5.300.0400.06020.17
5.5.290.0370.06720.20
5.5.280.0200.06320.20
5.5.270.0100.06320.11
5.5.260.0530.06020.22
5.5.250.0530.05720.00
5.5.240.0570.04319.76
5.5.230.0170.05019.75
5.5.220.0300.05319.57
5.5.210.0270.05719.51
5.5.200.0100.05319.49
5.5.190.0170.05719.47
5.5.180.0130.06319.36
5.5.160.0200.04719.57
5.5.150.0230.04319.55
5.5.140.0030.06319.44
5.5.130.0200.04719.55
5.5.120.0070.06019.55
5.5.110.0100.05719.55
5.5.100.0130.05719.63
5.5.90.0070.06019.48
5.5.80.0100.06019.34
5.5.70.0200.05319.44
5.5.60.0070.06319.61
5.5.50.0170.05019.41
5.5.40.0200.04319.45
5.5.30.0230.04719.44
5.5.20.0170.06019.49
5.5.10.0130.07319.47
5.5.00.0400.06019.37

preferences:
58.21 ms | 401 KiB | 5 Q