3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum ReturnValueType { case NumRows; case GetAffectedRows; case GetLastInsertedId; // Instead of just "null" use a more specific value case Nothing; } function runQuery($query, $values = NULL, ReturnValueType $returnValue = ReturnValueType::Nothing) { $ret = match($returnValue){ //query will run here and return the number of rows that are selected ReturnValueType::NumRows => 'Something', //query will run here and return the number of affected rows (for example to check if a create, update or delete is succesfull) ReturnValueType::GetAffectedRows => 'Something else', // query will run and return the ID of the inserted row ReturnValueType::GetLastInsertedId => 'Something else again', // query will execute without any returns ReturnValueType::Nothing => ReturnValueType::Nothing, }; if($ret !== ReturnValueType::Nothing){ return $ret; } } runQuery('', '');

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.5.10.0100.00816.50
8.5.00.0100.01220.04
8.4.150.0020.00114.05
8.4.140.0130.00917.79
8.4.130.0080.00418.03
8.4.120.0040.00522.52
8.4.110.0120.00923.25
8.4.100.0060.00518.58
8.4.90.0090.01018.60
8.4.80.0120.00818.59
8.4.70.0050.00318.01
8.4.60.0130.00718.81
8.4.50.0040.00419.31
8.4.40.0130.00717.58
8.4.30.0100.00020.36
8.4.20.0110.01117.83
8.4.10.0000.00919.52
8.3.280.0100.00918.35
8.3.270.0140.00716.58
8.3.260.0120.00716.77
8.3.250.0140.00518.93
8.3.240.0110.00717.05
8.3.230.0100.00816.58
8.3.220.0090.00719.02
8.3.210.0090.00916.81
8.3.200.0050.00416.50
8.3.190.0090.00916.49
8.3.180.0100.00916.74
8.3.170.0140.00418.83
8.3.160.0140.00716.54
8.3.150.0090.00620.66
8.3.140.0040.00416.98
8.3.130.0050.00318.52
8.3.120.0110.00720.83
8.3.110.0110.00016.58
8.3.100.0030.00716.41
8.3.50.0090.00316.50
8.2.290.0130.00720.16
8.2.280.0120.00716.51
8.2.270.0080.01117.37
8.2.260.0000.00720.14
8.2.250.0040.00416.31
8.2.240.0070.01116.84
8.2.230.0110.00016.58
8.2.220.0030.00716.68
8.2.110.0130.00522.12
8.1.330.0120.00621.91
8.1.320.0090.01016.08
8.1.310.0000.01416.57
8.1.300.0000.01520.25

preferences:
36.68 ms | 403 KiB | 5 Q