3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Account { private $account_number; private $balance; private $branch; private $account_owner; private $atm_issued; function __construct($account_number,$balance,$branch,$account_owner,$atm_issued) { if($account_owner instanceof AccountHolder) { $this->account_number = $account_number; $this->balance = $balance; $this->branch = $branch; $this->account_owner = $account_owner; $this->account_owner->setAccount($this); $this->atm_issued = $atm_issued; } else { echo "Not a valid accountholder"; die(); } } } class SavingsAccount extends Account { private static $type = "SavingsAccount"; public static function getTypeOfAccount() { return self::$type; } } class CurrentAccount extends Account { private static $type = "CurrentAccount"; public static function getTypeOfAccount() { return self::$type; } } class AccountHolder { private $fullname; private $age; private $mobile; private $account; function __construct($name,$age,$mobile) { $this->fullname = $name; $this->age = $age; $this->mobile = $mobile; } public function setAccount($account) { $this->account = $account; } } $person_1 = new AccountHolder("James",21,9495786); $account_1 = new CurrentAccount(123456,7896.00,"Kochi",$person_1,false); $person_2 = new AccountHolder("John",29,974767345); $account_2 = new SavingsAccount(978563,18765.00,"Pala",$person_2,true); print_r($account_1); print_r($account_2); ?>

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.0150.00018.43
8.3.50.0110.00822.10
8.3.40.0110.00318.89
8.3.30.0160.00018.73
8.3.20.0040.00420.27
8.3.10.0050.00321.73
8.3.00.0080.00019.13
8.2.180.0100.00316.38
8.2.170.0090.00622.96
8.2.160.0120.00619.29
8.2.150.0030.00624.18
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0040.00420.52
8.2.110.0030.00622.17
8.2.100.0100.00317.92
8.2.90.0060.00319.05
8.2.80.0040.00417.97
8.2.70.0030.00617.50
8.2.60.0050.00317.77
8.2.50.0050.00318.10
8.2.40.0040.00420.48
8.2.30.0000.00819.24
8.2.20.0000.00717.69
8.2.10.0040.00418.19
8.2.00.0000.00718.18
8.1.280.0140.00725.92
8.1.270.0040.00423.89
8.1.260.0060.00326.35
8.1.250.0000.00828.09
8.1.240.0060.00323.80
8.1.230.0040.00717.76
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0070.00317.38
8.1.190.0000.00817.35
8.1.180.0000.00918.10
8.1.170.0050.00318.78
8.1.160.0040.00422.61
8.1.150.0000.00718.93
8.1.140.0040.00419.50
8.1.130.0050.00217.57
8.1.120.0050.00517.43
8.1.110.0060.00317.48
8.1.100.0000.00817.36
8.1.90.0000.00717.53
8.1.80.0040.00417.41
8.1.70.0050.00317.50
8.1.60.0040.00417.63
8.1.50.0030.00617.56
8.1.40.0080.00017.52
8.1.30.0080.00017.68
8.1.20.0070.00017.64
8.1.10.0040.00417.64
8.1.00.0020.00517.53
8.0.300.0030.00518.77
8.0.290.0040.00416.75
8.0.280.0070.00018.48
8.0.270.0000.00717.22
8.0.260.0030.00317.15
8.0.250.0050.00216.86
8.0.240.0070.00016.95
8.0.230.0040.00416.84
8.0.220.0000.00716.79
8.0.210.0000.00816.88
8.0.200.0000.00716.98
8.0.190.0000.00817.00
8.0.180.0040.00416.97
8.0.170.0030.00516.81
8.0.160.0040.00416.87
8.0.150.0040.00416.90
8.0.140.0040.00416.86
8.0.130.0000.00613.29
8.0.120.0000.00816.84
8.0.110.0040.00416.73
8.0.100.0040.00416.83
8.0.90.0000.00816.77
8.0.80.0120.00616.94
8.0.70.0070.00016.72
8.0.60.0040.00416.77
8.0.50.0070.00016.92
8.0.30.0050.01317.13
8.0.20.0110.00817.44
8.0.10.0070.00016.98
8.0.00.0130.00316.71
7.4.330.0030.00315.08
7.4.320.0030.00316.43
7.4.300.0000.00616.53
7.4.290.0070.00016.57
7.4.280.0040.00416.54
7.4.270.0030.00316.47
7.4.260.0060.00616.56
7.4.250.0030.00316.39
7.4.240.0000.00716.69
7.4.230.0030.00316.75
7.4.220.0100.00716.53
7.4.210.0120.00616.62
7.4.200.0000.00716.64
7.4.160.0090.00616.48
7.4.150.0120.00617.40
7.4.140.0070.01017.86
7.4.130.0160.00216.48
7.4.120.0090.00816.53
7.4.110.0030.01416.47
7.4.100.0080.00816.39
7.4.90.0090.00916.48
7.4.80.0030.01419.39
7.4.70.0070.01016.42
7.4.60.0090.00616.47
7.4.50.0100.00316.66
7.4.40.0140.00716.72
7.4.30.0000.01716.68
7.4.00.0090.00615.02
7.3.330.0030.00313.21
7.3.320.0000.00613.38
7.3.310.0080.00016.45
7.3.300.0040.00416.21
7.3.290.0080.00016.36
7.3.280.0090.00916.34
7.3.270.0100.00717.40
7.3.260.0100.00816.45
7.3.250.0110.00816.54
7.3.240.0100.00716.31
7.3.230.0090.00916.50
7.3.210.0120.00616.52
7.3.200.0060.01616.29
7.3.190.0060.01216.45
7.3.180.0090.01216.27
7.3.170.0090.00616.25
7.3.160.0170.00316.43
7.3.120.0100.00715.09
7.3.110.0090.00615.13
7.3.100.0060.00914.85
7.3.90.0110.00414.77
7.3.80.0060.00614.77
7.3.70.0090.00614.77
7.3.60.0040.00714.94
7.3.50.0040.01414.66
7.3.40.0040.01114.87
7.3.30.0070.01114.77
7.3.20.0070.01016.59
7.3.10.0120.00616.28
7.3.00.0090.00616.69
7.2.330.0130.00716.84
7.2.320.0110.01216.54
7.2.310.0080.01316.60
7.2.300.0100.00716.83
7.2.290.0100.01316.81
7.2.240.0040.01115.03
7.2.230.0090.00614.99
7.2.220.0070.00715.11
7.2.210.0060.01015.25
7.2.200.0040.00814.96
7.2.190.0030.01615.22
7.2.180.0040.01114.99
7.2.170.0060.00914.81
7.2.160.0070.00714.70
7.2.150.0000.01016.86
7.2.140.0130.00317.03
7.2.130.0040.00816.82
7.2.120.0090.00616.95
7.2.110.0070.01016.77
7.2.100.0000.01116.84
7.2.90.0100.00717.16
7.2.80.0000.01817.05
7.2.70.0120.00016.82
7.2.60.0100.00716.87
7.2.50.0060.00916.97
7.2.40.0080.00817.02
7.2.30.0070.01117.14
7.2.20.0060.00616.98
7.2.10.0070.01016.82
7.2.00.0110.00618.24
7.1.330.0060.01015.80
7.1.320.0070.00715.86
7.1.310.0090.00015.91
7.1.300.0100.00615.71
7.1.290.0000.01515.74
7.1.280.0110.00415.75
7.1.270.0060.01015.84
7.1.260.0060.00615.77
7.1.250.0070.00715.79
7.1.70.0100.00616.93
7.1.60.0040.00819.90
7.1.00.0000.07722.44
7.0.200.0120.00614.96
7.0.80.0370.07319.96
7.0.70.0170.05719.90
7.0.60.0200.05019.95
7.0.50.0100.06720.37
7.0.40.0230.05320.46
7.0.30.0200.05320.36
7.0.20.0230.05020.34
7.0.10.0170.05320.35
7.0.00.0200.05320.37
5.6.230.0130.06320.68
5.6.220.0200.06020.61
5.6.210.0170.05720.77
5.6.200.0130.06321.04
5.6.190.0130.05721.12
5.6.180.0100.06021.14
5.6.170.0100.06021.13
5.6.160.0330.05721.12
5.6.150.0100.06321.12
5.6.140.0170.05021.12
5.6.130.0230.05021.03
5.6.120.0100.06321.21
5.6.110.0100.06321.07
5.6.100.0170.05721.07
5.6.90.0200.05321.08
5.6.80.0170.05320.44
5.6.70.0130.05720.48
5.6.60.0200.05020.51
5.6.50.0130.05720.50
5.6.40.0130.05320.44
5.6.30.0030.06320.56
5.6.20.0130.05320.55
5.6.10.0130.06020.50
5.6.00.0200.06020.54
5.5.370.0070.07020.63
5.5.360.0200.07320.42
5.5.350.0100.07020.50
5.5.340.0030.06720.84
5.5.330.0270.06720.80
5.5.320.0030.06720.86
5.5.310.0170.05720.86
5.5.300.0100.06020.92
5.5.290.0170.05720.95
5.5.280.0130.05720.86
5.5.270.0130.06020.96
5.5.260.0070.06320.87
5.5.250.0100.06020.69
5.5.240.0200.04720.29
5.5.230.0170.05020.29
5.5.220.0230.04320.30
5.5.210.0170.05020.33
5.5.200.0070.06020.21
5.5.190.0130.05720.23
5.5.180.0100.06020.31
5.5.160.0100.06020.15
5.5.150.0130.05320.26
5.5.140.0100.05720.14
5.5.130.0130.05320.25
5.5.120.0130.05320.29
5.5.110.0130.05320.13
5.5.100.0070.06020.14
5.5.90.0030.06020.24
5.5.80.0070.05720.09
5.5.70.0070.06020.18
5.5.60.0030.06020.19
5.5.50.0100.05320.09
5.5.40.0170.04720.20
5.5.30.0130.05320.14
5.5.20.0130.05320.07
5.5.10.0130.05320.08
5.5.00.0100.05720.17

preferences:
60.8 ms | 401 KiB | 5 Q