3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface EntityInterface { } class EntityDecorator implements EntityInterface { public $subject; public function __construct(EntityInterface $subject) { $this->subject = $subject instanceof static ? $subject->getEntity() : $subject; } public function getEntity() { return $this->subject; } } class Entity implements EntityInterface {} class DecoratorA extends EntityDecorator {} class DecoratorB extends EntityDecorator {} $entity = new Entity(); var_dump($entity); $a = new DecoratorA($entity); var_dump($a); $b = new DecoratorB($a); var_dump($b); $b2 = new DecoratorB($b); var_dump($b2); $a2 = new DecoratorA($b2); var_dump($a2);

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.70.0090.00616.58
8.3.60.0090.00618.25
8.3.50.0130.01018.34
8.3.40.0110.00718.80
8.3.30.0090.00918.84
8.3.20.0030.00620.29
8.3.10.0040.00421.84
8.3.00.0000.00823.57
8.2.190.0090.01516.88
8.2.180.0040.01116.75
8.2.170.0040.01122.96
8.2.160.0090.00622.30
8.2.150.0080.00024.18
8.2.140.0090.00024.66
8.2.130.0000.00821.12
8.2.120.0000.00726.35
8.2.110.0030.00722.26
8.2.100.0040.00818.16
8.2.90.0000.00820.07
8.2.80.0080.00018.04
8.2.70.0050.00318.04
8.2.60.0030.00518.09
8.2.50.0000.00818.10
8.2.40.0030.00622.27
8.2.30.0040.00421.04
8.2.20.0040.00418.18
8.2.10.0080.00018.16
8.2.00.0080.00017.96
8.1.280.0090.00925.92
8.1.270.0070.00022.10
8.1.260.0070.00026.35
8.1.250.0000.00728.09
8.1.240.0030.00722.23
8.1.230.0040.00821.00
8.1.220.0080.00017.76
8.1.210.0080.00018.77
8.1.200.0030.00617.36
8.1.190.0080.00017.23
8.1.180.0060.00318.10
8.1.170.0050.00318.63
8.1.160.0040.00418.93
8.1.150.0040.00418.84
8.1.140.0070.00019.05
8.1.130.0000.00718.90
8.1.120.0040.00417.41
8.1.110.0050.00217.48
8.1.100.0040.00417.37
8.1.90.0070.00017.52
8.1.80.0030.00517.39
8.1.70.0080.00017.39
8.1.60.0040.00417.48
8.1.50.0040.00417.56
8.1.40.0000.00917.45
8.1.30.0000.00817.68
8.1.20.0000.00817.63
8.1.10.0060.00317.62
8.1.00.0000.00817.53
8.0.300.0040.00419.74
8.0.290.0030.00516.75
8.0.280.0000.00718.48
8.0.270.0040.00317.23
8.0.260.0080.00016.95
8.0.250.0070.00017.09
8.0.240.0090.00316.95
8.0.230.0070.00017.04
8.0.220.0040.00316.98
8.0.210.0080.00016.94
8.0.200.0040.00417.08
8.0.190.0040.00416.93
8.0.180.0050.00216.98
8.0.170.0070.00016.98
8.0.160.0040.00417.03
8.0.150.0060.00616.95
8.0.140.0040.00416.84
8.0.130.0000.00513.45
8.0.120.0000.00816.98
8.0.110.0000.00816.90
8.0.100.0060.00316.88
8.0.90.0000.00716.93
8.0.80.0090.00616.87
8.0.70.0000.00716.78
8.0.60.0000.00716.96
8.0.50.0040.00416.94
8.0.30.0100.00917.19
8.0.20.0050.01517.40
8.0.10.0040.00417.09
8.0.00.0100.01017.05
7.4.330.0060.00015.55
7.4.320.0000.00616.64
7.4.300.0000.00616.50
7.4.290.0060.00316.61
7.4.280.0040.00416.67
7.4.270.0000.00716.55
7.4.260.0070.00016.50
7.4.250.0070.00016.52
7.4.240.0040.00416.63
7.4.230.0070.00016.73
7.4.220.0100.01116.68
7.4.210.0110.00816.55
7.4.200.0000.00816.34
7.4.160.0120.00516.49
7.4.150.0170.00717.40
7.4.140.0150.01017.86
7.4.130.0100.01416.57
7.4.120.0130.00916.54
7.4.110.0110.00816.50
7.4.100.0120.00616.36
7.4.90.0080.00916.54
7.4.80.0090.00919.39
7.4.70.0100.01016.52
7.4.60.0000.01616.65
7.4.50.0090.00316.53
7.4.40.0130.00616.36
7.4.30.0060.01116.45
7.4.10.0040.01415.22
7.4.00.0080.00815.19
7.3.330.0060.00013.19
7.3.320.0030.00313.31
7.3.310.0030.00516.41
7.3.300.0030.00316.38
7.3.290.0070.00016.23
7.3.280.0110.00716.35
7.3.270.0130.00317.40
7.3.260.0130.00616.44
7.3.250.0090.00816.42
7.3.240.0080.01216.41
7.3.230.0030.01316.66
7.3.210.0100.00716.56
7.3.200.0170.00016.69
7.3.190.0100.01616.38
7.3.180.0130.00416.56
7.3.170.0100.00616.51
7.3.160.0060.01516.61
7.3.130.0090.00615.02
7.3.120.0060.01214.87
7.3.110.0000.02015.14
7.3.100.0030.00714.77
7.3.90.0130.00314.70
7.3.80.0120.00314.55
7.3.70.0040.01214.80
7.3.60.0040.01214.99
7.3.50.0140.00014.84
7.3.40.0090.00315.00
7.3.30.0000.01614.84
7.3.20.0000.01316.59
7.3.10.0070.01116.93
7.3.00.0040.01116.82
7.2.330.0070.01116.80
7.2.320.0120.01216.52
7.2.310.0110.00716.59
7.2.300.0110.01116.74
7.2.290.0110.00616.88
7.2.260.0070.01014.84
7.2.250.0000.02014.80
7.2.240.0070.00715.17
7.2.230.0070.01014.92
7.2.220.0000.01015.10
7.2.210.0100.00314.75
7.2.200.0130.00015.34
7.2.190.0090.00614.98
7.2.180.0030.00815.23
7.2.170.0060.00915.33
7.2.160.0100.00314.91
7.2.150.0100.00316.84
7.2.140.0040.01116.78
7.2.130.0130.00016.75
7.2.120.0160.00316.98
7.2.110.0030.01717.14
7.2.100.0120.00416.77
7.2.90.0080.00816.98
7.2.80.0040.01116.84
7.2.70.0000.01016.95
7.2.60.0050.00716.75
7.2.50.0070.00716.98
7.2.40.0100.00316.92
7.2.30.0070.00316.79
7.2.20.0070.01116.69
7.2.10.0090.00916.91
7.2.00.0090.01018.27
7.1.330.0070.00716.05
7.1.320.0120.00315.74
7.1.310.0000.00815.70
7.1.300.0100.00015.94
7.1.290.0040.00415.70
7.1.280.0050.00915.78
7.1.270.0070.00715.78
7.1.260.0040.00715.73
7.1.250.0000.01815.82
7.1.240.0060.01315.83
7.1.230.0000.01415.91
7.1.220.0000.00915.92
7.1.210.0100.00315.82
7.1.200.0070.00915.76
7.1.190.0000.01215.75
7.1.180.0000.01015.60
7.1.170.0040.00815.83
7.1.160.0060.00315.95
7.1.150.0080.00415.87
7.1.140.0030.00615.80
7.1.130.0070.00415.84
7.1.120.0080.00717.21
7.1.110.0050.01016.71
7.1.100.0100.00916.62
7.1.90.0070.00816.74
7.1.80.0080.00816.71
7.1.70.0080.00716.02
7.1.60.0130.01227.91
7.1.50.0120.01327.71
7.1.40.0140.01027.46
7.1.30.0150.01127.66
7.1.20.0140.01727.58
7.1.10.0050.01115.79
7.1.00.0050.00916.47
7.0.330.0040.01215.67
7.0.320.0040.01115.25
7.0.310.0060.00615.44
7.0.300.0070.00715.30
7.0.290.0030.00715.41
7.0.280.0060.00615.60
7.0.270.0070.00715.20
7.0.260.0000.01215.53
7.0.250.0060.00615.39
7.0.240.0090.00315.41
7.0.230.0000.01015.47
7.0.220.0000.01215.44
7.0.210.0030.01015.56
7.0.200.0060.00315.63
7.0.190.0030.00615.56
7.0.180.0060.00915.52
7.0.170.0060.00615.27
7.0.160.0030.01315.60
7.0.150.0030.00715.38
7.0.140.0000.01615.47
7.0.130.0100.00715.45
7.0.120.0030.00615.38
7.0.110.0060.00915.32
7.0.100.0030.00615.38
7.0.90.0060.00915.09
7.0.80.0000.01515.63
7.0.70.0080.00815.64
7.0.60.0030.01015.62
7.0.50.0000.00815.51
7.0.40.0000.01413.41
7.0.30.0060.00613.52
7.0.20.0000.01013.45
7.0.10.0110.00413.54
7.0.00.0030.01013.27
5.6.400.0030.01014.64
5.6.390.0070.01114.32
5.6.380.0040.01214.16
5.6.370.0030.01014.35
5.6.360.0030.01214.31
5.6.350.0040.00414.55
5.6.340.0070.00714.52
5.6.330.0030.01014.55
5.6.320.0040.01114.33
5.6.310.0080.00414.59
5.6.300.0100.00314.71
5.6.290.0030.01414.04
5.6.280.0090.00914.71
5.6.270.0070.00714.48
5.6.260.0070.01014.47
5.6.250.0060.00314.46
5.6.240.0030.01214.64
5.6.230.0030.01414.29
5.6.220.0070.00714.24
5.6.210.0100.00314.48
5.6.200.0070.00414.25
5.6.190.0000.01314.45
5.6.180.0000.01414.52
5.6.170.0150.00014.52
5.6.160.0110.00414.53
5.6.150.0030.01214.49
5.6.140.0030.00914.60
5.6.130.0090.00314.42
5.6.120.0030.01014.53
5.6.110.0070.00714.63
5.6.100.0120.00014.28
5.6.90.0080.00514.11
5.6.80.0060.01214.26
5.6.70.0090.00614.23
5.6.60.0130.00014.15
5.6.50.0030.00914.34
5.6.40.0080.00314.14
5.6.30.0000.00914.24
5.6.20.0040.00814.28
5.6.10.0070.00714.16
5.6.00.0070.00714.35

preferences:
19.13 ms | 401 KiB | 5 Q