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 public 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.60.0070.01116.61
8.3.50.0190.00121.98
8.3.40.0070.00718.71
8.3.30.0100.00719.22
8.3.20.0000.00820.13
8.3.10.0050.00223.68
8.3.00.0040.00419.26
8.2.180.0000.01516.63
8.2.170.0070.01422.96
8.2.160.0150.00020.12
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0040.00420.98
8.2.110.0100.00019.21
8.2.100.0110.00017.97
8.2.90.0050.00319.28
8.2.80.0040.00417.97
8.2.70.0080.00017.50
8.2.60.0000.00817.93
8.2.50.0030.00618.10
8.2.40.0050.00220.59
8.2.30.0040.00419.50
8.2.20.0070.00217.53
8.2.10.0040.00417.96
8.2.00.0000.00917.55
8.1.280.0090.00625.92
8.1.270.0000.00723.86
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0090.00022.06
8.1.230.0100.00317.75
8.1.220.0090.00017.79
8.1.210.0040.00418.77
8.1.200.0040.00417.23
8.1.190.0040.00417.23
8.1.180.0030.00618.10
8.1.170.0030.00518.47
8.1.160.0000.00722.02
8.1.150.0000.00718.64
8.1.140.0050.00217.48
8.1.130.0050.00317.79
8.1.120.0000.00817.46
8.1.110.0040.00417.50
8.1.100.0000.00717.52
8.1.90.0000.00717.37
8.1.80.0000.00717.48
8.1.70.0000.00717.43
8.1.60.0080.00017.57
8.1.50.0030.00517.43
8.1.40.0040.00817.50
8.1.30.0030.00617.69
8.1.20.0000.00817.61
8.1.10.0040.00417.63
8.1.00.0000.00817.53
8.0.300.0040.00419.88
8.0.290.0070.00016.75
8.0.280.0030.00318.32
8.0.270.0070.00017.17
8.0.260.0040.00417.25
8.0.250.0000.00716.88
8.0.240.0000.00816.99
8.0.230.0000.00717.00
8.0.220.0020.00516.78
8.0.210.0000.00716.78
8.0.200.0040.00416.91
8.0.190.0080.00016.99
8.0.180.0000.00716.83
8.0.170.0050.00316.88
8.0.160.0040.00416.86
8.0.150.0040.00716.79
8.0.140.0000.00816.76
8.0.130.0030.00313.37
8.0.120.0040.00416.75
8.0.110.0070.00016.79
8.0.100.0050.00316.85
8.0.90.0040.00416.88
8.0.80.0090.00616.87
8.0.70.0070.00016.85
8.0.60.0000.00716.70
8.0.50.0000.00816.77
8.0.30.0140.00716.86
8.0.20.0140.00517.40
8.0.10.0000.00716.75
8.0.00.0090.00916.74
7.4.330.0050.00015.07
7.4.320.0000.00616.40
7.4.300.0030.00316.50
7.4.290.0000.00716.55
7.4.280.0030.00916.60
7.4.270.0040.00416.46
7.4.260.0000.00716.50
7.4.250.0040.00416.54
7.4.240.0040.00316.50
7.4.230.0000.00716.34
7.4.220.0140.00316.55
7.4.210.0080.00916.50
7.4.200.0040.00416.45
7.4.190.0040.00416.67
7.4.160.0000.01616.45
7.4.150.0080.00817.40
7.4.140.0070.01117.86
7.4.130.0080.00816.47
7.4.120.0110.00616.58
7.4.110.0120.00616.36
7.4.100.0100.00716.58
7.4.90.0070.01016.59
7.4.80.0030.01319.39
7.4.70.0150.00716.50
7.4.60.0120.00616.49
7.4.50.0000.00516.54
7.4.40.0140.00916.40
7.4.30.0160.00016.43
7.4.00.0090.00715.11
7.3.330.0020.00513.18
7.3.320.0030.00313.38
7.3.310.0040.00416.30
7.3.300.0050.00216.30
7.3.290.0110.01116.36
7.3.280.0080.01016.30
7.3.270.0030.01317.40
7.3.260.0130.00416.28
7.3.250.0050.01516.47
7.3.240.0110.01116.44
7.3.230.0100.00716.61
7.3.210.0000.01816.29
7.3.200.0060.01119.39
7.3.190.0130.00916.51
7.3.180.0090.00616.33
7.3.170.0090.00616.27
7.3.160.0130.00316.59
7.3.120.0080.00814.81
7.3.110.0080.01014.95
7.3.100.0090.00614.77
7.3.90.0050.01014.92
7.3.80.0040.00914.85
7.3.70.0080.00614.61
7.3.60.0100.00314.71
7.3.50.0080.00514.66
7.3.40.0060.00914.77
7.3.30.0050.00914.85
7.3.20.0050.00716.63
7.3.10.0050.00916.53
7.3.00.0070.00516.66
7.2.330.0030.01516.42
7.2.320.0100.00716.55
7.2.310.0130.00316.79
7.2.300.0120.00416.85
7.2.290.0030.01516.64
7.2.250.0080.00915.10
7.2.240.0110.00814.97
7.2.230.0080.00815.16
7.2.220.0030.00915.12
7.2.210.0060.00715.10
7.2.200.0020.01215.13
7.2.190.0090.00314.96
7.2.180.0100.00615.12
7.2.170.0080.00915.15
7.2.130.0110.00316.80
7.2.120.0030.01016.81
7.2.110.0050.00316.95
7.2.100.0030.00716.89
7.2.90.0120.00017.02
7.2.80.0070.00716.85
7.2.70.0040.00817.07
7.2.60.0000.01416.88
7.2.50.0000.01316.80
7.2.40.0000.01316.69
7.2.30.0040.00816.77
7.2.20.0120.00316.88
7.2.10.0050.00516.75
7.2.00.0050.00518.16
7.1.330.0070.00815.67
7.1.320.0080.00515.83
7.1.310.0030.01015.78
7.1.300.0070.00515.71
7.1.290.0080.00515.72
7.1.280.0040.00915.70
7.1.270.0050.00715.67
7.1.260.0030.01015.75
7.1.250.0070.01015.62
7.1.240.0060.00915.75
7.1.230.0060.00615.57
7.1.220.0080.00015.72
7.1.210.0030.00815.58
7.1.200.0000.00915.83
7.1.190.0000.01315.41
7.1.180.0030.00715.63
7.1.170.0030.00915.79
7.1.160.0060.00915.68
7.1.150.0000.01515.56
7.1.140.0040.01115.57
7.1.130.0040.00915.74
7.1.120.0070.01015.70
7.1.110.0110.00415.79
7.1.100.0020.00916.95
7.1.90.0030.00715.80
7.1.80.0060.00315.77
7.1.70.0050.00516.47
7.1.60.0060.01217.66
7.1.50.0070.01216.17
7.1.40.0060.00615.73
7.1.30.0060.00615.51
7.1.20.0030.00515.52
7.1.10.0030.01315.55
7.1.00.0020.04519.06
7.0.330.0030.01015.18
7.0.320.0090.00015.07
7.0.310.0030.01215.31
7.0.300.0060.00915.19
7.0.290.0110.00015.43
7.0.280.0040.01115.37
7.0.270.0080.00615.34
7.0.260.0030.01015.31
7.0.250.0000.01115.23
7.0.240.0000.00815.45
7.0.230.0000.01615.33
7.0.220.0000.01215.12
7.0.210.0040.00715.37
7.0.200.0050.00516.23
7.0.190.0060.00315.42
7.0.180.0070.00315.58
7.0.170.0030.01015.31
7.0.160.0060.00615.47
7.0.150.0000.00915.38
7.0.140.0020.04318.84
7.0.130.0070.00715.07
7.0.120.0050.00515.40
7.0.110.0050.02517.63
7.0.100.0080.04317.62
7.0.90.0140.03817.60
7.0.80.0050.04717.49
7.0.70.0050.04517.77
7.0.60.0070.04217.78
7.0.50.0050.02718.01
7.0.40.0070.03016.84
7.0.30.0070.04616.77
7.0.20.0090.04316.60
7.0.10.0030.04916.78
7.0.00.0080.03716.57
5.6.380.0070.00714.27
5.6.370.0000.01314.49
5.6.360.0030.00714.30
5.6.350.0080.00414.49
5.6.340.0060.00614.08
5.6.330.0070.00714.43
5.6.320.0000.01114.06
5.6.310.0000.01414.21
5.6.300.0090.00614.34
5.6.290.0070.00314.43
5.6.280.0090.03417.75
5.6.270.0000.00914.67
5.6.260.0110.00414.19
5.6.250.0030.03917.40
5.6.240.0140.03317.37
5.6.230.0020.05017.36
5.6.220.0100.04017.48
5.6.210.0050.04217.30
5.6.200.0070.03017.72
5.6.190.0050.04417.93
5.6.180.0070.04117.73
5.6.170.0070.04517.57
5.6.160.0070.03517.65
5.6.150.0100.04317.66
5.6.140.0100.04517.54
5.6.130.0100.04217.74
5.6.120.0050.04817.75
5.6.110.0020.03017.79
5.6.100.0120.04017.77
5.6.90.0070.04517.50
5.6.80.0120.02017.20
5.6.70.0070.04217.14
5.6.60.0030.03317.15
5.6.50.0020.04617.30
5.6.40.0100.04317.13
5.6.30.0090.03517.21
5.6.20.0090.03817.23
5.6.10.0030.04817.48
5.6.00.0120.03917.25
5.5.380.0080.04115.84
5.5.370.0050.04315.72
5.5.360.0080.04015.78
5.5.350.0100.02215.88
5.5.340.0100.04116.00
5.5.330.0000.04216.30
5.5.320.0050.03315.98
5.5.310.0080.02516.11
5.5.300.0070.03915.95
5.5.290.0070.04515.96
5.5.280.0070.04015.97
5.5.270.0040.04516.10
5.5.260.0080.02716.01
5.5.250.0030.04415.91
5.5.240.0110.03515.68
5.5.230.0030.04315.63
5.5.220.0080.04215.82
5.5.210.0080.02615.58
5.5.200.0070.04315.53
5.5.190.0080.04015.62
5.5.180.0070.03315.64
5.5.170.0030.00710.96
5.5.160.0080.02315.68
5.5.150.0080.04115.57
5.5.140.0050.04115.80
5.5.130.0020.04415.74
5.5.120.0100.03515.77
5.5.110.0080.04015.69
5.5.100.0050.04315.58
5.5.90.0030.03815.53
5.5.80.0100.04015.54
5.5.70.0030.02715.53
5.5.60.0070.04315.45
5.5.50.0060.03815.57
5.5.40.0050.04015.52
5.5.30.0070.04215.51
5.5.20.0030.04315.46
5.5.10.0060.03915.44
5.5.00.0090.04015.51
5.4.450.0080.04015.32
5.4.440.0060.04515.17
5.4.430.0060.04115.29
5.4.420.0020.04715.20
5.4.410.0100.04115.06
5.4.400.0080.02215.19
5.4.390.0100.03314.97
5.4.380.0040.03015.01
5.4.370.0030.04115.19
5.4.360.0070.03915.01
5.4.350.0110.03514.95
5.4.340.0030.04214.98
5.4.330.0000.01011.14
5.4.320.0080.04215.01
5.4.310.0090.03815.05
5.4.300.0030.04514.99
5.4.290.0040.03315.23
5.4.280.0090.04015.09
5.4.270.0050.04515.09
5.4.260.0070.04015.22
5.4.250.0070.02415.05
5.4.240.0070.03715.04
5.4.230.0070.03814.99
5.4.220.0070.04115.10
5.4.210.0100.02515.02
5.4.200.0080.03514.97
5.4.190.0050.04515.05
5.4.180.0100.03715.01
5.4.170.0030.04414.92
5.4.160.0070.02414.94
5.4.150.0040.03815.09
5.4.140.0070.03713.69
5.4.130.0030.03713.75
5.4.120.0030.04513.74
5.4.110.0080.02113.66
5.4.100.0050.03713.67
5.4.90.0140.03113.61
5.4.80.0120.03313.60
5.4.70.0050.03813.69
5.4.60.0090.03313.71
5.4.50.0070.03913.62
5.4.40.0040.04113.73
5.4.30.0100.03813.65
5.4.20.0060.03113.65
5.4.10.0050.02213.68
5.4.00.0070.03713.46
5.3.290.0070.04012.90
5.3.280.0030.04312.73
5.3.270.0060.04112.80
5.3.260.0070.03912.76
5.3.250.0060.04012.75
5.3.240.0070.03712.76
5.3.230.0050.02412.82
5.3.220.0050.04112.72
5.3.210.0070.03812.71
5.3.200.0000.04412.74
5.3.190.0030.04212.78
5.3.180.0070.03912.74
5.3.170.0020.03812.80
5.3.160.0110.03612.74
5.3.150.0040.04112.74
5.3.140.0050.03712.75
5.3.130.0070.04312.72
5.3.120.0050.03912.74
5.3.110.0050.03812.72
5.3.100.0050.04012.55
5.3.90.0070.04012.47
5.3.80.0090.03212.45
5.3.70.0030.03812.46
5.3.60.0100.03812.44
5.3.50.0070.03512.40
5.3.40.0050.02512.42
5.3.30.0030.03712.41
5.3.20.0030.03312.31
5.3.10.0050.03912.39
5.3.00.0050.03812.28
5.2.170.0080.02211.03
5.2.160.0060.03211.02
5.2.150.0050.03211.00
5.2.140.0050.03311.00
5.2.130.0070.02711.05
5.2.120.0030.03211.08
5.2.110.0070.03010.98
5.2.100.0070.02710.99
5.2.90.0010.02710.94
5.2.80.0070.02711.12
5.2.70.0060.03011.04
5.2.60.0040.03310.96
5.2.50.0030.03310.97
5.2.40.0050.03011.00
5.2.30.0080.03010.99
5.2.20.0130.02311.00
5.2.10.0030.03510.89
5.2.00.0030.03210.74
5.1.60.0030.02310.45
5.1.50.0080.02710.46
5.1.40.0070.02810.44
5.1.30.0030.03210.67
5.1.20.0060.02710.67
5.1.10.0080.02310.49
5.1.00.0050.02510.48
5.0.50.0010.0219.81
5.0.40.0030.0239.70
5.0.30.0030.0369.60
5.0.20.0060.0209.53
5.0.10.0030.0119.53
5.0.00.0020.0239.66
4.4.90.0020.0199.38
4.4.80.0020.0209.38
4.4.70.0020.0179.38
4.4.60.0070.0179.38
4.4.50.0030.0189.38
4.4.40.0030.0289.38
4.4.30.0020.0189.38
4.4.20.0000.0159.38
4.4.10.0020.0199.38
4.4.00.0020.0289.38
4.3.110.0000.0189.38
4.3.100.0030.0179.38
4.3.90.0000.0179.38
4.3.80.0020.0289.38
4.3.70.0020.0189.38
4.3.60.0000.0229.38
4.3.50.0030.0159.38
4.3.40.0030.0289.38
4.3.30.0010.0199.38
4.3.20.0030.0179.38
4.3.10.0020.0229.38
4.3.00.0050.0139.38

preferences:
45.77 ms | 401 KiB | 5 Q