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('green'); 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.0080.00818.68
8.3.50.0100.01021.02
8.3.40.0110.01119.04
8.3.30.0120.00618.96
8.3.20.0080.00018.77
8.3.10.0040.00421.18
8.3.00.0090.00019.79
8.2.180.0110.00716.38
8.2.170.0090.00622.96
8.2.160.0070.01020.36
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0030.01021.03
8.2.110.0060.00322.14
8.2.100.0070.00417.62
8.2.90.0080.00019.34
8.2.80.0000.00819.19
8.2.70.0090.00017.48
8.2.60.0080.00017.93
8.2.50.0030.00618.07
8.2.40.0000.00818.34
8.2.30.0030.00621.21
8.2.20.0040.00417.68
8.2.10.0030.00717.72
8.2.00.0040.00417.70
8.1.280.0090.00625.92
8.1.270.0040.00423.99
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0000.00922.63
8.1.230.0040.00820.85
8.1.220.0000.00818.77
8.1.210.0030.00518.96
8.1.200.0060.00317.36
8.1.190.0030.00617.52
8.1.180.0000.00818.10
8.1.170.0080.00018.71
8.1.160.0000.00718.88
8.1.150.0050.00318.74
8.1.140.0040.00417.48
8.1.130.0000.00717.84
8.1.120.0080.00017.39
8.1.110.0050.00217.37
8.1.100.0000.00717.45
8.1.90.0040.00417.46
8.1.80.0050.00217.47
8.1.70.0030.00317.36
8.1.60.0080.00017.60
8.1.50.0040.00417.49
8.1.40.0000.00817.57
8.1.30.0040.00417.61
8.1.20.0080.00017.72
8.1.10.0000.00717.59
8.1.00.0000.00717.47
8.0.300.0030.00620.03
8.0.290.0070.00017.05
8.0.280.0000.00718.46
8.0.270.0000.00717.34
8.0.260.0000.00716.91
8.0.250.0040.00416.92
8.0.240.0060.00316.95
8.0.230.0070.00017.08
8.0.220.0030.00316.90
8.0.210.0000.01016.85
8.0.200.0030.00317.04
8.0.190.0030.00516.91
8.0.180.0050.00217.02
8.0.170.0000.00717.01
8.0.160.0030.00616.84
8.0.150.0000.00716.87
8.0.140.0040.00416.92
8.0.130.0030.00313.40
8.0.120.0030.00516.98
8.0.110.0040.00417.09
8.0.100.0050.00217.04
8.0.90.0080.00016.81
8.0.80.0130.00717.02
8.0.70.0040.00417.11
8.0.60.0040.00416.93
8.0.50.0030.00516.84
8.0.30.0080.01217.24
8.0.20.0150.00717.44
8.0.10.0000.00717.16
8.0.00.0090.00916.95
7.4.330.0020.00216.82
7.4.320.0000.00816.59
7.4.300.0000.00616.46
7.4.290.0070.00016.61
7.4.280.0040.00416.62
7.4.270.0070.00016.44
7.4.260.0060.00013.28
7.4.250.0040.00416.57
7.4.240.0030.00316.57
7.4.230.0030.00316.52
7.4.220.0140.01116.43
7.4.210.0070.00916.54
7.4.200.0000.00716.69
7.4.190.0030.00316.57
7.4.160.0130.00716.61
7.4.150.0080.01117.40
7.4.140.0100.00817.86
7.4.130.0070.01016.64
7.4.120.0100.00916.68
7.4.110.0090.00916.41
7.4.100.0140.00416.53
7.4.90.0070.01016.59
7.4.80.0100.01319.39
7.4.70.0100.00716.50
7.4.60.0030.01416.68
7.4.50.0000.00616.29
7.4.40.0000.01322.77
7.4.30.0060.01216.48
7.4.10.0170.00015.16
7.4.00.0070.00814.93
7.3.330.0060.00013.33
7.3.320.0000.00613.22
7.3.310.0000.00716.49
7.3.300.0070.00016.45
7.3.290.0090.00616.46
7.3.280.0110.00516.46
7.3.270.0070.01017.40
7.3.260.0110.00818.24
7.3.250.0080.01016.42
7.3.240.0160.00016.50
7.3.230.0090.00916.69
7.3.210.0130.00716.64
7.3.200.0060.00919.39
7.3.190.0140.00916.48
7.3.180.0090.00616.56
7.3.170.0060.01016.66
7.3.160.0080.00816.50
7.3.130.0070.01114.72
7.3.120.0030.01115.05
7.3.110.0040.01514.96
7.3.100.0040.01114.82
7.3.90.0040.01415.03
7.3.80.0060.00314.59
7.3.70.0030.01014.94
7.3.60.0100.00715.03
7.3.50.0070.00714.66
7.3.40.0090.00314.79
7.3.30.0060.00915.05
7.3.20.0090.00616.81
7.3.10.0030.01416.66
7.3.00.0120.00316.73
7.2.330.0080.00816.62
7.2.320.0060.01916.50
7.2.310.0090.00916.50
7.2.300.0110.00716.75
7.2.290.0060.01016.86
7.2.260.0030.01315.09
7.2.250.0090.00915.24
7.2.240.0000.01814.83
7.2.230.0000.01115.08
7.2.220.0060.01315.24
7.2.210.0040.01215.15
7.2.200.0000.00914.94
7.2.190.0120.00315.14
7.2.180.0040.00715.03
7.2.170.0030.01215.20
7.2.160.0000.00914.95
7.2.150.0130.00317.05
7.2.140.0040.00716.96
7.2.130.0040.00816.96
7.2.120.0080.00316.99
7.2.110.0060.00917.05
7.2.100.0060.01017.09
7.2.90.0030.01017.00
7.2.80.0070.01016.87
7.2.70.0070.00717.14
7.2.60.0060.00816.90
7.2.50.0040.00817.10
7.2.40.0030.00916.85
7.2.30.0070.01016.84
7.2.20.0070.00716.98
7.2.10.0080.00416.86
7.2.00.0060.00818.14
7.1.330.0000.01415.63
7.1.320.0040.01415.55
7.1.310.0040.00715.91
7.1.300.0080.00515.66
7.1.290.0030.00515.92
7.1.280.0090.00315.50
7.1.270.0060.00615.55
7.1.260.0060.00315.69
7.1.250.0000.00915.64
7.1.240.0100.00715.97
7.1.230.0070.01015.70
7.1.220.0110.00715.81
7.1.210.0040.01115.54
7.1.200.0000.01115.78
7.1.190.0000.01015.69
7.1.180.0040.00815.93
7.1.170.0000.01215.57
7.1.160.0040.00715.61
7.1.150.0040.01116.04
7.1.140.0030.00715.68
7.1.130.0000.01215.99
7.1.120.0070.00715.80
7.1.110.0000.01115.84
7.1.100.0070.01015.56
7.1.90.0060.00315.78
7.1.80.0070.00715.89
7.1.70.0060.00516.56
7.1.60.0070.00616.31
7.1.50.0050.00716.43
7.1.40.0070.00616.20
7.1.30.0020.00916.23
7.1.20.0040.00716.22
7.1.10.0070.00716.29
7.1.00.0070.00716.32
7.0.330.0000.01415.43
7.0.320.0030.01315.50
7.0.310.0070.00715.21
7.0.300.0060.00615.23
7.0.290.0100.00315.39
7.0.280.0030.01315.48
7.0.270.0070.00715.50
7.0.260.0070.00715.43
7.0.250.0130.00315.29
7.0.240.0000.01315.29
7.0.230.0070.00715.33
7.0.220.0030.01215.58
7.0.210.0030.00515.37
7.0.200.0060.00416.15
7.0.190.0020.00616.15
7.0.180.0020.00815.76
7.0.170.0050.00515.71
7.0.160.0030.00715.88
7.0.150.0090.00515.68
7.0.140.0070.00615.87
7.0.130.0030.00916.10
7.0.120.0020.01016.00
7.0.110.0020.00915.87
7.0.100.0060.00615.83
7.0.90.0000.00915.88
7.0.80.0030.00715.72
7.0.70.0040.00715.97
7.0.60.0050.00715.83
7.0.50.0060.00515.80
7.0.40.0010.00814.10
7.0.30.0060.00714.13
7.0.20.0030.00814.08
7.0.10.0050.00713.99
7.0.00.0030.01114.15
5.6.400.0090.00314.41
5.6.390.0030.01014.81
5.6.380.0100.00714.60
5.6.370.0040.01014.38
5.6.360.0000.00814.13
5.6.350.0040.00414.44
5.6.340.0100.00714.43
5.6.330.0040.00814.55
5.6.320.0110.00714.41
5.6.310.0030.00714.48
5.6.300.0050.02317.46
5.6.290.0000.02817.68
5.6.280.0030.03317.75
5.6.270.0070.02417.66
5.6.260.0050.02317.78
5.6.250.0000.02817.74
5.6.240.0080.02117.76
5.6.230.0020.02917.60
5.6.220.0020.03117.72
5.6.210.0020.02617.45
5.6.200.0020.03117.72
5.6.190.0030.02817.74
5.6.180.0050.02817.56
5.6.170.0050.02917.69
5.6.160.0030.03517.57
5.6.150.0070.03517.63
5.6.140.0050.02617.73
5.6.130.0050.02517.64
5.6.120.0050.02417.60
5.6.110.0050.02617.63
5.6.100.0030.02817.63
5.6.90.0060.02417.56
5.6.80.0000.02717.29
5.6.70.0050.02517.28
5.6.60.0080.02017.34
5.6.50.0040.02117.37
5.6.40.0050.02317.29
5.6.30.0070.02217.14
5.6.20.0050.02317.31
5.6.10.0030.02517.21
5.6.00.0050.02317.40
5.5.380.0050.02515.80
5.5.370.0050.02815.94
5.5.360.0060.02316.11
5.5.350.0060.03815.92
5.5.340.0030.02416.11
5.5.330.0110.02316.05
5.5.320.0050.02316.14
5.5.310.0040.02616.31
5.5.300.0070.02216.11
5.5.290.0050.02816.09
5.5.280.0030.03216.19
5.5.270.0050.02716.14
5.5.260.0030.02416.29
5.5.250.0080.02116.08
5.5.240.0050.02315.89
5.5.230.0020.03615.75
5.5.220.0030.02315.84
5.5.210.0030.02715.75
5.5.200.0040.02515.92
5.5.190.0040.02715.87
5.5.180.0030.02415.93
5.5.170.0040.00414.22
5.5.160.0020.02315.82
5.5.150.0030.02615.71
5.5.140.0050.02015.85
5.5.130.0040.03215.64
5.5.120.0080.02215.73
5.5.110.0030.02215.87
5.5.100.0020.02715.77
5.5.90.0020.02415.81
5.5.80.0040.02415.71
5.5.70.0050.02015.77
5.5.60.0000.02615.78
5.5.50.0080.02115.71
5.5.40.0020.02215.91
5.5.30.0030.02315.84
5.5.20.0030.02915.73
5.5.10.0030.02515.62
5.5.00.0030.02515.74
5.4.450.0050.02115.76
5.4.440.0000.02815.76
5.4.430.0040.02415.61
5.4.420.0030.02715.66
5.4.410.0030.02515.58
5.4.400.0090.02015.47
5.4.390.0020.02215.49
5.4.380.0060.02315.55
5.4.370.0030.02215.45
5.4.360.0030.02315.59
5.4.350.0030.02315.55
5.4.340.0030.02415.59
5.4.330.0000.00711.98
5.4.320.0020.03615.47
5.4.310.0050.02415.43
5.4.300.0030.03015.60
5.4.290.0060.02915.44
5.4.280.0050.02815.55
5.4.270.0020.03115.60
5.4.260.0000.02515.45
5.4.250.0010.02715.60
5.4.240.0020.02515.46
5.4.230.0020.02315.44
5.4.220.0030.02815.55
5.4.210.0020.02215.55
5.4.200.0050.02315.49
5.4.190.0040.02215.56
5.4.180.0020.02715.43
5.4.170.0070.01915.54
5.4.160.0020.02215.42
5.4.150.0020.02215.53
5.4.140.0060.02214.29
5.4.130.0040.02114.28
5.4.120.0050.02314.29
5.4.110.0050.03214.38
5.4.100.0050.02614.26
5.4.90.0020.02214.37
5.4.80.0000.02514.25
5.4.70.0040.02014.39
5.4.60.0000.02414.33
5.4.50.0040.02114.35
5.4.40.0050.03214.36
5.4.30.0020.03214.33
5.4.20.0050.03514.36
5.4.10.0050.03414.32
5.4.00.0090.02314.04
5.3.290.0050.02013.45
5.3.280.0010.02113.34
5.3.270.0020.02613.38
5.3.260.0050.01913.42
5.3.250.0070.01913.42
5.3.240.0050.02213.42
5.3.230.0070.02913.34
5.3.220.0110.01513.34
5.3.210.0050.03813.36
5.3.200.0050.02113.40
5.3.190.0070.01813.40
5.3.180.0050.02513.40
5.3.170.0030.02213.36
5.3.160.0040.03513.40
5.3.150.0060.03613.40
5.3.140.0050.02113.45
5.3.130.0030.04013.34
5.3.120.0030.02213.39
5.3.110.0050.02413.39
5.3.100.0060.02013.34
5.3.90.0020.02313.34
5.3.80.0020.02313.34
5.3.70.0030.02313.34
5.3.60.0020.02413.34
5.3.50.0020.02213.34
5.3.40.0030.02413.34
5.3.30.0050.02313.34
5.3.20.0040.03113.34
5.3.10.0040.02113.34
5.3.00.0060.02413.34
5.2.170.0030.02814.71
5.2.160.0090.02114.71
5.2.150.0030.03614.71
5.2.140.0030.03714.71
5.2.130.0000.03414.71
5.2.120.0130.02914.71
5.2.110.0070.02314.71
5.2.100.0030.05214.71
5.2.90.0030.02814.71
5.2.80.0000.03014.71
5.2.70.0000.05614.71
5.2.60.0030.04114.71
5.2.50.0030.02914.71
5.2.40.0000.03214.71
5.2.30.0100.03014.71
5.2.20.0000.03014.71
5.2.10.0000.03614.71
5.2.00.0030.02814.71
5.1.60.0060.02214.71
5.1.50.0000.02814.71
5.1.40.0300.03014.71
5.1.30.0000.03314.71
5.1.20.0000.02914.71
5.1.10.0070.02014.71
5.1.00.0030.02414.71
5.0.50.0000.02214.71
5.0.40.0030.02314.71
5.0.30.0030.03014.71
5.0.20.0030.02714.71
5.0.10.0000.02114.71
5.0.00.0030.02814.71
4.4.90.0000.03714.71
4.4.80.0000.01914.71
4.4.70.0000.01814.71
4.4.60.0030.02714.71
4.4.50.0030.01314.71
4.4.40.0070.02014.71
4.4.30.0000.01714.71
4.4.20.0110.01414.71
4.4.10.0000.01814.71
4.4.00.0030.02414.71
4.3.110.0000.01614.71
4.3.100.0000.01714.71
4.3.90.0000.01614.71
4.3.80.0030.02514.71
4.3.70.0000.02414.71
4.3.60.0000.01714.71
4.3.50.0000.01714.71
4.3.40.0000.02714.71
4.3.30.0000.01914.71
4.3.20.0030.01314.71
4.3.10.0030.01714.71
4.3.00.0060.01114.71

preferences:
54.2 ms | 401 KiB | 5 Q