3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Books{ /* Member variables */ public $price; public $title; /* Member functions */ public function setPrice($par){ $this->price = $par; } public function getPrice(){ echo $this->price.'<br/>'; } public function setTitle($par){ $this->title = $par; } public function getTitle(){ echo $this->title.'<br/>'; } public function __construct($par1 = '',$par2 = ''){ $this->title = $par1; $this->price = $par2; } } class Novel extends Books { public $publisher; public function setPublisher($par){ $this->publisher = $par; } public function getPublisher(){ echo $this->publisher; } } $physics = new Books("Physics for High School" , 2000); $chemistry = new Books("Advanced Chemistry" , 1200); $maths = new Books("Algebra", 3400); $physics->getTitle(); $chemistry->getTitle(); $maths->getTitle(); $physics->getPrice(); $chemistry->getPrice(); $maths->getPrice(); if (class_exists('Novel')) { echo 'yes'; } $pN = new Novel(); $pN->setPublisher("Barnes and Noble"); $pN->getPublisher();

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.70.0110.00418.30
8.3.60.0110.00318.55
8.3.50.0140.00716.39
8.3.40.0070.01118.73
8.3.30.0120.00318.71
8.3.20.0040.00419.14
8.3.10.0080.00023.66
8.3.00.0040.00423.48
8.2.190.0100.00716.58
8.2.180.0110.00416.75
8.2.170.0040.01222.96
8.2.160.0070.00718.89
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00319.14
8.2.110.0040.00721.13
8.2.100.0040.00817.78
8.2.90.0030.00519.68
8.2.80.0000.00817.97
8.2.70.0080.00017.68
8.2.60.0030.00518.05
8.2.50.0050.00318.10
8.2.40.0040.00421.25
8.2.30.0040.00419.25
8.2.20.0000.00818.09
8.2.10.0030.00519.43
8.2.00.0000.00719.43
8.1.280.0070.00725.92
8.1.270.0000.00822.18
8.1.260.0050.00526.35
8.1.250.0030.00728.09
8.1.240.0030.00622.19
8.1.230.0070.00420.89
8.1.220.0080.00017.74
8.1.210.0000.00818.97
8.1.200.0000.00917.48
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0000.00818.76
8.1.160.0000.00818.91
8.1.150.0040.00418.88
8.1.140.0040.00419.53
8.1.130.0000.00717.40
8.1.120.0000.00717.51
8.1.110.0030.00517.44
8.1.100.0040.00417.45
8.1.90.0040.00417.43
8.1.80.0000.00817.36
8.1.70.0000.00717.36
8.1.60.0000.00817.49
8.1.50.0030.00517.57
8.1.40.0050.00217.42
8.1.30.0040.00417.67
8.1.20.0040.00417.73
8.1.10.0000.00817.48
8.1.00.0040.00417.52
8.0.300.0000.00819.67
8.0.290.0030.00516.63
8.0.280.0000.00718.46
8.0.270.0070.00016.87
8.0.260.0040.00416.68
8.0.250.0070.00016.87
8.0.240.0030.00616.98
8.0.230.0000.00916.86
8.0.220.0030.00316.81
8.0.210.0070.00016.89
8.0.200.0030.00316.96
8.0.190.0050.00216.86
8.0.180.0050.00316.88
8.0.170.0050.00316.89
8.0.160.0030.00716.92
8.0.150.0000.00916.79
8.0.140.0000.00816.79
8.0.130.0000.00613.32
8.0.120.0040.00416.77
8.0.110.0000.00716.90
8.0.100.0040.00416.96
8.0.90.0030.00516.93
8.0.80.0020.01916.85
8.0.70.0000.00716.96
8.0.60.0000.00716.84
8.0.50.0040.00416.95
8.0.30.0090.00817.14
8.0.20.0140.00817.40
8.0.10.0000.00716.98
8.0.00.0140.00616.79
7.4.330.0000.00515.55
7.4.320.0070.00016.50
7.4.300.0000.00616.61
7.4.290.0000.00816.54
7.4.280.0000.01016.55
7.4.270.0070.00316.51
7.4.260.0030.00316.59
7.4.250.0080.00016.58
7.4.240.0040.00416.59
7.4.230.0000.00716.59
7.4.220.0040.00416.72
7.4.210.0050.00916.58
7.4.200.0000.00816.36
7.4.160.0080.00816.57
7.4.140.0060.01317.86
7.4.130.0160.00616.46
7.4.120.0080.00916.52
7.4.110.0090.01216.52
7.4.100.0130.00316.51
7.4.90.0090.00816.40
7.4.80.0110.01119.39
7.4.70.0070.01016.55
7.4.60.0100.00616.33
7.4.50.0090.00616.63
7.4.40.0110.00716.43
7.4.10.0030.01414.82
7.4.00.0030.01215.03
7.3.330.0000.00513.17
7.3.320.0030.00313.25
7.3.310.0070.00016.18
7.3.300.0000.00716.18
7.3.290.0000.00716.20
7.3.280.0090.00816.31
7.3.260.0100.01216.36
7.3.240.0130.00916.34
7.3.230.0100.00716.50
7.3.210.0130.00416.43
7.3.200.0120.00916.25
7.3.190.0060.01216.43
7.3.180.0120.00316.21
7.3.170.0060.01016.22
7.3.160.0100.00716.46
7.3.130.0080.00814.72
7.3.120.0070.01014.52
7.3.110.0030.01514.98
7.3.100.0000.01014.89
7.3.90.0040.01114.77
7.3.80.0030.01314.84
7.3.70.0060.00314.70
7.3.60.0060.00614.57
7.3.50.0040.01214.86
7.3.40.0060.00614.73
7.3.30.0000.00814.68
7.3.20.0120.00316.86
7.3.10.0040.00816.43
7.3.00.0110.00716.69
7.2.330.0110.00816.50
7.2.320.0120.00616.78
7.2.310.0130.00616.49
7.2.300.0120.01216.95
7.2.290.0090.00916.44
7.2.260.0090.00615.38
7.2.250.0070.01115.00
7.2.240.0070.01015.06
7.2.230.0060.01015.30
7.2.220.0000.01114.82
7.2.210.0120.00615.39
7.2.200.0000.01115.14
7.2.190.0090.00615.27
7.2.180.0030.01014.86
7.2.170.0030.01215.25
7.2.160.0060.00614.88
7.2.150.0070.00316.95
7.2.140.0070.00716.98
7.2.130.0080.00816.55
7.2.120.0120.00016.57
7.2.110.0060.00616.85
7.2.100.0100.00616.82
7.2.90.0040.01116.68
7.2.80.0190.00815.95
7.2.70.0140.00916.04
7.2.60.0110.01115.95
7.2.50.0150.00616.08
7.2.40.0150.01115.84
7.2.30.0130.01116.03
7.2.20.0140.00715.93
7.2.10.0120.01016.02
7.2.00.0120.01215.99
7.1.330.0040.01115.88
7.1.320.0100.00315.67
7.1.310.0030.00715.64
7.1.300.0100.00715.76
7.1.290.0110.00415.85
7.1.280.0070.01015.96
7.1.270.0060.00615.41
7.1.260.0110.00715.62
7.1.250.0060.00615.52
7.1.240.0040.00815.84
7.1.230.0070.01015.63
7.1.220.0060.00615.66
7.1.210.0000.01715.76
7.1.200.0050.00715.66
7.1.190.0120.00814.83
7.1.180.0120.01314.92
7.1.170.0140.00714.76
7.1.160.0160.00714.81
7.1.150.0120.01014.76
7.1.140.0100.00914.89
7.1.130.0100.01214.63
7.1.120.0140.00714.85
7.1.110.0170.00714.91
7.1.100.0120.01014.92
7.1.90.0170.01214.79
7.1.80.0180.00914.81
7.1.70.0200.01114.88
7.1.60.0370.00923.79
7.1.50.0330.01023.64
7.1.40.0240.01123.73
7.1.30.0320.00723.98
7.1.20.0360.00523.72
7.1.10.0170.00914.71
7.1.00.0170.00914.61
7.0.330.0060.00615.08
7.0.320.0030.00915.18
7.0.310.0060.01215.27
7.0.300.0000.01715.07
7.0.290.0100.00015.35
7.0.280.0030.00615.07
7.0.270.0090.00915.12
7.0.260.0000.01415.33
7.0.250.0030.01015.41
7.0.240.0070.00715.11
7.0.230.0000.00715.43
7.0.220.0090.00015.46
7.0.210.0070.00715.48
7.0.200.0040.00915.36
7.0.190.0140.00315.39
7.0.180.0000.01415.15
7.0.170.0070.00715.28
7.0.160.0000.01515.37
7.0.150.0070.00715.51
7.0.140.0070.00715.54
7.0.130.0050.00515.47
7.0.120.0100.00315.50
7.0.110.0000.00815.15
7.0.100.0100.00315.25
7.0.90.0110.00315.50
7.0.80.0050.00315.33
7.0.70.0060.00915.51
7.0.60.0060.00915.38
7.0.50.0040.01115.25
7.0.40.0000.01313.64
7.0.30.0140.00013.44
7.0.20.0030.00513.53
7.0.10.0100.00713.29
7.0.00.0040.01113.44
5.6.400.0060.00814.27
5.6.390.0040.01214.55
5.6.380.0070.01014.37
5.6.370.0030.00614.54
5.6.360.0080.00814.42
5.6.350.0050.00514.16
5.6.340.0070.00714.28
5.6.330.0080.00814.41
5.6.320.0000.00814.57
5.6.310.0040.01214.11
5.6.300.0030.01014.20
5.6.290.0060.00614.67
5.6.280.0120.00314.21
5.6.270.0100.00314.55
5.6.260.0030.00614.68
5.6.250.0040.01214.78
5.6.240.0040.01114.19
5.6.230.0030.00714.35
5.6.220.0130.00314.48
5.6.210.0000.01414.37
5.6.200.0040.00414.27
5.6.190.0070.00714.53
5.6.180.0050.00814.21
5.6.170.0090.00614.32
5.6.160.0070.01014.64
5.6.150.0060.00914.18
5.6.140.0030.01014.13
5.6.130.0060.00614.46
5.6.120.0030.00614.36
5.6.110.0030.01414.67
5.6.100.0000.01214.53
5.6.90.0040.01214.20
5.6.80.0030.01014.14
5.6.70.0060.00914.20
5.6.60.0080.00814.55
5.6.50.0040.01114.53
5.6.40.0100.00314.26
5.6.30.0070.00714.23
5.6.20.0060.00914.28
5.6.10.0060.00614.29
5.6.00.0000.00914.14

preferences:
17.72 ms | 401 KiB | 5 Q