3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ShapeFactory { public function __construct($type) { $shape = null; switch ($type){ case 'rectangle': $shape = new RectangleShape; break; case 'square': $shape = new SquareShape; break; default: return 'No such file'; } print_r($shape); return $shape->render(); } } interface Shape { public function render(); } class SquareShape implements Shape { public $name = 'square'; public function render() { return $this->name; } } class RectangleShape implements Shape { public $name = 'rectangle'; public function render() { echo $this->name; return $this->name; } } $test = new ShapeFactory(); echo $test;

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.01416.75
8.3.50.0080.01022.11
8.3.40.0150.00418.70
8.3.30.0110.00318.68
8.3.20.0070.00020.01
8.3.10.0040.00423.60
8.3.00.0080.00019.26
8.2.180.0070.01016.75
8.2.170.0070.00722.96
8.2.160.0040.01122.08
8.2.150.0080.00024.18
8.2.140.0000.00724.66
8.2.130.0120.00326.16
8.2.120.0040.00819.22
8.2.110.0070.00419.32
8.2.100.0040.00817.97
8.2.90.0080.00019.05
8.2.80.0050.00317.97
8.2.70.0000.00917.63
8.2.60.0070.00417.80
8.2.50.0050.00318.07
8.2.40.0000.00819.28
8.2.30.0000.00720.66
8.2.20.0000.00717.76
8.2.10.0000.00818.14
8.2.00.0080.00018.14
8.1.280.0100.00325.92
8.1.270.0000.00823.99
8.1.260.0060.00326.35
8.1.250.0000.00828.09
8.1.240.0030.00621.00
8.1.230.0070.00417.46
8.1.220.0080.00017.74
8.1.210.0060.00318.77
8.1.200.0000.00917.23
8.1.190.0030.00517.23
8.1.180.0040.00418.10
8.1.170.0000.00918.50
8.1.160.0040.00421.98
8.1.150.0040.00318.77
8.1.140.0000.00819.45
8.1.130.0000.00717.71
8.1.120.0000.00717.30
8.1.110.0080.00017.25
8.1.100.0030.00417.39
8.1.90.0000.00817.46
8.1.80.0070.00017.30
8.1.70.0000.00717.41
8.1.60.0040.00417.61
8.1.50.0040.00417.41
8.1.40.0040.00417.45
8.1.30.0050.00317.56
8.1.20.0050.00317.55
8.1.10.0040.00417.47
8.1.00.0060.00317.36
8.0.300.0000.00718.77
8.0.290.0000.00716.59
8.0.280.0070.00018.38
8.0.270.0060.00317.16
8.0.260.0060.00017.16
8.0.250.0050.00316.90
8.0.240.0000.00817.03
8.0.230.0030.00317.05
8.0.220.0040.00416.87
8.0.210.0080.00016.89
8.0.200.0000.00617.01
8.0.190.0050.00317.04
8.0.180.0040.00417.02
8.0.170.0090.00016.98
8.0.160.0060.00316.89
8.0.150.0050.00316.98
8.0.140.0030.00316.96
8.0.130.0000.00613.41
8.0.120.0040.00417.04
8.0.110.0050.00316.95
8.0.100.0000.00716.92
8.0.90.0040.00416.87
8.0.80.0070.00716.86
8.0.70.0070.00016.91
8.0.60.0000.00816.85
8.0.50.0030.00516.94
8.0.30.0120.00817.22
8.0.20.0090.00917.40
8.0.10.0080.00017.00
8.0.00.0090.00816.69
7.4.330.0000.00515.08
7.4.320.0030.00316.58
7.4.300.0060.00016.45
7.4.290.0070.00016.41
7.4.280.0040.00416.46
7.4.270.0070.00016.54
7.4.260.0000.00716.59
7.4.250.0050.00216.42
7.4.240.0020.00616.51
7.4.230.0030.00316.30
7.4.220.0070.01116.44
7.4.210.0100.00716.50
7.4.200.0000.00716.55
7.4.160.0080.00816.37
7.4.150.0140.00317.40
7.4.140.0110.01817.86
7.4.130.0130.00316.44
7.4.120.0100.00716.59
7.4.110.0100.00716.60
7.4.100.0110.00716.46
7.4.90.0030.01916.61
7.4.80.0130.00319.39
7.4.70.0030.01716.59
7.4.60.0060.01016.65
7.4.50.0000.00816.30
7.4.40.0070.01116.25
7.4.30.0090.00916.57
7.4.00.0030.01014.72
7.3.330.0020.00213.39
7.3.320.0000.00513.14
7.3.310.0000.00716.21
7.3.300.0030.00316.23
7.3.290.0030.01316.40
7.3.280.0080.01116.37
7.3.270.0200.00617.40
7.3.260.0120.00416.53
7.3.250.0090.00816.43
7.3.240.0100.01016.45
7.3.230.0050.01416.43
7.3.210.0120.00316.51
7.3.200.0140.00316.37
7.3.190.0030.01316.36
7.3.180.0090.00816.41
7.3.170.0030.01716.56
7.3.160.0060.00916.45
7.2.330.0070.01716.57
7.2.320.0140.00816.69
7.2.310.0070.01016.30
7.2.300.0060.01316.54
7.2.290.0080.00816.33
7.2.80.0090.00316.66
7.2.60.0070.00716.86
7.1.200.0070.00715.49
7.1.70.0040.00417.06
7.1.60.0030.02219.43
7.1.50.0100.00316.87
7.1.00.0070.07322.44
7.0.200.0800.00714.58
7.0.60.0100.08319.95
7.0.50.0070.08317.90
7.0.40.0070.05019.98
7.0.30.0270.05020.06
7.0.20.0330.07320.10
7.0.10.0100.08320.30
7.0.00.0030.06720.37
5.6.280.0070.05721.00
5.6.210.0070.08320.62
5.6.200.0030.08318.13
5.6.190.0000.04720.35
5.6.180.0230.05720.67
5.6.170.0170.04020.55
5.6.160.0100.08020.57
5.6.150.0030.08318.19
5.6.140.0070.03718.20
5.6.130.0030.05018.18
5.6.120.0100.07021.01
5.6.110.0030.08721.07
5.6.100.0130.07321.15
5.6.90.0100.07721.11
5.6.80.0070.06020.42
5.5.350.0370.07020.34
5.5.340.0070.08017.98
5.5.330.0100.08020.40
5.5.320.0500.06020.51
5.5.310.0230.05320.28
5.5.300.0130.04718.08
5.5.290.0030.08017.98
5.5.280.0100.08320.75
5.5.270.0030.08720.97
5.5.260.0100.08320.74
5.5.250.0200.07020.59
5.5.240.0030.07720.17
5.4.450.3130.04019.60
5.4.440.0070.08019.48
5.4.430.0500.03719.30
5.4.420.1670.04319.37
5.4.410.3100.03719.41
5.4.400.4000.03719.22
5.4.390.4130.04018.94
5.4.380.4070.04019.26
5.4.370.0070.07319.15
5.4.360.4730.03319.23
5.4.350.3800.03719.17
5.4.340.4070.03719.12
5.4.320.4070.04319.12
5.4.310.3200.03719.06
5.4.300.4330.03719.05
5.4.290.0030.07318.98
5.4.280.0070.03719.22
5.4.270.3670.03718.97
5.4.260.4070.04019.12
5.4.250.3970.03319.16
5.4.240.3870.03719.12
5.4.230.4100.03719.18
5.4.220.3700.03719.19
5.4.210.3700.04019.19
5.4.200.3700.03319.20
5.4.190.3470.03718.93
5.4.180.4200.03718.98
5.4.170.3900.04319.20
5.4.160.3800.03719.20
5.4.150.2470.03318.96
5.4.140.3430.03316.43
5.4.130.4100.03016.38
5.4.120.3800.03316.47
5.4.110.3570.03716.53
5.4.100.3800.04016.41
5.4.90.3500.03716.56

preferences:
35.14 ms | 401 KiB | 5 Q