3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ObjectOne { protected $someParam = 'foo'; protected $someOtherParam = 'bar'; protected $saveMe = NULL; protected function update() { $this->someParam = 'FOO'; $this->someOtherParam = 'BAR'; return true; } protected function revert(){ $this->someParam = $this->saveMe->someParam; $this->someOtherParam = $this->saveMe->someOtherParam; $this->saveMe = NULL; } } class ObjectTwo extends ObjectOne { protected $someParam = 'faa'; protected $someOtherParam = 'bor'; public function update() { $this->saveMe = $this; if(parent::update()) { $this->someParam = 'poo'; if($this->someParam === 'foo') { return true; } else { $this->revert(); parent::update(); return false; } } else { return false; } } } $testOb = new ObjectTwo(); print_r($testOb->update());

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.0120.00618.81
8.3.30.0080.00819.17
8.3.20.0000.01420.21
8.3.10.0080.00023.65
8.3.00.0040.00422.34
8.2.170.0150.00622.96
8.2.160.0110.00722.16
8.2.150.0140.00024.18
8.2.140.0000.00924.66
8.2.130.0090.00926.16
8.2.120.0080.00022.21
8.2.110.0050.00522.30
8.2.100.0090.00317.72
8.2.90.0000.00818.99
8.2.80.0000.00817.97
8.2.70.0030.00617.38
8.2.60.0080.00017.80
8.2.50.0060.00318.07
8.2.40.0040.00419.41
8.2.30.0030.00618.00
8.2.20.0000.00717.61
8.2.10.0000.00817.81
8.2.00.0040.00417.61
8.1.270.0040.00423.70
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0030.00623.74
8.1.230.0040.00719.16
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0000.00817.51
8.1.180.0050.00318.10
8.1.170.0000.00818.46
8.1.160.0000.00721.99
8.1.150.0070.00018.57
8.1.140.0070.00017.41
8.1.130.0000.00817.79
8.1.120.0000.00717.31
8.1.110.0040.00417.41
8.1.100.0000.00717.42
8.1.90.0030.00417.30
8.1.80.0030.00317.31
8.1.70.0050.00317.39
8.1.60.0030.00617.50
8.1.50.0000.00817.54
8.1.40.0040.00417.51
8.1.30.0080.00017.54
8.1.20.0040.00417.71
8.1.10.0040.00417.55
8.1.00.0040.00417.45
8.0.300.0070.00018.77
8.0.290.0040.00417.18
8.0.280.0040.00418.40
8.0.270.0000.00817.13
8.0.260.0000.00916.81
8.0.250.0000.00616.92
8.0.240.0040.00416.82
8.0.230.0070.00016.93
8.0.220.0070.00016.88
8.0.210.0030.00316.84
8.0.200.0000.00716.78
8.0.190.0080.00016.92
8.0.180.0000.00716.84
8.0.170.0080.00016.71
8.0.160.0060.00316.76
8.0.150.0050.00216.78
8.0.140.0040.00416.79
8.0.130.0000.00613.28
8.0.120.0040.00416.79
8.0.110.0000.00816.88
8.0.100.0040.00416.71
8.0.90.0000.00716.76
8.0.80.0060.01016.75
8.0.70.0000.00816.83
8.0.60.0040.00416.88
8.0.50.0040.00416.69
8.0.30.0080.01116.83
8.0.20.0130.00717.40
8.0.10.0000.00816.76
8.0.00.0090.01116.58
7.4.330.0000.00615.02
7.4.320.0030.00316.54
7.4.300.0000.00716.38
7.4.290.0030.00316.61
7.4.280.0030.00316.54
7.4.270.0000.00716.42
7.4.260.0060.00316.41
7.4.250.0070.00016.57
7.4.240.0040.00316.56
7.4.230.0070.00016.43
7.4.220.0060.01916.54
7.4.210.0090.00616.56
7.4.200.0030.00316.62
7.4.190.0020.00516.68
7.4.160.0160.00016.65
7.4.150.0070.01017.40
7.4.140.0090.00917.86
7.4.130.0090.00816.53
7.4.120.0060.01216.51
7.4.110.0100.00716.54
7.4.100.0110.00716.46
7.4.90.0140.00316.67
7.4.80.0060.01016.45
7.4.70.0080.00816.66
7.4.60.0130.00316.46
7.4.50.0040.00416.48
7.4.40.0070.00722.77
7.4.30.0090.00916.74
7.4.00.0070.00714.91
7.3.330.0000.00513.12
7.3.320.0000.00513.26
7.3.310.0030.00316.30
7.3.300.0030.00316.35
7.3.290.0090.00916.32
7.3.280.0070.00916.34
7.3.270.0090.00917.40
7.3.260.0090.00916.33
7.3.250.0090.00816.36
7.3.240.0100.00616.28
7.3.230.0080.00816.39
7.3.210.0000.01716.36
7.3.200.0100.00919.39
7.3.190.0130.00316.28
7.3.180.0100.01316.44
7.3.170.0070.01016.57
7.3.160.0160.00016.50
7.3.120.0100.00714.84
7.3.10.0140.00316.44
7.3.00.0110.00716.56
7.2.330.0130.00316.61
7.2.320.0180.00616.53
7.2.310.0130.00316.55
7.2.300.0040.01516.67
7.2.290.0100.00716.38
7.2.130.0070.01016.85
7.2.120.0110.00816.75
7.2.110.0130.00316.79
7.2.100.0100.00316.88
7.2.90.0000.01616.46
7.2.80.0100.00816.75
7.2.70.0110.00716.82
7.2.60.0030.01116.74
7.2.50.0130.00616.96
7.2.40.0100.00716.68
7.2.30.0060.00916.96
7.2.20.0130.00616.91
7.2.10.0030.01316.58
7.2.00.0060.00916.80
7.1.250.0060.00915.75
7.1.240.0080.00615.79
7.1.230.0180.00015.67
7.1.220.0070.00715.35
7.1.210.0100.00715.51
7.1.200.0090.00515.74
7.1.190.0060.01015.48
7.1.180.0120.00615.57
7.1.170.0130.00315.57
7.1.160.0100.00515.64
7.1.150.0160.00315.52
7.1.140.0110.00415.77
7.1.130.0040.01115.49
7.1.120.0100.00715.71
7.1.110.0070.00715.68
7.1.100.0050.01016.68
7.1.90.0080.00415.38
7.1.80.0040.01115.60
7.1.70.0060.00516.45
7.1.60.0040.01517.39
7.1.50.0080.01016.00
7.1.40.0100.00315.45
7.1.30.0080.00815.82
7.1.20.0120.00315.60
7.1.10.0080.00415.42
7.1.00.0030.04619.15
7.0.330.0090.00915.34
7.0.320.0000.01615.47
7.0.310.0120.00414.83
7.0.300.0070.01115.57
7.0.290.0130.00315.38
7.0.280.0090.00615.54
7.0.270.0050.00515.41
7.0.260.0120.00315.18
7.0.250.0060.00615.34
7.0.240.0030.00915.40
7.0.230.0100.00315.58
7.0.220.0080.00415.35
7.0.210.0090.00315.57
7.0.200.0060.00816.02
7.0.190.0090.00615.07
7.0.180.0150.00315.04
7.0.170.0080.00315.40
7.0.160.0070.00715.46
7.0.150.0090.00915.46
7.0.140.0070.04018.72
7.0.130.0070.01115.19
7.0.120.0060.00915.48
7.0.110.0140.00015.28
7.0.100.0220.04717.68
7.0.90.0120.03717.54
7.0.80.0050.04517.64
7.0.70.0090.04117.60
7.0.60.0080.04417.73
7.0.50.0140.04017.86
7.0.40.0070.04116.71
7.0.30.0090.02516.64
7.0.20.0080.04516.74
7.0.10.0090.04116.62
7.0.00.0110.04016.61
5.6.380.0050.00514.46
5.6.370.0060.00914.34
5.6.360.0050.00514.38
5.6.350.0070.00714.30
5.6.340.0110.00314.09
5.6.330.0040.00814.39
5.6.320.0100.00314.27
5.6.310.0040.01114.16
5.6.300.0030.01014.70
5.6.290.0110.00314.75
5.6.280.0080.04717.81
5.6.270.0060.00614.24
5.6.260.0120.00014.20
5.6.250.0170.03417.58
5.6.240.0030.04617.54
5.6.230.0050.02817.50
5.6.220.0020.05017.50
5.6.210.0050.04717.47
5.6.200.0130.03017.50
5.6.190.0030.05217.60
5.6.180.0080.04617.63
5.6.170.0080.04617.52
5.6.160.0070.04017.60
5.6.150.0040.04817.76
5.6.140.0110.04217.59
5.6.130.0150.02617.72
5.6.120.0080.04117.50
5.6.110.0080.04317.74
5.6.100.0120.03217.74
5.6.90.0070.04217.56
5.6.80.0080.04117.27
5.6.70.0050.03917.32
5.6.60.0080.04017.30
5.6.50.0070.04317.26
5.6.40.0100.03617.39
5.6.30.0080.04017.33
5.6.20.0050.04317.29
5.6.10.0060.04017.29
5.6.00.0050.04317.33
5.5.380.0040.04615.75
5.5.370.0100.04415.81
5.5.360.0100.02816.06
5.5.350.0070.04715.68
5.5.340.0100.02716.15
5.5.330.0140.03516.20
5.5.320.0060.04616.04
5.5.310.0120.03916.08
5.5.300.0120.04016.06
5.5.290.0130.04215.99
5.5.280.0080.04615.98
5.5.270.0090.03315.90
5.5.260.0070.04515.98
5.5.250.0040.03715.80
5.5.240.0090.03715.70
5.5.230.0050.04215.56
5.5.220.0140.03515.68
5.5.210.0120.01915.57
5.5.200.0060.02515.65
5.5.190.0030.04215.56
5.5.180.0050.03815.69
5.5.170.0080.00410.84
5.5.160.0140.03315.72
5.5.150.0050.03615.74
5.5.140.0030.04415.71
5.5.130.0130.02815.51
5.5.120.0100.04215.67
5.5.110.0030.04315.70
5.5.100.0040.04415.46
5.5.90.0050.04415.69
5.5.80.0140.03415.49
5.5.70.0050.04515.47
5.5.60.0070.04415.64
5.5.50.0120.03315.71
5.5.40.0020.04415.47
5.5.30.0060.04215.66
5.5.20.0050.04715.60
5.5.10.0040.04515.62
5.5.00.0070.03615.55
5.4.450.0030.04615.29
5.4.440.0080.03714.97
5.4.430.0110.03915.20
5.4.420.0040.04615.28
5.4.410.0030.03815.21
5.4.400.0060.03615.10
5.4.390.0060.03915.02
5.4.380.0040.04214.84
5.4.370.0050.03914.90
5.4.360.0100.04015.03
5.4.350.0110.03514.92
5.4.340.0020.04515.16
5.4.330.0050.00510.77
5.4.320.0110.03714.97
5.4.310.0080.03714.93
5.4.300.0030.04114.90
5.4.290.0020.04215.03
5.4.280.0030.04114.97
5.4.270.0090.03714.89
5.4.260.0080.03815.10
5.4.250.0070.03315.05
5.4.240.0080.03514.99
5.4.230.0070.04014.89
5.4.220.0050.04014.88
5.4.210.0070.04015.09
5.4.200.0070.04014.89
5.4.190.0070.03214.97
5.4.180.0080.04014.87
5.4.170.0070.03915.09
5.4.160.0020.04315.16
5.4.150.0050.02314.91
5.4.140.0050.02113.52
5.4.130.0020.02513.54
5.4.120.0020.02413.71
5.4.110.0010.02013.77
5.4.100.0050.01613.64
5.4.90.0030.02113.67
5.4.80.0090.01513.58
5.4.70.0030.03813.68
5.4.60.0070.03013.67
5.4.50.0030.03313.61
5.4.40.0090.03313.47
5.4.30.0060.03313.54
5.4.20.0000.03213.69
5.4.10.0060.02013.47
5.4.00.0050.02413.50
5.3.290.0060.02412.64
5.3.280.0040.04312.60
5.3.270.0090.03812.63
5.3.260.0080.03612.71
5.3.250.0050.02812.71
5.3.240.0040.02012.54
5.3.230.0070.01812.55
5.3.220.0030.02012.41
5.3.210.0000.02412.55
5.3.200.0000.02412.54
5.3.190.0030.03412.58
5.3.180.0030.02212.58
5.3.170.0140.02712.56
5.3.160.0030.04112.54
5.3.150.0090.03912.58
5.3.140.0020.03912.62
5.3.130.0030.04212.59
5.3.120.0020.03912.61
5.3.110.0020.02012.56
5.3.100.0050.02812.21
5.3.90.0020.02212.33
5.3.80.0060.02012.30
5.3.70.0000.02412.26
5.3.60.0020.02212.22
5.3.50.0020.02012.19
5.3.40.0050.04112.18
5.3.30.0010.02412.22
5.3.20.0050.03212.14
5.3.10.0050.02611.98
5.3.00.0030.01811.92
5.2.170.0020.02710.35
5.2.160.0020.02410.27
5.2.150.0010.01810.36
5.2.140.0020.01810.40
5.2.130.0050.01510.17
5.2.120.0000.01810.16
5.2.110.0050.02510.32
5.2.100.0070.01210.24
5.2.90.0070.01510.21
5.2.80.0040.01610.26
5.2.70.0030.01610.19
5.2.60.0000.01810.27
5.2.50.0050.01510.27
5.2.40.0080.01210.31
5.2.30.0000.02110.12
5.2.20.0030.02010.06
5.2.10.0050.01510.16
5.2.00.0030.0179.86
5.1.60.0030.0159.31
5.1.50.0020.0129.30
5.1.40.0030.0139.25
5.1.30.0050.0209.56
5.1.20.0040.0209.54
5.1.10.0030.0169.35
5.1.00.0030.0139.23
5.0.50.0040.0118.92
5.0.40.0000.0148.92
5.0.30.0060.0138.92
5.0.20.0070.0148.92
5.0.10.0040.0138.92
5.0.00.0060.0158.92
4.4.90.0000.0108.92
4.4.80.0020.0088.92
4.4.70.0030.0088.92
4.4.60.0050.0078.92
4.4.50.0030.0088.92
4.4.40.0000.0158.92
4.4.30.0030.0088.92
4.4.20.0020.0108.92
4.4.10.0020.0128.92
4.4.00.0000.0148.92
4.3.110.0040.0088.92
4.3.100.0000.0128.92
4.3.90.0030.0078.92
4.3.80.0020.0158.92
4.3.70.0050.0078.92
4.3.60.0010.0108.92
4.3.50.0030.0128.92
4.3.40.0000.0188.92
4.3.30.0010.0118.92
4.3.20.0000.0108.92
4.3.10.0000.0218.92
4.3.00.0000.0168.92

preferences:
42.2 ms | 400 KiB | 5 Q