3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Programmer { // Class Properties var $name; // Programmer's name var $experience; // How long has been programming var $lang; // Favorite Language var $education; // Highest degree earned // Class Constructor - function same name as the class function Programmer($name, $experience, $lang, $education) { $this->name=$name; $this->experience=$experience; $this->lang=$lang; $this->education=$education; } // Getter/Setter functions for all properties in the class function get_name() { return $this->name; } function set_name($newname) { $this->name = $newname; } function get_experience() { return $this->experience; } function set_experience($newexperience) { $this->experience = $newexperience; } function get_lang() { return $this->lang; } function set_lang($newlang) { $this->lang = $newlang; } function get_education() { return $this->education; } function set_education($neweducation) { $this->education = $neweducation; } // Utility data dump function function output() { echo "Programmer Name: ".$this->name."<br>"; echo $this->name." has ".$this->experience." years of programming experience.<br>"; echo $this->lang." is ".$this->name."'s favorite programming language.<br>"; echo $this->name." holds the degree: ".$this->education."<br><br>"; } } // Instantiating a programmer $paul = new Programmer('Paul Conrad',12,'C++','Bachelor of Science in Computer Science'); $paul->output(); // Oops, Paul has programmed alot longer than 12 year, really is 22 years $paul->set_experience(22); $paul->output(); ?>

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.0120.00316.75
8.3.50.0100.00318.33
8.3.40.0070.00718.84
8.3.30.0100.00319.08
8.3.20.0040.00420.29
8.3.10.0050.00321.73
8.3.00.0050.00319.25
8.2.180.0040.01118.16
8.2.170.0160.00722.96
8.2.160.0110.00420.39
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00022.30
8.2.110.0060.00320.94
8.2.100.0060.00617.84
8.2.90.0000.00919.05
8.2.80.0080.00018.05
8.2.70.0040.00417.63
8.2.60.0030.00517.93
8.2.50.0040.00418.07
8.2.40.0000.00818.09
8.2.30.0040.00419.79
8.2.20.0080.00017.64
8.2.10.0000.00718.06
8.2.00.0070.00017.69
8.1.270.0040.00423.96
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0090.00022.64
8.1.230.0080.00421.04
8.1.220.0000.00818.77
8.1.210.0080.00018.91
8.1.200.0040.00417.35
8.1.190.0050.00317.63
8.1.180.0050.00318.10
8.1.170.0090.00018.76
8.1.160.0040.00418.90
8.1.150.0040.00418.69
8.1.140.0040.00417.34
8.1.130.0050.00317.86
8.1.120.0000.00717.39
8.1.110.0020.00517.46
8.1.100.0070.00017.40
8.1.90.0070.00017.51
8.1.80.0040.00417.51
8.1.70.0000.00717.34
8.1.60.0030.00517.48
8.1.50.0030.00517.61
8.1.40.0040.00417.55
8.1.30.0030.00517.52
8.1.20.0080.00017.60
8.1.10.0000.00717.45
8.1.00.0050.00217.50
8.0.300.0030.00519.90
8.0.290.0040.00416.63
8.0.280.0000.00718.37
8.0.270.0000.00817.29
8.0.260.0000.00717.19
8.0.250.0000.00716.88
8.0.240.0040.00416.97
8.0.230.0070.00016.96
8.0.220.0000.00716.85
8.0.210.0040.00416.79
8.0.200.0040.00416.98
8.0.190.0040.00416.91
8.0.180.0080.00016.90
8.0.170.0050.00316.96
8.0.160.0040.00416.96
8.0.150.0040.00416.88
8.0.140.0040.00416.89
8.0.130.0040.00313.38
8.0.120.0000.00816.98
8.0.110.0040.00416.82
8.0.100.0030.00516.96
8.0.90.0000.00716.87
8.0.80.0070.01316.97
8.0.70.0000.00716.74
8.0.60.0030.00716.94
8.0.50.0050.00216.76
8.0.30.0130.00617.09
8.0.20.0140.00817.40
8.0.10.0080.00016.82
8.0.00.0110.00916.63
7.4.330.0020.00215.03
7.4.320.0030.00316.48
7.4.300.0050.00316.57
7.4.290.0050.00316.45
7.4.280.0060.00316.63
7.4.270.0040.00416.43
7.4.260.0040.00416.50
7.4.250.0040.00416.48
7.4.240.0050.00216.46
7.4.230.0000.00716.61
7.4.220.0150.00316.58
7.4.210.0030.01116.66
7.4.200.0000.00716.44
7.4.190.0030.00516.67
7.4.160.0100.00616.50
7.4.150.0060.01217.40
7.4.140.0060.01117.86
7.4.130.0140.00316.48
7.4.120.0130.00416.58
7.4.110.0090.01516.66
7.4.100.0030.01416.52
7.4.90.0090.00916.53
7.4.80.0180.00619.39
7.4.70.0120.00616.45
7.4.60.0120.00316.54
7.4.50.0000.00816.61
7.4.40.0100.00716.69
7.4.30.0120.00416.50
7.4.10.0030.01414.75
7.4.00.0060.01115.00
7.3.330.0000.00613.39
7.3.320.0000.00513.39
7.3.310.0070.00016.42
7.3.300.0070.00016.23
7.3.290.0100.00416.30
7.3.280.0070.01216.35
7.3.270.0090.00917.40
7.3.260.0090.00916.56
7.3.250.0100.00716.41
7.3.240.0140.00316.52
7.3.230.0200.00016.48
7.3.210.0070.01116.35
7.3.200.0150.00819.39
7.3.190.0070.01516.48
7.3.180.0140.00316.51
7.3.170.0180.00416.30
7.3.160.0080.00816.36
7.3.130.0160.00314.84
7.3.120.0070.00914.76
7.3.110.0060.01314.95
7.3.100.0060.00914.89
7.3.90.0070.00714.59
7.3.80.0040.00814.79
7.3.70.0090.00614.87
7.3.60.0100.00714.96
7.3.50.0030.00714.63
7.3.40.0100.00314.68
7.3.30.0070.01014.63
7.3.20.0000.00916.75
7.3.10.0100.00316.54
7.3.00.0100.00816.69
7.2.330.0100.00716.72
7.2.320.0130.00516.66
7.2.310.0140.00316.63
7.2.300.0000.01516.49
7.2.290.0160.00316.54
7.2.260.0100.00715.11
7.2.250.0040.01414.55
7.2.240.0120.00315.09
7.2.230.0060.00915.05
7.2.220.0080.00815.10
7.2.210.0060.00614.92
7.2.200.0030.01015.15
7.2.190.0060.00315.06
7.2.180.0070.01014.83
7.2.170.0060.01215.09
7.2.160.0040.00815.25
7.2.150.0070.00716.84
7.2.140.0070.01316.93
7.2.130.0100.00716.81
7.2.120.0060.00817.10
7.2.110.0020.01316.99
7.2.100.0030.01116.65
7.2.90.0070.01016.82
7.2.80.0070.00916.98
7.2.70.0050.00516.89
7.2.60.0060.00816.92
7.2.50.0050.00816.86
7.2.40.0100.00317.08
7.2.30.0070.01116.90
7.2.20.0090.01016.88
7.2.10.0120.00516.91
7.2.00.0110.00417.88
7.1.330.0000.01215.71
7.1.320.0060.00615.77
7.1.310.0090.00315.53
7.1.300.0040.00415.56
7.1.290.0060.00915.81
7.1.280.0080.00815.48
7.1.270.0040.01115.80
7.1.260.0070.01115.71
7.1.250.0070.00815.79
7.1.240.0050.00815.68
7.1.230.0070.00615.61
7.1.220.0050.00715.66
7.1.210.0060.00415.56
7.1.200.0020.01215.75
7.1.190.0030.01015.75
7.1.180.0070.01015.69
7.1.170.0080.00615.67
7.1.160.0050.00515.69
7.1.150.0070.01115.73
7.1.140.0000.01215.84
7.1.130.0020.01215.73
7.1.120.0040.00915.51
7.1.110.0090.00415.79
7.1.100.0020.01216.42
7.1.90.0100.00715.65
7.1.80.0040.00915.51
7.1.70.0050.00516.20
7.1.60.0050.01116.29
7.1.50.0040.00916.13
7.1.40.0040.00815.95
7.1.30.0070.00815.90
7.1.20.0070.00515.89
7.1.10.0030.00715.95
7.1.00.0070.00616.02
7.0.330.0100.00515.38
7.0.320.0010.01115.29
7.0.310.0060.00715.39
7.0.300.0030.00915.37
7.0.290.0060.00815.11
7.0.280.0090.00415.38
7.0.270.0040.01115.31
7.0.260.0120.00515.42
7.0.250.0020.01115.52
7.0.240.0050.00615.52
7.0.230.0090.00515.30
7.0.220.0040.00615.46
7.0.210.0060.00615.31
7.0.200.0070.00615.77
7.0.190.0080.00415.84
7.0.180.0070.00515.86
7.0.170.0070.00315.80
7.0.160.0040.00715.68
7.0.150.0020.00915.70
7.0.140.0070.00715.71
7.0.130.0070.00515.74
7.0.120.0090.00315.76
7.0.110.0090.00515.73
7.0.100.0040.00815.79
7.0.90.0070.00615.81
7.0.80.0020.00715.64
7.0.70.0010.00815.75
7.0.60.0030.00615.71
7.0.50.0080.00415.82
7.0.40.0080.00114.11
7.0.30.0050.00413.95
7.0.20.0020.01113.90
7.0.10.0060.00713.97
7.0.00.0050.00614.05
5.6.400.0030.01314.25
5.6.390.0110.00614.67
5.6.380.0060.00714.38
5.6.370.0030.00714.22
5.6.360.0060.00914.34
5.6.350.0090.00614.35
5.6.340.0110.00514.12
5.6.330.0050.00914.34
5.6.320.0050.00814.27
5.6.310.0070.00714.46
5.6.300.0080.01616.37
5.6.290.0080.01716.60
5.6.280.0060.01716.57
5.6.270.0030.02116.49
5.6.260.0120.01516.67
5.6.250.0050.01916.50
5.6.240.0050.01916.46
5.6.230.0070.01616.42
5.6.220.0060.01916.50
5.6.210.0040.01816.57
5.6.200.0060.02016.45
5.6.190.0060.02016.54
5.6.180.0080.01816.42
5.6.170.0060.01916.53
5.6.160.0020.02216.58
5.6.150.0050.02316.65
5.6.140.0050.01716.57
5.6.130.0050.02016.51
5.6.120.0050.02116.39
5.6.110.0070.02516.50
5.6.100.0070.01816.58
5.6.90.0050.02316.66
5.6.80.0080.01816.33
5.6.70.0050.02416.24
5.6.60.0080.02416.27
5.6.50.0060.01816.17
5.6.40.0090.01816.32
5.6.30.0070.02116.21
5.6.20.0050.02016.24
5.6.10.0100.01816.28
5.6.00.0060.02016.24
5.5.380.0080.01514.36
5.5.370.0060.01614.39
5.5.360.0050.01914.38
5.5.350.0040.01714.37
5.5.340.0070.01514.67
5.5.330.0050.02014.54
5.5.320.0040.01614.61
5.5.310.0030.02014.47
5.5.300.0050.02814.55
5.5.290.0030.02014.55
5.5.280.0030.02314.49
5.5.270.0040.02014.50
5.5.260.0030.02014.48
5.5.250.0050.01714.37
5.5.240.0010.02314.37
5.5.230.0070.01814.33
5.5.220.0080.01714.41
5.5.210.0040.02014.36
5.5.200.0050.02814.22
5.5.190.0070.01714.17
5.5.180.0080.02114.35
5.5.170.0050.00912.63
5.5.160.0090.01614.27
5.5.150.0060.01714.31
5.5.140.0030.02214.25
5.5.130.0040.01914.32
5.5.120.0080.01614.25
5.5.110.0050.01714.20
5.5.100.0030.01914.30
5.5.90.0060.02314.28
5.5.80.0060.01614.18
5.5.70.0040.01914.38
5.5.60.0050.02314.06
5.5.50.0050.01814.21
5.5.40.0070.02914.31
5.5.30.0070.01514.24
5.5.20.0060.01614.04
5.5.10.0050.03314.26
5.5.00.0060.01714.17
5.4.450.0030.01814.07
5.4.440.0030.02014.11
5.4.430.0020.01914.05
5.4.420.0120.01414.13
5.4.410.0060.01614.03
5.4.400.0070.01514.02
5.4.390.0030.01714.03
5.4.380.0100.01214.04
5.4.370.0080.01513.95
5.4.360.0090.01713.95
5.4.350.0060.01713.99
5.4.340.0070.01814.00
5.4.330.0070.00411.46
5.4.320.0030.01713.93
5.4.310.0040.01913.94
5.4.300.0070.01613.99
5.4.290.0030.01913.93
5.4.280.0040.01813.95
5.4.270.0020.01813.94
5.4.260.0050.01813.98
5.4.250.0040.02113.96
5.4.240.0050.01413.99
5.4.230.0020.01613.98
5.4.220.0050.01713.96
5.4.210.0080.02713.99
5.4.200.0050.01613.99
5.4.190.0040.02613.99
5.4.180.0060.01713.97
5.4.170.0040.01713.94
5.4.160.0050.01613.98
5.4.150.0070.01513.94
5.4.140.0060.01913.17
5.4.130.0060.01813.20
5.4.120.0070.01613.11
5.4.110.0040.01713.13
5.4.100.0010.02313.17
5.4.90.0070.02213.22
5.4.80.0030.01613.16
5.4.70.0060.01613.12
5.4.60.0030.01713.21
5.4.50.0050.01713.20
5.4.40.0030.03013.23
5.4.30.0050.01513.12
5.4.20.0050.01813.15
5.4.10.0030.01913.16
5.4.00.0060.01712.95
5.3.290.0040.01512.72
5.3.280.0040.01512.72
5.3.270.0030.02412.72
5.3.260.0020.01712.72
5.3.250.0080.01012.72
5.3.240.0080.01312.72
5.3.230.0060.01512.72
5.3.220.0050.01712.72
5.3.210.0010.01912.72
5.3.200.0130.01512.72
5.3.190.0020.02012.72
5.3.180.0030.02812.72
5.3.170.0020.01812.72
5.3.160.0030.01612.72
5.3.150.0050.02112.72
5.3.140.0040.02512.72
5.3.130.0030.01712.72
5.3.120.0110.01612.72
5.3.110.0010.02112.72
5.3.100.0030.01512.72
5.3.90.0030.01812.72
5.3.80.0020.01612.72
5.3.70.0070.01412.72
5.3.60.0030.01712.72
5.3.50.0040.01812.72
5.3.40.0030.01612.72
5.3.30.0050.02412.72
5.3.20.0080.01212.72
5.3.10.0050.01512.72
5.3.00.0050.01312.72
5.2.170.0020.02313.21
5.2.160.0010.02313.21
5.2.150.0040.01913.21
5.2.140.0080.01413.21
5.2.130.0040.01513.21
5.2.120.0020.01913.21
5.2.110.0040.01713.21
5.2.100.0040.01913.21
5.2.90.0020.01713.21
5.2.80.0080.01613.21
5.2.70.0040.01813.21
5.2.60.0030.01713.21
5.2.50.0010.01913.21
5.2.40.0060.01613.21
5.2.30.0030.01813.21
5.2.20.0020.02013.21
5.2.10.0060.01413.21
5.2.00.0060.01613.21
5.1.60.0040.01513.21
5.1.50.0020.01513.21
5.1.40.0030.01313.21
5.1.30.0030.01413.21
5.1.20.0030.01613.21
5.1.10.0040.01313.21
5.1.00.0060.01313.21
5.0.50.0020.01113.21
5.0.40.0050.01113.21
5.0.30.0110.01413.21
5.0.20.0010.01413.21
5.0.10.0050.01113.21
5.0.00.0050.01413.21
4.4.90.0020.01013.21
4.4.80.0010.01013.21
4.4.70.0020.01013.21
4.4.60.0030.00913.21
4.4.50.0020.01113.21
4.4.40.0000.01613.21
4.4.30.0030.00913.21
4.4.20.0030.01113.21
4.4.10.0050.00813.21
4.4.00.0020.01613.21
4.3.110.0020.01113.21
4.3.100.0040.01013.21
4.3.90.0020.00813.21
4.3.80.0020.01413.21
4.3.70.0050.00813.21
4.3.60.0020.01013.21
4.3.50.0040.00713.21
4.3.40.0030.01413.21
4.3.30.0020.01013.21
4.3.20.0020.01013.21
4.3.10.0020.01113.21
4.3.00.0030.01313.21

preferences:
59.32 ms | 400 KiB | 5 Q