3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Profile { private $active = false; public function activate() { $this->active = true; } public function isActive() { return $this->active; } } interface Event { function execute($object); } class ProfileWasActivated implements Event { public function execute($profile) { if(!($event instanceof Event)) { throw new \InvalidException('Only Profiles allowed!'); } $profile->activate(); } } class EventDomainObjectLoader { public static function load($object, array $events) { foreach($events as $event) { if(!($event instanceof Event)) { throw new \InvalidException('Only Events allowed!'); } $event->execute($object); } return $object; } } $profile = EventDomainObjectLoader::load(new Profile(), [new ProfileWasActivated()]); var_dump($profile->isActive());

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.0130.00618.30
8.3.50.0100.00821.05
8.3.40.0000.01418.88
8.3.30.0030.01019.17
8.3.20.0050.00320.16
8.3.10.0040.00423.36
8.3.00.0030.00719.26
8.2.180.0060.01317.00
8.2.170.0100.01022.96
8.2.160.0150.00020.36
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00322.18
8.2.110.0040.00422.13
8.2.100.0060.00617.75
8.2.90.0000.00719.35
8.2.80.0000.00917.97
8.2.70.0090.00317.50
8.2.60.0040.00417.90
8.2.50.0060.00318.07
8.2.40.0000.01019.71
8.2.30.0030.00517.98
8.2.20.0040.00417.77
8.2.10.0050.00317.96
8.2.00.0000.00817.76
8.1.280.0100.00325.92
8.1.270.0040.00421.91
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0060.00323.98
8.1.230.0040.00819.04
8.1.220.0080.00017.74
8.1.210.0050.00318.77
8.1.200.0000.00917.25
8.1.190.0000.00817.23
8.1.180.0000.00918.10
8.1.170.0040.00418.72
8.1.160.0040.00422.04
8.1.150.0040.00418.83
8.1.140.0000.00717.32
8.1.130.0030.00317.83
8.1.120.0000.00717.43
8.1.110.0000.01017.37
8.1.100.0000.00817.32
8.1.90.0040.00417.38
8.1.80.0070.00017.38
8.1.70.0040.00417.43
8.1.60.0040.00417.43
8.1.50.0000.00817.49
8.1.40.0000.00817.48
8.1.30.0000.00917.57
8.1.20.0000.00717.61
8.1.10.0040.00417.59
8.1.00.0000.00717.46
8.0.300.0040.00418.77
8.0.290.0070.00016.88
8.0.280.0040.00418.40
8.0.270.0000.00717.28
8.0.260.0030.00317.29
8.0.250.0070.00016.90
8.0.240.0000.00717.04
8.0.230.0040.00417.05
8.0.220.0030.00516.94
8.0.210.0070.00016.94
8.0.200.0040.00416.92
8.0.190.0000.00717.00
8.0.180.0000.00716.90
8.0.170.0040.00416.98
8.0.160.0030.00316.96
8.0.150.0080.00016.95
8.0.140.0070.00016.91
8.0.130.0030.00313.39
8.0.120.0000.00916.89
8.0.110.0040.00416.82
8.0.100.0070.00017.07
8.0.90.0070.00016.81
8.0.80.0080.00817.02
8.0.70.0080.00017.05
8.0.60.0000.00716.80
8.0.50.0040.00416.99
8.0.30.0100.01517.22
8.0.20.0120.01017.40
8.0.10.0000.00717.08
8.0.00.0080.00816.70
7.4.330.0000.00615.02
7.4.320.0030.00316.39
7.4.300.0000.00716.37
7.4.290.0030.00316.50
7.4.280.0000.00816.45
7.4.270.0000.00716.57
7.4.260.0030.00316.48
7.4.250.0000.00716.44
7.4.240.0050.00316.57
7.4.230.0000.00816.54
7.4.220.0070.01116.52
7.4.210.0070.00716.54
7.4.200.0040.00416.46
7.4.160.0120.00616.48
7.4.150.0160.01017.40
7.4.140.0120.00917.86
7.4.130.0080.00916.52
7.4.120.0110.00716.56
7.4.110.0080.00916.66
7.4.100.0160.00816.59
7.4.90.0080.00816.63
7.4.80.0030.01419.39
7.4.70.0000.01716.44
7.4.60.0100.00616.68
7.4.50.0040.00416.51
7.4.40.0070.01016.48
7.4.30.0060.01516.56
7.4.00.0080.00015.17
7.3.330.0000.00613.52
7.3.320.0050.00013.29
7.3.310.0000.00716.45
7.3.300.0000.00716.29
7.3.290.0110.00716.48
7.3.280.0080.00816.46
7.3.270.0100.01117.40
7.3.260.0060.00916.55
7.3.250.0070.01016.55
7.3.240.0140.00316.44
7.3.230.0100.00716.39
7.3.210.0080.00816.51
7.3.200.0000.01619.39
7.3.190.0060.01016.45
7.3.180.0110.00716.69
7.3.170.0060.01016.44
7.3.160.0090.00616.36
7.3.10.0070.00616.57
7.3.00.0110.00316.65
7.2.330.0120.00616.43
7.2.320.0140.01016.73
7.2.310.0130.00316.87
7.2.300.0100.00716.89
7.2.290.0040.01316.51
7.2.130.0080.00816.98
7.2.120.0000.00916.96
7.2.110.0050.00716.92
7.2.100.0080.00616.75
7.2.90.0050.00816.89
7.2.80.0030.01116.79
7.2.70.0070.00617.08
7.2.60.0070.00616.89
7.2.50.0020.01117.06
7.2.40.0050.00916.81
7.2.30.0090.00516.85
7.2.20.0070.00516.89
7.2.10.0090.00616.81
7.2.00.0040.00917.77
7.1.250.0050.00715.70
7.1.200.0090.00615.48
7.1.100.0000.01417.90
7.1.70.0030.00616.80
7.1.60.0000.01419.11
7.1.50.0040.01816.96
7.1.00.0100.07022.28
7.0.200.0000.00716.61
7.0.140.0030.07321.96
7.0.60.0130.07719.89
7.0.50.0000.04317.98
7.0.40.0000.07020.30
7.0.30.0270.04320.15
7.0.20.0330.04720.30
7.0.10.0270.08320.30
7.0.00.0130.06720.25
5.6.210.0000.05020.77
5.6.200.0100.07018.25
5.6.190.0070.04020.38
5.6.180.0300.08020.57
5.6.170.0300.07020.55
5.6.160.0100.07720.56
5.6.150.0070.05318.29
5.6.140.0000.04018.14
5.6.130.0070.05318.19
5.6.120.0070.07020.91
5.6.110.0070.05721.14
5.6.100.0100.07321.14
5.6.90.0030.08021.05
5.6.80.0100.06020.36
5.6.70.4900.03720.38
5.5.350.0070.08020.40
5.5.340.0130.06018.04
5.5.330.0070.07020.29
5.5.320.0330.04720.28
5.5.310.0100.04720.37
5.5.300.0030.03718.07
5.5.290.0070.08017.98
5.5.280.0100.05020.86
5.5.270.0100.08020.88
5.5.260.0070.08020.65
5.5.250.0170.07320.79
5.5.240.0030.06720.20
5.4.450.1500.04319.32
5.4.440.0430.05719.32
5.4.430.0600.05319.27
5.4.420.0670.00019.32
5.4.410.0630.00019.57
5.4.400.0600.00019.02
5.4.390.0670.00019.07
5.4.380.0670.00019.08
5.4.370.0630.00019.16
5.4.360.0600.00019.04
5.4.350.0630.00019.02
5.4.340.0090.03112.03
5.4.320.0050.03812.52
5.4.310.0070.04012.51
5.4.300.0060.03612.52
5.4.290.0060.03712.51
5.4.280.0040.03712.41
5.4.270.0060.03612.40
5.4.260.0090.03612.41
5.4.250.0070.04012.40
5.4.240.0090.04012.41
5.4.230.0080.04112.40
5.4.220.0080.03612.40
5.4.210.0060.03612.40
5.4.200.0060.04412.40
5.4.190.0110.03912.39
5.4.180.0090.03412.40
5.4.170.0060.03812.40
5.4.160.0070.03512.40
5.4.150.0090.03912.40
5.4.140.0060.04312.08
5.4.130.0070.03812.07
5.4.120.0080.03712.03
5.4.110.0050.04112.02
5.4.100.0050.03512.03
5.4.90.0060.03612.02
5.4.80.0110.03312.02
5.4.70.0090.03212.02
5.4.60.0050.04112.02
5.4.50.0060.04312.02
5.4.40.0100.03812.00
5.4.30.0060.03612.00
5.4.20.0070.03412.00
5.4.10.0070.03412.00
5.4.00.0070.03811.50
5.3.290.0080.04112.80
5.3.280.0060.04112.71
5.3.270.0070.04112.73
5.3.260.0110.03512.72
5.3.250.0060.04312.72
5.3.240.0060.03812.71
5.3.230.0110.03312.71
5.3.220.0060.03712.68
5.3.210.0060.03912.68
5.3.200.0070.03512.68
5.3.190.0060.03812.67
5.3.180.0100.05412.67
5.3.170.0040.04112.67
5.3.160.0070.03512.67
5.3.150.0080.04612.68
5.3.140.0060.03712.66
5.3.130.0110.03512.66
5.3.120.0080.03712.66
5.3.110.0090.03512.66
5.3.100.0070.03812.15
5.3.90.0060.03912.13
5.3.80.0070.03612.11
5.3.70.0100.03312.11
5.3.60.0040.03912.10
5.3.50.0060.03612.05
5.3.40.0050.03812.05
5.3.30.0080.03412.00
5.3.20.0050.03611.79
5.3.10.0040.03711.75
5.3.00.0060.03611.74
5.2.170.0070.0349.23
5.2.160.0050.0329.23
5.2.150.0070.0309.23
5.2.140.0100.0419.23
5.2.130.0080.0379.19
5.2.120.0140.0579.19
5.2.110.0070.0349.20
5.2.100.0120.0339.19
5.2.90.0090.0639.19
5.2.80.0090.0899.19
5.2.70.0300.1179.19
5.2.60.0080.0539.14
5.2.50.0060.0389.11
5.2.40.0050.0359.09
5.2.30.0130.0469.06
5.2.20.0070.0359.05
5.2.10.0060.0318.95
5.2.00.0090.0378.82
5.1.60.0060.0278.10
5.1.50.0050.0258.10
5.1.40.0060.0278.08
5.1.30.0060.0278.43
5.1.20.0060.0318.46
5.1.10.0060.0308.18
5.1.00.0020.0298.18
5.0.50.0020.0256.66
5.0.40.0010.0236.52
5.0.30.0040.0336.33
5.0.20.0060.0186.30
5.0.10.0050.0226.28
5.0.00.0030.0326.27
4.4.90.0030.0164.78
4.4.80.0040.0144.76
4.4.70.0020.0184.75
4.4.60.0040.0144.76
4.4.50.0040.0144.77
4.4.40.0020.0264.71
4.4.30.0020.0164.76
4.4.20.0030.0164.84
4.4.10.0050.0164.85
4.4.00.0050.0274.76
4.3.110.0030.0284.67
4.3.100.0120.0234.66
4.3.90.0050.0264.63
4.3.80.0040.0274.58
4.3.70.0030.0154.63
4.3.60.0020.0194.63
4.3.50.0050.0164.63
4.3.40.0240.0834.54
4.3.30.0020.0223.30
4.3.20.0020.0233.28
4.3.10.0040.0143.24
4.3.00.0170.03012.38

preferences:
48.22 ms | 401 KiB | 5 Q