3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Singleton { private static ?object $instance = null; public static function GetInstance(): object { // Reflection better here for Dependency Injection into the instance return self::$instance ?? (self::$instance = new self()); } public function __set(string $property, string $value) { $this->{$property} = $value; } public function __get(string $property): mixed { return $this->{$property} ?? null; } protected function __construct() {} private function __clone() {} } class User { use Singleton; protected function __construct() { // Change this to the select inner join query foreach(['id' => 1, 'column' => 'test', 'points' => 3] as $column => $value) $this->$column = $value; } public function save(): mixed { // Change this to an update query return get_object_vars($this); } } User::getInstance()->points = 5; // Dynamically change values var_dump(User::getInstance()->save()); // Then update

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.4.120.0080.01123.85
8.4.110.0100.00822.50
8.4.100.0080.00218.77
8.4.90.0110.00918.71
8.4.80.0060.00417.98
8.4.70.0080.00719.00
8.4.60.0090.01218.72
8.4.50.0110.00918.84
8.4.40.0100.01019.42
8.4.30.0160.00320.34
8.4.20.0110.00718.88
8.4.10.0100.00717.93
8.3.250.0100.00718.80
8.3.240.0130.00717.04
8.3.230.0040.00416.59
8.3.220.0110.00818.96
8.3.210.0150.00517.05
8.3.200.0050.00416.64
8.3.190.0100.00518.84
8.3.180.0110.00818.86
8.3.170.0070.01117.04
8.3.160.0110.00719.14
8.3.150.0060.01216.82
8.3.140.0040.00416.99
8.3.130.0080.00016.68
8.3.120.0060.00320.84
8.3.110.0070.00316.84
8.3.100.0040.00416.90
8.3.90.0150.00316.56
8.3.80.0060.00319.36
8.3.70.0070.00718.81
8.3.60.0110.00416.88
8.3.50.0070.00716.77
8.3.40.0140.00718.59
8.3.30.0110.00318.78
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0070.00026.16
8.2.290.0150.00520.41
8.2.280.0100.01118.46
8.2.270.0060.01218.44
8.2.260.0090.00616.71
8.2.250.0090.00016.57
8.2.240.0050.00319.00
8.2.230.0100.00720.94
8.2.220.0040.00424.06
8.2.210.0030.00526.77
8.2.200.0060.00318.88
8.2.190.0070.00716.63
8.2.180.0040.01125.92
8.2.170.0040.01118.91
8.2.160.0130.00022.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00026.35
8.2.110.0100.00021.06
8.2.100.0090.00317.72
8.2.90.0000.00819.23
8.2.80.0040.00419.39
8.2.70.0060.00317.50
8.2.60.0000.00818.05
8.2.50.0060.00318.07
8.2.40.0070.00018.03
8.2.30.0050.00318.13
8.2.20.0040.00418.13
8.2.10.0040.00419.32
8.2.00.0000.00719.13
8.1.330.0130.00621.98
8.1.320.0110.01016.11
8.1.310.0110.00716.20
8.1.300.0040.00418.23
8.1.290.0070.00718.88
8.1.280.0150.00625.92
8.1.270.0060.00322.08
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0090.00022.19
8.1.230.0070.00318.96
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0000.01017.23
8.1.190.0000.00817.52
8.1.180.0090.00018.77
8.1.170.0090.00018.56
8.1.160.0060.00318.90
8.1.150.0000.00718.86
8.1.140.0080.00018.95
8.1.130.0040.00417.48
8.1.120.0000.00817.52
8.1.110.0000.00817.35
8.1.100.0040.00417.47
8.1.90.0040.00417.35
8.1.80.0040.00417.48
8.1.70.0030.00317.52
8.1.60.0040.00417.58
8.1.50.0030.00617.42
8.1.40.0080.00017.57
8.1.30.0000.00717.55
8.1.20.0040.00417.61
8.1.10.0000.00717.54
8.1.00.0040.00417.45
8.0.300.0040.00418.77
8.0.290.0040.00417.18
8.0.280.0030.00318.44
8.0.270.0030.00318.00
8.0.260.0030.00316.77
8.0.250.0030.00616.99
8.0.240.0070.00016.92
8.0.230.0000.00717.03
8.0.220.0050.00516.95
8.0.210.0000.00716.98
8.0.200.0000.00817.03
8.0.190.0040.00416.93
8.0.180.0070.00017.05
8.0.170.0050.00317.06
8.0.160.0030.00517.00
8.0.150.0000.00716.86
8.0.140.0030.00716.81
8.0.130.0000.00513.43
8.0.120.0000.00816.83
8.0.110.0070.00016.99
8.0.100.0040.00416.96
8.0.90.0050.00216.75
8.0.80.0070.01216.88
8.0.70.0070.00016.96
8.0.60.0000.00816.84
8.0.50.0040.00416.84
8.0.30.0160.02616.92
8.0.20.0260.00916.95
8.0.10.0250.00717.08
8.0.00.0230.01217.12
7.4.330.0020.00215.55
7.4.320.0030.00316.52
7.4.300.0000.00616.62
7.4.290.0020.00516.35
7.4.280.0030.00616.63
7.4.270.0040.00416.52
7.4.260.0030.00313.25
7.4.250.0000.00716.50
7.4.240.0080.00016.58
7.4.230.0070.00016.44
7.4.220.0000.00716.54
7.4.210.0100.01016.65
7.4.200.0030.00316.35
7.4.160.0310.01516.61
7.4.150.0290.01216.51
7.4.140.0240.00616.36
7.4.130.0270.01116.52
7.4.120.0210.01416.47
7.4.110.0290.00916.44
7.4.100.0280.00716.61
7.4.90.0280.00816.42
7.4.80.0250.00716.32
7.4.70.0200.01216.32
7.4.60.0280.00916.30
7.4.50.0240.00316.15
7.4.40.0240.00516.42
7.4.30.0230.01316.37
7.4.20.0250.00816.43
7.4.10.0150.01516.29
7.4.00.0270.01416.41
7.3.330.0030.00616.23
7.3.320.0070.00012.95
7.3.310.0020.00516.06
7.3.300.0000.00616.02
7.3.290.0060.01116.19
7.3.280.0330.00316.14
7.3.270.0230.01516.09
7.3.260.0230.00816.18
7.3.250.0140.01816.13
7.3.240.0300.00216.18
7.3.230.0260.00716.14
7.3.220.0470.01015.94
7.3.210.0270.00616.11
7.3.200.0180.01416.09
7.3.190.0440.01016.12
7.3.180.0230.01216.12
7.3.170.0170.01415.93
7.3.160.0390.00815.96
7.3.150.0300.00616.11
7.3.140.1000.00716.18
7.3.130.0510.00316.18
7.3.120.0560.01215.87
7.3.110.0200.01516.02
7.3.100.0270.00315.93
7.3.90.0190.01316.24
7.3.80.0200.01216.09
7.3.70.0140.01715.98
7.3.60.0350.01116.16
7.3.50.0280.01416.20
7.3.40.0160.01616.11
7.3.30.0250.00816.16
7.3.20.0230.00716.17
7.3.10.0210.01116.17
7.3.00.0390.00316.06

preferences:
28.58 ms | 403 KiB | 5 Q