3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Math { const pi = 3.14; } class CircleMath extends Math { public static function calculateArea($radio) { return parent::pi * pow($radio, 2); } } class Circle { private $radio; private $color; private $coordinates; public function __construct($radio, $color = 'blue', $coordinates = array('x' => 0, 'y' => 0)) { $this->radio = $radio; $this->color = $color; $this->coordinates = $coordinates; } public function calculateArea() { return CircleMath::calculateArea($this->radio); } public function get_radio() { return $this->radio; } public function get_color() { return $this->color; } public function get_coordinates() { return $this->coordinates; } } $className = 'Circle'; $circle = new $className(5); echo sprintf('The area of %s circle with radio %s and center positioned in (%s, %s) is: %s', $circle->get_color(), $circle->get_radio(), $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.0000.01818.68
8.3.50.0080.01021.98
8.3.40.0030.01418.76
8.3.30.0100.00319.23
8.3.20.0040.00420.30
8.3.10.0030.00623.66
8.3.00.0050.00222.51
8.2.180.0090.00616.50
8.2.170.0140.00722.96
8.2.160.0130.00320.49
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0100.01026.16
8.2.120.0040.00422.31
8.2.110.0060.00322.07
8.2.100.0040.00717.84
8.2.90.0040.00419.22
8.2.80.0080.00017.97
8.2.70.0040.00417.49
8.2.60.0050.00318.03
8.2.50.0060.00318.07
8.2.40.0000.00818.34
8.2.30.0040.00418.07
8.2.20.0050.00317.78
8.2.10.0040.00419.46
8.2.00.0000.00817.63
8.1.280.0100.00325.92
8.1.270.0000.00822.06
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.72
8.1.230.0040.00819.01
8.1.220.0000.00817.79
8.1.210.0040.00418.77
8.1.200.0030.00617.38
8.1.190.0040.00417.54
8.1.180.0030.00518.10
8.1.170.0050.00318.49
8.1.160.0040.00422.07
8.1.150.0040.00418.65
8.1.140.0040.00417.40
8.1.130.0040.00417.82
8.1.120.0040.00417.39
8.1.110.0040.00417.33
8.1.100.0000.00717.36
8.1.90.0000.00717.46
8.1.80.0000.00717.45
8.1.70.0030.00317.37
8.1.60.0060.00317.62
8.1.50.0030.00617.56
8.1.40.0020.00517.50
8.1.30.0050.00317.48
8.1.20.0030.00517.50
8.1.10.0000.00717.61
8.1.00.0040.00417.56
8.0.300.0050.00518.77
8.0.290.0060.00317.28
8.0.280.0000.00718.37
8.0.270.0000.00717.27
8.0.260.0000.00616.82
8.0.250.0030.00316.86
8.0.240.0030.00517.03
8.0.230.0000.00716.99
8.0.220.0000.00716.93
8.0.210.0000.00716.84
8.0.200.0030.00316.83
8.0.190.0000.00716.96
8.0.180.0070.00016.93
8.0.170.0040.00416.81
8.0.160.0000.00716.89
8.0.150.0000.00716.81
8.0.140.0040.00316.83
8.0.130.0000.00513.31
8.0.120.0060.00316.88
8.0.110.0050.00316.80
8.0.100.0040.00416.95
8.0.90.0050.00216.88
8.0.80.0100.01016.89
8.0.70.0000.00716.96
8.0.60.0000.00816.86
8.0.50.0000.00716.93
8.0.30.0080.01117.16
8.0.20.0060.01217.40
8.0.10.0070.00016.90
8.0.00.0110.00816.79
7.4.330.0030.00315.02
7.4.320.0000.00616.63
7.4.300.0000.00716.59
7.4.290.0030.00316.42
7.4.280.0070.00016.64
7.4.270.0000.00716.53
7.4.260.0030.00616.50
7.4.250.0040.00416.47
7.4.240.0040.00416.52
7.4.230.0070.00016.40
7.4.220.0130.01316.60
7.4.210.0080.00916.63
7.4.200.0000.00716.33
7.4.190.0030.00516.73
7.4.160.0160.00016.35
7.4.150.0150.00317.40
7.4.140.0070.01017.86
7.4.130.0030.01516.52
7.4.120.0080.00816.51
7.4.110.0140.00316.63
7.4.100.0100.00716.47
7.4.90.0070.01116.40
7.4.80.0070.01019.39
7.4.70.0100.00616.71
7.4.60.0080.00816.57
7.4.50.0000.00416.31
7.4.40.0040.01522.77
7.4.30.0060.00916.58
7.4.00.0090.00615.09
7.3.330.0000.00513.13
7.3.320.0050.00013.11
7.3.310.0030.00316.38
7.3.300.0030.00316.25
7.3.290.0120.00416.41
7.3.280.0060.00916.38
7.3.270.0070.01017.40
7.3.260.0120.00616.57
7.3.250.0100.00816.38
7.3.240.0090.00916.39
7.3.230.0060.01016.60
7.3.210.0090.01316.70
7.3.200.0140.00719.39
7.3.190.0030.01416.36
7.3.180.0070.00916.59
7.3.170.0090.00716.57
7.3.160.0090.00616.62
7.3.120.0100.00714.93
7.2.330.0070.01116.50
7.2.320.0070.01416.67
7.2.310.0090.00916.80
7.2.300.0030.01516.68
7.2.290.0090.00616.61
7.2.00.0060.00619.11
7.1.200.0030.01015.86
7.1.100.0080.01118.15
7.1.70.0030.00917.15
7.1.60.0170.00719.29
7.1.50.0100.01417.04
7.1.00.0100.07022.31
7.0.200.0040.00916.88
7.0.140.0000.07721.92
7.0.60.0070.07719.80
7.0.50.0070.04017.92
7.0.40.0100.08320.40
7.0.30.0400.07020.21
7.0.20.0270.08720.09
7.0.10.0200.04020.07
7.0.00.0070.04720.09
5.6.280.0030.07320.79
5.6.210.0070.05020.51
5.6.200.0070.03718.22
5.6.190.0030.04320.57
5.6.180.0030.04320.47
5.6.170.0370.08020.59
5.6.160.0030.05320.61
5.6.150.0070.08318.18
5.6.140.0070.07018.13
5.6.130.0070.08318.27
5.6.120.0070.03721.05
5.6.110.0000.04721.01
5.6.100.0100.07720.86
5.6.90.0130.07720.98
5.6.80.0070.08020.59
5.6.70.0330.07020.29
5.5.350.0030.07020.33
5.5.340.0170.07317.96
5.5.330.0100.07720.57
5.5.320.0070.05720.49
5.5.310.0330.06720.19
5.5.300.0070.04717.96
5.5.290.0100.07717.98
5.5.280.0070.06720.89
5.5.270.0030.04720.77
5.5.260.0070.04320.86
5.5.250.0170.07320.56
5.5.240.0070.04020.36
5.4.450.0470.03719.27
5.4.440.0130.05719.47
5.4.430.0630.07719.18
5.4.420.0570.06019.45
5.4.410.0100.06019.42
5.4.400.0870.04719.39
5.4.390.0600.06019.29
5.4.380.0170.05018.70
5.4.370.0100.05718.82
5.4.360.0200.04318.79
5.4.350.0200.05018.84
5.4.340.0170.04718.77
5.4.320.0050.03912.52
5.4.310.0050.04012.51
5.4.300.0050.04312.52
5.4.290.0040.05112.51
5.4.280.0050.03712.41
5.4.270.0060.03612.41
5.4.260.0090.03712.41
5.4.250.0070.04012.40
5.4.240.0060.03712.40
5.4.230.0060.04012.40
5.4.220.0080.03312.40
5.4.210.0080.04112.40
5.4.200.0180.04712.38
5.4.190.0290.09512.38
5.4.180.0210.04212.38
5.4.170.0190.04512.39
5.4.160.0170.04712.39
5.4.150.0140.04912.38
5.4.140.0150.04412.06
5.4.130.0360.08912.05
5.4.120.0170.04112.01
5.4.110.0140.04512.00
5.4.100.0190.04012.00
5.4.90.0160.04312.00
5.4.80.0250.03512.01
5.4.70.0180.04112.00
5.4.60.0170.04012.00
5.4.50.0390.10312.00
5.4.40.0140.04511.99
5.4.30.0360.05711.99
5.4.20.0180.04111.98
5.4.10.0170.04711.98
5.4.00.0130.04511.47
5.3.290.0030.05212.80
5.3.280.0090.04212.71
5.3.270.0150.04812.72
5.3.260.0190.04612.72
5.3.250.0190.04712.72
5.3.240.0180.04412.72
5.3.230.0230.05012.71
5.3.220.0200.04712.68
5.3.210.0200.04712.68
5.3.200.0190.07312.68
5.3.190.0170.04612.68
5.3.180.0220.04812.67
5.3.170.0160.04912.67
5.3.160.0170.04912.68
5.3.150.0470.08112.67
5.3.140.0270.04212.66
5.3.130.0460.07812.66
5.3.120.0150.05412.66
5.3.110.0210.05212.66
5.3.100.0450.11812.12
5.3.90.0240.04912.10
5.3.80.0220.04212.07
5.3.70.0420.09012.07
5.3.60.0150.05212.06
5.3.50.0230.04512.01
5.3.40.0220.04912.01
5.3.30.0180.04111.98
5.3.20.0220.03911.76
5.3.10.0180.04211.72
5.3.00.0170.04311.70
5.2.170.0170.0339.21
5.2.160.0100.0399.20
5.2.150.0130.0369.21
5.2.140.0200.0299.20
5.2.130.0380.0699.16
5.2.120.0130.0339.16
5.2.110.0130.0359.18
5.2.100.0110.0379.18
5.2.90.0130.0359.18
5.2.80.0170.0309.16
5.2.70.0180.0329.16
5.2.60.0090.0409.12
5.2.50.0150.0319.09
5.2.40.0130.0349.07
5.2.30.0100.0369.04
5.2.20.0110.0359.04
5.2.10.0110.0348.94
5.2.00.0150.0298.79
5.1.60.0120.0288.07
5.1.50.0150.0268.07
5.1.40.0150.0248.07
5.1.30.0100.0338.41
5.1.20.0090.0358.44
5.1.10.0150.0298.15
5.1.00.0090.0328.15
5.0.50.0080.0266.64
5.0.40.0070.0266.50
5.0.30.0080.0386.31
5.0.20.0100.0226.30
5.0.10.0070.0246.27
5.0.00.0100.0336.27
4.4.90.0080.0164.78
4.4.80.0050.0204.75
4.4.70.0080.0174.75
4.4.60.0070.0184.75
4.4.50.0050.0204.77
4.4.40.0060.0294.71
4.4.30.0080.0174.76
4.4.20.0070.0174.84
4.4.10.0070.0184.85
4.4.00.0090.0564.76
4.3.110.0070.0174.67
4.3.100.0050.0194.66
4.3.90.0060.0184.63
4.3.80.0070.0284.58
4.3.70.0070.0174.63
4.3.60.0070.0174.63
4.3.50.0060.0184.63
4.3.40.0050.0284.54
4.3.30.0070.0163.30
4.3.20.0050.0183.27
4.3.10.0030.0213.24
4.3.00.0100.01313.43

preferences:
52.46 ms | 401 KiB | 5 Q