3v4l.org

run code in 300+ PHP versions simultaneously
<?php <?php function getListTableForeignKeysSQL($table, $database = null) { $sql = "SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, ". "k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ ". "FROM information_schema.key_column_usage k /*!50116 ". "INNER JOIN information_schema.referential_constraints c ON ". " c.constraint_name = k.constraint_name AND ". " c.table_name = '$table' */ WHERE k.table_name = '$table'"; $databaseNameSql = null === $database ? "'$database'" : 'DATABASE()'; $sql .= " AND k.table_schema = $databaseNameSql /*!50116 AND c.constraint_schema = $databaseNameSql */"; $sql .= " AND k.`REFERENCED_COLUMN_NAME` is not NULL"; return $sql; } echo getListTableForeignKeysSQL('AreaLayoutsUsingPresets'). "\n"; echo getListTableForeignKeysSQL('AreaLayoutsUsingPresets', 'concrete5db'). "\n";

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)
5.6.130.0070.05718.13
5.6.120.0000.06021.00
5.6.110.0100.06720.93
5.6.100.0100.08320.95
5.6.90.0000.09020.98
5.6.80.0100.08020.52
5.5.290.0130.08017.96
5.5.280.0130.07720.86
5.5.270.0230.06320.95
5.5.260.0000.07720.67
5.5.250.0100.07320.57
5.5.240.0030.07720.32
5.4.450.0730.05019.15
5.4.440.0730.05719.47
5.4.430.0670.05019.58
5.4.420.0530.05319.45
5.4.410.0430.05719.34
5.4.400.0470.06018.96
5.4.390.0600.04719.07
5.4.380.0700.05018.96
5.4.370.0570.05319.29
5.4.360.0600.06318.82
5.4.350.0600.07019.13
5.4.340.0570.05319.22
5.4.320.0400.06319.22
5.4.310.0600.06319.38
5.4.300.0500.07319.11
5.4.290.0500.04719.29
5.4.280.0470.05719.00
5.4.270.0530.04319.00
5.4.260.0530.05318.96
5.4.250.0600.06019.05
5.4.240.0570.05319.25
5.4.230.0530.05019.00
5.4.220.0370.05718.95
5.4.210.0370.05319.28
5.4.200.0200.04719.28
5.4.190.0000.06319.13
5.4.180.0200.05718.95
5.4.170.0500.05019.28
5.4.160.0370.06018.98
5.4.150.0570.04319.35
5.4.140.0470.04316.56
5.4.130.0130.04316.39
5.4.120.0170.04016.32
5.4.110.0130.04716.16
5.4.100.0370.05316.67
5.4.90.0370.05016.27
5.4.80.0130.05316.49
5.4.70.0330.04716.53
5.4.60.0030.05316.53
5.4.50.0030.07016.24
5.4.40.0200.06716.51
5.4.30.0400.05716.34
5.4.20.0270.05016.33

preferences:
141.6 ms | 1394 KiB | 7 Q