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 = 1.0; private $color = 'white'; private $coordinates = array('x' => 0, 'y' => 0); public function __construct() { $args = func_get_args(); foreach ($args as $arg) { if (is_numeric($arg)) { $this->radius = doubleval($arg); } else if (is_string($arg)) { $this->color = $arg; } else if (is_array()) { $this->coordinates = $arg; } } } 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.40.0000.01518.85
8.3.30.0070.01020.56
8.3.20.0080.00019.02
8.3.10.0080.00021.30
8.3.00.0080.00819.90
8.2.170.0110.00722.96
8.2.160.0070.00720.64
8.2.150.0080.00024.18
8.2.140.0070.00024.66
8.2.130.0140.00326.16
8.2.120.0060.00321.37
8.2.110.0030.00622.52
8.2.100.0090.00317.97
8.2.90.0030.00519.46
8.2.80.0040.00419.46
8.2.70.0060.00317.75
8.2.60.0060.00318.28
8.2.50.0000.00818.13
8.2.40.0090.00018.47
8.2.30.0040.00421.42
8.2.20.0000.00717.84
8.2.10.0040.00417.91
8.2.00.0000.00918.03
8.1.270.0000.00723.99
8.1.260.0140.00326.35
8.1.250.0050.00328.09
8.1.240.0040.00820.96
8.1.230.0040.00821.22
8.1.220.0040.00418.77
8.1.210.0040.00419.09
8.1.200.0100.00017.48
8.1.190.0000.00717.66
8.1.180.0030.00618.10
8.1.170.0050.00318.82
8.1.160.0000.00719.17
8.1.150.0050.00718.93
8.1.140.0000.00717.74
8.1.130.0000.00718.00
8.1.120.0040.00417.62
8.1.110.0000.01017.64
8.1.100.0040.00417.55
8.1.90.0030.00517.79
8.1.80.0040.00417.69
8.1.70.0030.00317.75
8.1.60.0060.00317.91
8.1.50.0050.00217.70
8.1.40.0000.00917.75
8.1.30.0040.00417.76
8.1.20.0000.00917.83
8.1.10.0000.00817.81
8.1.00.0000.00717.68
8.0.300.0060.00320.23
8.0.290.0070.00017.43
8.0.280.0000.00718.66
8.0.270.0070.00017.55
8.0.260.0000.00717.16
8.0.250.0000.00817.08
8.0.240.0000.00817.24
8.0.230.0030.00317.10
8.0.220.0060.00317.05
8.0.210.0080.00017.11
8.0.200.0000.00617.21
8.0.190.0000.00817.12
8.0.180.0040.00417.11
8.0.170.0050.00217.14
8.0.160.0070.00417.13
8.0.150.0070.00017.05
8.0.140.0000.00717.12
8.0.130.0000.00513.58
8.0.120.0040.00417.07
8.0.110.0040.00416.91
8.0.100.0030.00517.06
8.0.90.0000.00817.11
8.0.80.0070.00717.07
8.0.70.0000.00716.98
8.0.60.0040.00417.11
8.0.50.0000.00717.03
8.0.30.0110.00817.25
8.0.20.0100.00917.40
8.0.10.0070.00017.32
8.0.00.0070.01016.93
7.4.330.0040.00016.95
7.4.320.0040.00416.76
7.4.300.0000.00616.71
7.4.290.0050.00316.89
7.4.280.0000.00716.79
7.4.270.0030.00316.79
7.4.260.0060.00013.50
7.4.250.0030.00516.62
7.4.240.0040.00416.85
7.4.230.0080.00016.73
7.4.220.0090.00916.57
7.4.210.0070.00716.68
7.4.200.0040.00416.89
7.4.190.0070.00016.91
7.4.160.0100.00716.46
7.4.150.0100.01017.40
7.4.140.0100.01217.86
7.4.130.0140.01216.60
7.4.120.0110.00916.59
7.4.110.0120.00816.66
7.4.100.0130.01016.54
7.4.90.0060.01216.59
7.4.80.0120.00919.39
7.4.70.0140.00316.68
7.4.60.0110.01116.58
7.4.50.0060.00316.41
7.4.40.0100.00722.77
7.4.30.0140.01016.63
7.4.00.0070.01115.02
7.3.330.0000.00613.66
7.3.320.0000.00513.46
7.3.310.0000.00716.64
7.3.300.0050.00216.58
7.3.290.0000.01916.47
7.3.280.0100.00716.42
7.3.270.0160.00317.40
7.3.260.0120.00718.24
7.3.250.0150.01316.60
7.3.240.0080.00816.55
7.3.230.0140.00316.65
7.3.210.0110.00716.88
7.3.200.0150.00919.39
7.3.190.0050.01616.46
7.3.180.0100.00816.70
7.3.170.0110.00416.57
7.3.160.0030.01716.68
7.3.120.0050.00814.94
7.3.110.0090.00915.14
7.3.100.0000.01414.67
7.3.90.0070.00714.84
7.3.80.0070.00715.12
7.3.70.0090.00614.98
7.3.60.0000.01115.07
7.3.50.0080.00415.04
7.3.40.0100.00314.88
7.3.30.0030.01214.87
7.3.20.0090.00416.66
7.3.10.0120.00016.86
7.3.00.0070.00716.43
7.2.330.0090.00916.95
7.2.320.0170.00716.57
7.2.310.0120.00916.55
7.2.300.0070.01016.72
7.2.290.0060.01016.80
7.2.250.0060.01214.74
7.2.240.0030.01315.33
7.2.230.0000.01215.40
7.2.220.0060.00915.26
7.2.210.0100.00315.01
7.2.200.0070.00715.34
7.2.190.0000.01115.25
7.2.180.0100.00315.21
7.2.170.0060.00915.14
7.2.60.0120.00317.20
7.2.00.0000.01419.45
7.1.330.0040.01116.09
7.1.320.0070.00716.16
7.1.310.0130.00315.78
7.1.300.0030.01016.13
7.1.290.0000.01115.97
7.1.280.0060.01215.98
7.1.270.0060.00315.99
7.1.260.0110.00016.01
7.1.200.0080.00415.76
7.1.100.0060.00817.94
7.1.70.0040.00417.27
7.1.60.0070.00717.12
7.1.50.0070.01317.11
7.1.00.0000.06022.55
7.0.200.0140.00317.04
7.0.140.0000.07322.23
7.0.110.0670.07320.13
7.0.100.0670.08020.07
7.0.90.0430.04719.96
7.0.80.0670.02720.11
7.0.70.0500.08019.95
7.0.60.0670.06720.14
7.0.50.0500.05720.61
7.0.40.0030.08020.36
7.0.30.0070.09020.38
7.0.20.0130.08320.40
7.0.10.0130.07320.36
7.0.00.0170.06320.22
5.6.280.0000.07721.23
5.6.260.0070.07320.72
5.6.250.0130.07720.76
5.6.240.0030.07320.86
5.6.230.0070.06720.66
5.6.220.0200.06320.84
5.6.210.0100.07720.75
5.6.200.0100.06321.33
5.6.190.0070.06721.23
5.6.180.0130.05721.19
5.6.170.0070.08321.20
5.6.160.0100.07721.13
5.6.150.0130.07721.32
5.6.140.0100.05321.10
5.6.130.0100.08321.20
5.6.120.0100.07721.31
5.6.110.0070.08321.18
5.6.100.0100.07721.30
5.6.90.0030.06021.20
5.6.80.0200.07020.57
5.6.70.0100.07720.50
5.6.60.0000.06720.47
5.6.50.0070.08020.65
5.6.40.0100.05020.43
5.6.30.0100.07320.55
5.6.20.0070.06320.58
5.6.10.0070.08020.54
5.6.00.0070.06020.56
5.5.380.0130.07720.68
5.5.370.0030.05020.60
5.5.360.0200.07020.63
5.5.350.0070.08020.64
5.5.340.0130.07020.95
5.5.330.0130.07320.99
5.5.320.0000.08721.06
5.5.310.0070.08021.01
5.5.300.0030.08320.98
5.5.290.0130.08020.98
5.5.280.0070.08020.98
5.5.270.0030.08721.12
5.5.260.0100.08020.87
5.5.250.0130.07020.93
5.5.240.0030.07720.45
5.5.230.0070.08320.33
5.5.220.0100.08320.48
5.5.210.0130.07020.39
5.5.200.0070.04720.48
5.5.190.0000.07320.51
5.5.180.0000.04320.47
5.5.160.0070.04320.42
5.5.150.0100.06720.51
5.5.140.0100.07720.47
5.5.130.0130.07720.39
5.5.120.0130.07320.46
5.5.110.0130.06720.26
5.5.100.0130.07320.22
5.5.90.0000.05020.22
5.5.80.0130.06320.31
5.5.70.0030.05020.19
5.5.60.0030.07020.36
5.5.50.0000.04020.13
5.5.40.0030.03720.38
5.5.30.0070.03720.29
5.5.20.0100.03720.36
5.5.10.0030.03720.31
5.5.00.0000.04320.04
5.4.450.0030.08719.46
5.4.440.0070.08319.77
5.4.430.0070.07719.78
5.4.420.0000.08019.41
5.4.410.0070.07019.30
5.4.400.0170.06719.36
5.4.390.0100.07319.19
5.4.380.0170.07019.16
5.4.370.0070.05319.13
5.4.360.0070.08319.21
5.4.350.0070.06319.32
5.4.340.0100.07019.44
5.4.320.0070.08019.24
5.4.310.0070.04719.07
5.4.300.0130.07019.35
5.4.290.0030.07719.21
5.4.280.0130.06719.30
5.4.270.0030.07719.11
5.4.260.0130.04019.43
5.4.250.0130.04019.15
5.4.240.0030.04319.35
5.4.230.0030.04019.21
5.4.220.0070.07019.21
5.4.210.0070.04319.07
5.4.200.0100.03319.11
5.4.190.0000.04019.45
5.4.180.0070.03319.08
5.4.170.0030.04019.06
5.4.160.0030.03719.42
5.4.150.0100.05019.05
5.4.140.0000.04316.65
5.4.130.0000.03716.73
5.4.120.0070.04316.62
5.4.110.0070.05316.56
5.4.100.0070.05316.66
5.4.90.0030.06016.66
5.4.80.0030.04016.52
5.4.70.0030.04016.61
5.4.60.0130.06316.65
5.4.50.0030.03316.80
5.4.40.0030.05316.41
5.4.30.0070.06016.68
5.4.20.0030.03716.50
5.4.10.0030.07016.71
5.4.00.0030.04015.84
5.3.290.0070.07714.82
5.3.280.0000.05714.62
5.3.270.0000.04314.77
5.3.260.0030.03714.61
5.3.250.0000.04014.70
5.3.240.0000.06314.62
5.3.230.0000.04314.83
5.3.220.0030.05014.59
5.3.210.0100.07314.80
5.3.200.0030.07314.59
5.3.190.0000.06314.61
5.3.180.0130.07714.58
5.3.170.0030.03714.70
5.3.160.0100.04014.80
5.3.150.0000.04014.56
5.3.140.0030.06714.59
5.3.130.0070.04014.61
5.3.120.0000.05314.57
5.3.110.0000.04014.53
5.3.100.0000.04014.06
5.3.90.0070.03314.03
5.3.80.0070.05013.89
5.3.70.0000.03714.05
5.3.60.0030.04314.11
5.3.50.0030.03713.97
5.3.40.0070.03314.05
5.3.30.0000.03713.96
5.3.20.0000.04013.70
5.3.10.0030.04713.66
5.3.00.0000.03713.71
5.2.170.0030.03711.86
5.2.160.0030.03011.86
5.2.150.0070.03711.86
5.2.140.0000.03011.86
5.2.130.0030.04011.86
5.2.120.0000.03311.86
5.2.110.0000.03011.86
5.2.100.0030.04311.86
5.2.90.0000.03011.86
5.2.80.0000.03011.86
5.2.70.0030.02711.86
5.2.60.0030.02711.86
5.2.50.0000.03311.86
5.2.40.0000.03311.86
5.2.30.0000.03711.86
5.2.20.0070.02311.86
5.2.10.0030.02711.86
5.2.00.0030.02711.86
5.1.60.0100.01711.86
5.1.50.0000.03311.86
5.1.40.0070.04711.86
5.1.30.0000.02711.86
5.1.20.0030.04311.86
5.1.10.0030.02711.86
5.1.00.0000.05711.86
5.0.50.0070.04311.86
5.0.40.0000.04311.86
5.0.30.0070.06011.86
5.0.20.0000.03311.86
5.0.10.0100.03311.86
5.0.00.0070.02711.86
4.4.90.0000.01711.86
4.4.80.0000.01711.86
4.4.70.0030.01311.86
4.4.60.0030.01311.86
4.4.50.0000.01711.86
4.4.40.0000.04011.86
4.4.30.0070.01011.86
4.4.20.0100.02011.86
4.4.10.0030.03311.86
4.4.00.0030.04311.86
4.3.110.0000.03711.86
4.3.100.0030.03311.86
4.3.90.0070.03011.86
4.3.80.0070.03711.86
4.3.70.0000.03711.86
4.3.60.0030.03311.86
4.3.50.0030.02011.86
4.3.40.0030.04311.86
4.3.30.0000.03311.86
4.3.20.0030.02711.86
4.3.10.0000.02711.86
4.3.00.0000.03311.86

preferences:
41.64 ms | 400 KiB | 5 Q