3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Pet { protected $_name; protected $_status = 'None'; protected $_petLocation = 'who knows'; // Want to replace this function protected function playing($game = 'ball') { $this->_status = $this->_type . ' is playing ' . $game; return '<br>' . $this->_name . ' started to play a ' . $game; } public function getPetStatus() { return '<br>Status: ' . $this->_status; } } class Cat extends Pet { function __construct() { $this->_type = 'Cat'; echo 'Test: The ' . $this->_type . ' was born '; } // Replacing with this one public function playing($gameType = 'chess', $location = 'backyard') { $this->_status = 'playing ' . $gameType . ' in the ' . $location; return '<br>' . $this->_type . ' started to play a ' . $gameType . ' in the ' . $location; } } $cat = new Cat('Billy'); echo $cat->getPetStatus(); echo $cat->playing(); echo $cat->getPetStatus();

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.84
8.3.30.0120.00319.23
8.3.20.0080.00020.30
8.3.10.0040.00423.66
8.3.00.0080.00018.82
8.2.170.0090.00622.96
8.2.160.0000.01520.39
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00020.73
8.2.110.0070.00320.47
8.2.100.0030.00917.91
8.2.90.0070.00019.26
8.2.80.0000.00917.97
8.2.70.0060.00317.50
8.2.60.0000.00817.92
8.2.50.0060.00318.07
8.2.40.0000.00819.82
8.2.30.0040.00418.13
8.2.20.0080.00317.61
8.2.10.0000.00718.07
8.2.00.0030.00617.54
8.1.270.0080.00023.91
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00022.19
8.1.230.0060.00621.97
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0030.01017.35
8.1.190.0050.00317.35
8.1.180.0000.00818.10
8.1.170.0030.00518.53
8.1.160.0070.00021.98
8.1.150.0000.00718.65
8.1.140.0000.00717.50
8.1.130.0040.00417.73
8.1.120.0040.00417.45
8.1.110.0040.00417.31
8.1.100.0000.00717.53
8.1.90.0080.00017.48
8.1.80.0030.00517.42
8.1.70.0030.00317.32
8.1.60.0000.00817.56
8.1.50.0000.00917.45
8.1.40.0070.00317.57
8.1.30.0040.00417.59
8.1.20.0040.00417.56
8.1.10.0050.00217.54
8.1.00.0050.00317.62
8.0.300.0000.00818.77
8.0.290.0000.00717.05
8.0.280.0070.00018.32
8.0.270.0070.00017.26
8.0.260.0000.00717.26
8.0.250.0070.00016.84
8.0.240.0030.00316.95
8.0.230.0030.00316.86
8.0.220.0080.00016.79
8.0.210.0070.00016.76
8.0.200.0060.00316.96
8.0.190.0030.00316.95
8.0.180.0080.00016.93
8.0.170.0030.00616.81
8.0.160.0030.00316.73
8.0.150.0040.00416.74
8.0.140.0090.00016.76
8.0.130.0030.00313.41
8.0.120.0000.00816.93
8.0.110.0000.00716.79
8.0.100.0040.00416.71
8.0.90.0040.00316.85
8.0.80.0110.00416.90
8.0.70.0030.00517.00
8.0.60.0000.00716.74
8.0.50.0050.00317.00
8.0.30.0100.00816.99
8.0.20.0120.00617.40
8.0.10.0020.00516.84
8.0.00.0080.01216.89
7.4.330.0000.00515.13
7.4.320.0060.00016.65
7.4.300.0070.00016.61
7.4.290.0000.00716.52
7.4.280.0080.00416.64
7.4.270.0000.00716.52
7.4.260.0000.00816.49
7.4.250.0050.00216.55
7.4.240.0020.00516.51
7.4.230.0030.00316.69
7.4.220.0120.00616.58
7.4.210.0090.00616.56
7.4.200.0050.00216.57
7.4.190.0030.00316.55
7.4.160.0060.00916.44
7.4.150.0080.00817.40
7.4.140.0090.00917.86
7.4.130.0060.01016.44
7.4.120.0120.00516.55
7.4.110.0190.00316.51
7.4.100.0060.01216.59
7.4.90.0060.01116.49
7.4.80.0150.00619.39
7.4.70.0090.00616.29
7.4.60.0090.00816.47
7.4.50.0020.00216.47
7.4.40.0180.00416.34
7.4.30.0040.01216.64
7.4.00.0070.01015.01
7.3.330.0030.00313.31
7.3.320.0000.00513.36
7.3.310.0040.00416.07
7.3.300.0050.00216.18
7.3.290.0070.01416.31
7.3.280.0090.01016.28
7.3.270.0000.01817.40
7.3.260.0100.00716.37
7.3.250.0080.01016.39
7.3.240.0160.00016.29
7.3.230.0100.00616.39
7.3.210.0060.01616.50
7.3.200.0170.00719.39
7.3.190.0050.01516.31
7.3.180.0040.01116.45
7.3.170.0090.00616.45
7.3.160.0160.00016.46
7.3.120.0050.01114.78
7.3.110.0070.01114.67
7.3.100.0100.01015.06
7.3.90.0070.00715.07
7.3.80.0070.00714.77
7.3.70.0040.01115.00
7.3.60.0000.01314.89
7.3.50.0150.00014.98
7.3.40.0070.00714.65
7.3.30.0030.01014.80
7.3.20.0030.01316.63
7.3.10.0070.01016.71
7.3.00.0000.01016.66
7.2.330.0050.01416.77
7.2.320.0030.01716.69
7.2.310.0080.00816.75
7.2.300.0060.01016.77
7.2.290.0050.01116.53
7.2.250.0070.01015.30
7.2.240.0000.01915.09
7.2.230.0090.00315.09
7.2.220.0030.01015.04
7.2.210.0030.01015.12
7.2.200.0060.00914.88
7.2.190.0060.00615.01
7.2.180.0060.00915.04
7.2.170.0060.00615.20
7.2.160.0160.00015.27
7.2.150.0120.00316.87
7.2.140.0040.01117.00
7.2.130.0030.01317.04
7.2.120.0020.01416.70
7.2.110.0080.00516.65
7.2.100.0060.00816.62
7.2.90.0050.01016.76
7.2.80.0090.00516.84
7.2.70.0030.01117.10
7.2.60.0110.00517.02
7.2.50.0000.01216.62
7.2.40.0100.00317.05
7.2.30.0070.01017.01
7.2.20.0100.00516.74
7.2.10.0090.00416.91
7.2.00.0090.00817.77
7.1.330.0070.01015.96
7.1.320.0000.01515.41
7.1.310.0060.00315.50
7.1.300.0000.01315.45
7.1.290.0030.01015.70
7.1.280.0110.00415.49
7.1.270.0040.01115.38
7.1.260.0000.01115.54
7.1.250.0030.01015.73
7.1.240.0070.00615.77
7.1.230.0050.00715.71
7.1.220.0060.00515.76
7.1.210.0060.00815.60
7.1.200.0040.00815.73
7.1.190.0030.00915.70
7.1.180.0060.00515.63
7.1.170.0050.00815.79
7.1.160.0070.00515.75
7.1.150.0030.01015.75
7.1.140.0050.00815.53
7.1.130.0040.01015.77
7.1.120.0050.00815.71
7.1.110.0050.00915.71
7.1.100.0020.01016.41
7.1.90.0120.00215.69
7.1.80.0080.00615.70
7.1.70.0020.00916.08
7.1.60.0050.01116.99
7.1.50.0050.00916.05
7.1.40.0010.00915.75
7.1.30.0050.00715.58
7.1.20.0020.01415.75
7.1.10.0020.01115.62
7.1.00.0070.02917.92
7.0.330.0110.00415.55
7.0.320.0060.00415.44
7.0.310.0050.01015.37
7.0.300.0080.00615.55
7.0.290.0060.00415.41
7.0.280.0020.01115.34
7.0.270.0040.00915.34
7.0.260.0030.01015.39
7.0.250.0070.00715.32
7.0.240.0060.00515.60
7.0.230.0090.00215.53
7.0.220.0050.00715.53
7.0.210.0030.00815.37
7.0.200.0030.00815.84
7.0.190.0020.01215.34
7.0.180.0050.01015.40
7.0.170.0080.00815.39
7.0.160.0020.01215.31
7.0.150.0050.00815.40
7.0.140.0040.02817.65
7.0.130.0080.00315.51
7.0.120.0020.00715.28
7.0.110.0050.00915.56
7.0.100.0030.00815.41
7.0.90.0050.00815.40
7.0.80.0050.00715.52
7.0.70.0050.00515.40
7.0.60.0090.02716.89
7.0.50.0070.01616.26
7.0.40.0080.03215.80
7.0.30.0120.02215.70
7.0.20.0150.01315.61
7.0.10.0030.02715.53
7.0.00.0130.02615.61
5.6.400.0030.00914.64
5.6.390.0060.00614.67
5.6.380.0020.00914.50
5.6.370.0070.00814.38
5.6.360.0040.01014.43
5.6.350.0070.00414.64
5.6.340.0060.00914.25
5.6.330.0050.00614.24
5.6.320.0060.00514.44
5.6.310.0030.01014.29
5.6.300.0040.00714.36
5.6.290.0030.00814.49
5.6.280.0050.02916.61
5.6.270.0050.00714.41
5.6.260.0040.01014.25
5.6.250.0090.00414.32
5.6.240.0070.00514.21
5.6.230.0120.00114.46
5.6.220.0030.00714.29
5.6.210.0030.03516.37
5.6.200.0070.02115.71
5.6.190.0030.02216.43
5.6.180.0150.02916.38
5.6.170.0140.02916.48
5.6.160.0090.01616.51
5.6.150.0040.02015.63
5.6.140.0070.01815.64
5.6.130.0090.01515.62
5.6.120.0090.02716.48
5.6.110.0090.03016.57
5.6.100.0060.03416.45
5.6.90.0070.02316.60
5.6.80.0100.02516.20
5.6.70.0120.00114.45
5.6.60.0110.00414.44
5.6.50.0090.00514.34
5.6.40.0060.01114.23
5.6.30.0040.00914.28
5.6.20.0050.00814.37
5.6.10.0050.00914.40
5.6.00.0080.00514.28
5.5.380.0020.00812.80
5.5.370.0040.00912.77
5.5.360.0030.00812.65
5.5.350.0060.02815.25
5.5.340.0020.01914.48
5.5.330.0030.03315.29
5.5.320.0090.01815.23
5.5.310.0110.03115.27
5.5.300.0060.02414.63
5.5.290.0100.01514.63
5.5.280.0060.02315.46
5.5.270.0100.02815.46
5.5.260.0080.03415.50
5.5.250.0050.02115.29
5.5.240.0120.03215.35
5.5.230.0100.00212.53
5.5.220.0060.00812.76
5.5.210.0030.00712.76
5.5.200.0050.00912.88
5.5.190.0060.00612.79
5.5.180.0070.00412.87
5.5.170.0050.00914.33
5.5.160.0060.00612.84
5.5.150.0090.00512.83
5.5.140.0080.00512.73
5.5.130.0040.01012.62
5.5.120.0060.00612.75
5.5.110.0080.00512.74
5.5.100.0090.00712.63
5.5.90.0090.00512.67
5.5.80.0070.00712.75
5.5.70.0040.00612.65
5.5.60.0050.00612.68
5.5.50.0070.00512.79
5.5.40.0040.01012.63
5.5.30.0080.00812.76
5.5.20.0070.00412.83
5.5.10.0070.00512.86
5.5.00.0040.00812.63
5.4.450.0260.02313.84
5.4.440.0350.02113.79
5.4.430.0270.02114.07
5.4.420.0060.02113.94
5.4.410.0070.02413.92
5.4.400.0300.01813.84
5.4.390.0310.01913.75
5.4.380.0110.02113.77
5.4.370.0070.01313.66
5.4.360.0060.01913.60
5.4.350.0060.01811.41
5.4.340.0030.01811.30
5.4.330.0040.00711.14
5.4.320.0070.01711.49
5.4.310.0070.01711.56
5.4.300.0060.02211.56
5.4.290.0080.02011.61
5.4.280.0050.02011.41
5.4.270.0110.02511.51
5.4.260.0090.02311.50
5.4.250.0080.02411.56
5.4.240.0110.01911.54
5.4.230.0090.02211.43
5.4.220.0070.02811.50
5.4.210.0070.02511.55
5.4.200.0090.02411.58
5.4.190.0080.03611.63
5.4.180.0090.03011.59
5.4.170.0060.02111.56
5.4.160.0090.01811.56
5.4.150.0070.01611.44
5.4.140.0070.01711.40
5.4.130.0040.02011.34
5.4.120.0070.01811.44
5.4.110.0080.01811.34
5.4.100.0090.02511.40
5.4.90.0070.02111.37
5.4.80.0060.02211.35
5.4.70.0090.02811.46
5.4.60.0080.02911.35
5.4.50.0070.01911.41
5.4.40.0040.02311.42
5.4.30.0030.02511.47
5.4.20.0090.03511.43
5.4.10.0090.02211.43
5.4.00.0070.02111.29
5.3.290.0070.01811.55
5.3.280.0050.02211.48
5.3.270.0100.03411.45
5.3.260.0080.02211.50
5.3.250.0080.02011.44
5.3.240.0080.01811.45
5.3.230.0070.02011.39
5.3.220.0120.02411.41
5.3.210.0100.02911.39
5.3.200.0100.04311.32
5.3.190.0070.02011.38
5.3.180.0080.03111.46
5.3.170.0080.03411.41
5.3.160.0080.03311.44
5.3.150.0140.03811.45
5.3.140.0080.04011.43
5.3.130.0070.04411.47
5.3.120.0120.03611.44
5.3.110.0070.02611.43
5.3.100.0050.02411.27
5.3.90.0070.02311.21
5.3.80.0030.02211.21
5.3.70.0070.02211.22
5.3.60.0060.02011.24
5.3.50.0060.01911.19
5.3.40.0080.01811.20
5.3.30.0050.02111.12
5.3.20.0060.01911.13
5.3.10.0050.02310.96
5.3.00.0090.01811.04
5.2.170.0070.02410.15
5.2.160.0070.02210.15
5.2.150.0040.02610.15
5.2.140.0090.02410.15
5.2.130.0060.02210.13
5.2.120.0040.02410.13
5.2.110.0100.01910.13
5.2.100.0090.02010.13
5.2.90.0050.02110.13
5.2.80.0070.02110.13
5.2.70.0020.02710.13
5.2.60.0050.02210.10
5.2.50.0080.02710.09
5.2.40.0070.01510.07
5.2.30.0060.01610.07
5.2.20.0040.01810.06
5.2.10.0060.01410.01
5.2.00.0060.0169.95
5.1.60.0070.0169.59
5.1.50.0070.0139.59
5.1.40.0050.0159.58
5.1.30.0040.0169.75
5.1.20.0030.0179.76
5.1.10.0070.0149.62
5.1.00.0040.0189.62
5.0.50.0060.0128.86
5.0.40.0040.0158.79
5.0.30.0070.0208.70
5.0.20.0040.0148.68
5.0.10.0100.0128.67
5.0.00.0050.0208.67
4.4.90.0040.0117.93
4.4.80.0040.0117.92
4.4.70.0020.0117.92
4.4.60.0020.0117.92
4.4.50.0050.0117.92
4.4.40.0010.0167.89
4.4.30.0050.0097.92
4.4.20.0030.0107.96
4.4.10.0020.0127.96
4.4.00.0040.0167.92
4.3.110.0040.0107.87
4.3.100.0040.0127.87
4.3.90.0040.0127.85
4.3.80.0030.0187.83
4.3.70.0050.0117.85
4.3.60.0040.0087.85
4.3.50.0040.0077.85
4.3.40.0030.0157.81
4.3.30.0030.0107.19
4.3.20.0040.0097.18
4.3.10.0020.0107.15
4.3.00.0000.0149.26

preferences:
43.15 ms | 400 KiB | 5 Q