3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Math { const pi = 3.14; } class CircleMath extends Math { public static function calculateArea($radius) { return parent::pi * pow($radius, 2); } } class Circle { private $radius; private $color; private $coordinates; public function __construct() { $numArgs = func_num_args(); $this->radius = $numArgs > 0 ? func_get_arg(0) : 1.0; $this->color = $numArgs > 1 ? func_get_arg(1) : 'blue'; $this->coordinates = $numArgs > 2 ? func_get_arg(2) : array('x' => 1, 'y' => 1); } public function calculateArea() { return CircleMath::calculateArea($this->radius); } public function get_radius() { return $this->radius; } public function get_color() { return $this->color; } public function get_coordinates() { return $this->coordinates; } } $className = 'Circle'; $circle = new $className(); print sprintf('The area of %s circle with radius %s and center positioned in (%s, %s) is: %s', $circle->get_color(), $circle->get_radius(), $circle->get_coordinates()['x'], $circle->get_coordinates()['y'], $circle->calculateArea()); ?>

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.0090.00918.55
8.3.50.0090.00821.40
8.3.40.0090.00618.95
8.3.30.0120.00618.82
8.3.20.0040.00418.85
8.3.10.0000.00821.03
8.3.00.0080.00020.06
8.2.180.0030.01417.00
8.2.170.0100.01322.96
8.2.160.0100.00720.60
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00721.20
8.2.110.0060.00322.49
8.2.100.0060.00618.09
8.2.90.0050.00319.61
8.2.80.0000.00719.71
8.2.70.0040.00417.86
8.2.60.0040.00418.04
8.2.50.0000.00818.07
8.2.40.0000.00818.53
8.2.30.0050.00221.52
8.2.20.0060.00317.98
8.2.10.0040.00417.98
8.2.00.0000.00817.92
8.1.280.0070.00725.92
8.1.270.0050.00323.99
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00622.83
8.1.230.0070.00321.22
8.1.220.0000.00818.77
8.1.210.0000.00819.09
8.1.200.0030.00617.73
8.1.190.0000.00817.68
8.1.180.0060.00318.10
8.1.170.0080.00018.91
8.1.160.0070.00019.17
8.1.150.0000.00718.95
8.1.140.0070.00017.74
8.1.130.0000.00718.05
8.1.120.0000.00717.75
8.1.110.0040.00417.73
8.1.100.0040.00417.71
8.1.90.0030.00617.68
8.1.80.0030.00517.59
8.1.70.0030.00317.57
8.1.60.0090.00017.80
8.1.50.0040.00417.70
8.1.40.0040.00417.64
8.1.30.0040.00417.82
8.1.20.0050.00317.74
8.1.10.0000.00817.82
8.1.00.0030.00617.81
8.0.300.0030.00620.27
8.0.290.0070.00017.43
8.0.280.0000.00718.73
8.0.270.0050.00217.42
8.0.260.0030.00317.08
8.0.250.0060.00317.25
8.0.240.0040.00417.18
8.0.230.0040.00417.20
8.0.220.0040.00417.13
8.0.210.0100.00017.07
8.0.200.0000.00617.22
8.0.190.0040.00417.05
8.0.180.0050.00317.16
8.0.170.0000.00717.17
8.0.160.0070.00317.16
8.0.150.0000.00717.16
8.0.140.0040.00417.04
8.0.130.0000.00513.62
8.0.120.0000.00817.11
8.0.110.0040.00417.07
8.0.100.0050.00317.20
8.0.90.0000.00717.11
8.0.80.0040.00316.96
8.0.70.0040.00417.11
8.0.60.0040.00417.15
8.0.50.0080.00017.09
8.0.30.0080.01117.22
8.0.20.0150.00317.46
8.0.10.0060.00317.13
8.0.00.0130.00816.90
7.4.330.0000.00517.11
7.4.320.0050.00216.74
7.4.300.0000.00616.81
7.4.290.0000.00716.80
7.4.280.0030.00316.70
7.4.270.0000.00716.82
7.4.260.0030.00313.61
7.4.250.0070.00016.81
7.4.240.0030.00316.91
7.4.230.0040.00416.55
7.4.220.0100.01616.67
7.4.210.0080.00716.75
7.4.200.0000.00816.89
7.4.190.0000.00716.68
7.4.160.0060.00916.87
7.4.150.0070.01117.40
7.4.140.0120.00817.86
7.4.130.0130.00616.60
7.4.120.0100.00816.69
7.4.110.0100.01316.61
7.4.100.0120.00616.82
7.4.90.0030.01416.78
7.4.80.0110.00619.39
7.4.70.0140.00316.52
7.4.60.0030.02016.52
7.4.50.0040.00416.89
7.4.40.0070.00722.77
7.4.30.0110.00916.68
7.4.00.0040.01114.98
7.3.330.0050.00013.61
7.3.320.0060.00013.66
7.3.310.0000.00716.67
7.3.300.0040.00416.61
7.3.290.0140.00016.48
7.3.280.0100.00616.50
7.3.270.0150.00617.40
7.3.260.0120.00718.24
7.3.250.0080.01016.58
7.3.240.0080.00816.61
7.3.230.0100.00716.53
7.3.210.0100.00716.36
7.3.200.0100.00619.39
7.3.190.0120.01216.76
7.3.180.0090.01216.37
7.3.170.0120.00416.52
7.3.160.0080.00816.57
7.3.120.0080.00815.05
7.2.330.0130.00316.92
7.2.320.0120.01217.02
7.2.310.0090.01316.88
7.2.300.0070.01116.88
7.2.290.0060.01016.53
7.2.00.0070.00719.57
7.1.100.0110.00418.06
7.1.70.0000.00817.31
7.1.60.0000.01017.27
7.1.50.0000.01117.19
7.1.40.0090.00917.11
7.1.30.0070.01117.11
7.1.20.0030.01617.11
7.1.10.0030.00617.11
7.1.00.0050.00217.11
7.0.200.0000.00717.11
7.0.190.0040.00917.11
7.0.180.0030.01217.11
7.0.170.0100.00717.11
7.0.160.0060.00617.11
7.0.150.0040.00417.11
7.0.140.0020.00517.11
7.0.130.0000.00817.11
7.0.120.0000.00817.11
7.0.110.0000.00917.11
7.0.100.0070.00317.11
7.0.90.0040.00417.11
7.0.80.0040.00417.11
7.0.70.0030.00517.11
7.0.60.0040.00417.11
7.0.50.0000.01017.11
7.0.40.0080.00317.11
7.0.30.0040.01117.11
7.0.20.0000.00717.11
7.0.10.0030.01117.11
7.0.00.0000.00717.11
5.6.300.0070.04020.64
5.6.290.0000.04720.87
5.6.280.0000.04721.14
5.6.270.0070.04721.05
5.6.260.0070.04720.99
5.6.250.0000.04420.99
5.6.240.0000.04921.05
5.6.230.0000.04820.91
5.6.220.0000.04620.89
5.6.210.0040.03921.19
5.6.200.0070.05020.94
5.6.190.0000.04520.90
5.6.180.0030.08620.98
5.6.170.0030.04121.05
5.6.160.0170.03420.91
5.6.150.0070.06720.94
5.6.140.0270.04320.83
5.6.130.0000.04821.12
5.6.120.0110.03521.04
5.6.110.0030.04621.11
5.6.100.0000.05021.04
5.6.90.0030.04420.99
5.6.80.0000.04620.50
5.6.70.0100.06420.38
5.6.60.0030.04920.20
5.6.50.0070.03620.29
5.6.40.0060.03520.26
5.6.30.0090.03420.48
5.6.20.0030.04120.40
5.6.10.0120.03120.36
5.6.00.0100.03320.23
5.5.380.0100.03617.76
5.5.370.0070.04617.51
5.5.360.0030.04317.57
5.5.350.0140.03817.53
5.5.340.0030.04117.88
5.5.330.0070.05918.18
5.5.320.0030.07317.88
5.5.310.0030.07818.18
5.5.300.0000.04518.13
5.5.290.0030.05317.78
5.5.280.0030.04118.11
5.5.270.0000.05418.00
5.5.260.0060.05518.01
5.5.250.0030.04017.85
5.5.240.0000.04017.16
5.5.230.0070.04217.53
5.5.220.0070.03817.39
5.5.210.0030.03817.26
5.5.200.0030.04117.46
5.5.190.0030.04017.53
5.5.180.0030.03917.37
5.5.160.0070.03617.13
5.5.150.0040.04217.11
5.5.140.0070.04017.49
5.5.130.0030.04017.36
5.5.120.0030.04417.22
5.5.110.0070.03517.48
5.5.100.0000.04517.27
5.5.90.0000.04717.11
5.5.80.0190.04217.35
5.5.70.0060.03717.36
5.5.60.0160.03617.11
5.5.50.0000.04317.12
5.5.40.0070.03317.34
5.5.30.0030.03817.11
5.5.20.0000.05017.28
5.5.10.0070.03317.41
5.5.00.0070.05017.11
5.4.450.0130.06519.36
5.4.440.0130.03319.55
5.4.430.0060.03819.27
5.4.420.0060.05819.63
5.4.410.0230.04319.25
5.4.400.0030.03619.29
5.4.390.0030.05418.93
5.4.380.0070.03618.98
5.4.370.0030.03719.17
5.4.360.0000.05318.96
5.4.350.0030.04219.29
5.4.340.0070.03619.29
5.4.320.0030.04619.16
5.4.310.0030.03919.07
5.4.300.0200.04018.95
5.4.290.0030.03818.96
5.4.280.0030.04319.07
5.4.270.0070.03719.05
5.4.260.0030.04119.16
5.4.250.0070.04019.21
5.4.240.0070.03719.09
5.4.230.0160.03919.05
5.4.220.0030.04119.16
5.4.210.0000.03918.98
5.4.200.0070.03818.93
5.4.190.0030.04419.18
5.4.180.0000.04318.97
5.4.170.0240.04119.05
5.4.160.0100.03319.29
5.4.150.0130.04719.15
5.4.140.0030.06217.11
5.4.130.0030.03317.11
5.4.120.0030.03617.11
5.4.110.0070.03717.11
5.4.100.0030.03417.11
5.4.90.0000.04117.11
5.4.80.0100.03617.11
5.4.70.0030.03317.11
5.4.60.0030.03517.11
5.4.50.0030.03417.11
5.4.40.0070.03317.11
5.4.30.0030.03717.11
5.4.20.0030.03317.11
5.4.10.0000.04217.11
5.4.00.0170.02717.11
5.3.290.0000.04317.11
5.3.280.0140.02517.11
5.3.270.0040.03917.11
5.3.260.0000.04317.11
5.3.250.0040.03917.11
5.3.240.0030.04317.11
5.3.230.0030.03917.11
5.3.220.0030.04417.11
5.3.210.0030.04117.11
5.3.200.0000.04317.11
5.3.190.0000.03917.11
5.3.180.0030.03717.11
5.3.170.0000.03817.11
5.3.160.0030.03517.11
5.3.150.0060.03217.11
5.3.140.0030.03617.11
5.3.130.0070.05317.11
5.3.120.0030.03917.11
5.3.110.0100.03417.11
5.3.100.0000.06717.11
5.3.90.0000.04417.11
5.3.80.0100.02917.11
5.3.70.0030.06717.11
5.3.60.0070.03017.11
5.3.50.0000.05617.11
5.3.40.0030.03317.11
5.3.30.0030.06017.11
5.3.20.0070.07117.11
5.3.10.0000.03617.11
5.3.00.0070.03817.11
5.2.170.0030.03417.11
5.2.160.0030.05717.11
5.2.150.0000.03417.11
5.2.140.0030.06817.11
5.2.130.0000.03917.11
5.2.120.0030.02717.11
5.2.110.0040.02917.11
5.2.100.0070.02517.11
5.2.90.0060.02517.11
5.2.80.0030.03117.11
5.2.70.0030.02917.11
5.2.60.0030.04317.11
5.2.50.0030.05617.11
5.2.40.0030.03117.11
5.2.30.0060.04817.11
5.2.20.0030.02917.11
5.2.10.0030.03317.11
5.2.00.0030.05217.11
5.1.60.0030.03217.11
5.1.50.0030.05317.11
5.1.40.0060.02117.11
5.1.30.0000.03417.11
5.1.20.0040.02817.11
5.1.10.0000.03317.11
5.1.00.0030.02717.11
5.0.50.0060.03317.11
5.0.40.0120.04017.11
5.0.30.0070.02717.11
5.0.20.0060.03117.11
5.0.10.0070.01817.11
5.0.00.0000.03417.11
4.4.90.0070.01017.11
4.4.80.0040.03517.11
4.4.70.0030.02417.11
4.4.60.0000.02717.11
4.4.50.0040.01417.11
4.4.40.0030.04817.11
4.4.30.0030.03517.11
4.4.20.0000.01817.11
4.4.10.0090.02817.11
4.4.00.0030.04417.11
4.3.110.0060.01917.11
4.3.100.0060.02817.11
4.3.90.0060.01917.11
4.3.80.0000.02817.11
4.3.70.0030.02017.11
4.3.60.0030.01417.11
4.3.50.0030.03917.11
4.3.40.0040.02517.11
4.3.30.0030.01617.11
4.3.20.0000.02217.11
4.3.10.0000.01817.11
4.3.00.0000.01817.11

preferences:
41.04 ms | 401 KiB | 5 Q