$property) ? $var->$property : $default; } function show_pdo_errors_if_any($pdo) {// Check for errors after the query execution $errorInfo = $pdo->errorInfo(); if ($errorInfo[0] != '00000') { // If there's an error (the SQLSTATE isn't '00000', which means no error) echo "Error: " . $errorInfo[2]; // The third element contains the error message } } function add_or_initialize(mixed $ar, mixed $key, mixed $increment = 1, mixed $initial = 0) : mixed { return isset($ar[$key]) ? ($ar[$key] += $increment) : $initial; } function add_or_initialize_multi_2(mixed $ar, mixed $key1, mixed $key2, mixed $increment = 1, mixed $initial = 0) : mixed { return isset($ar[$key1][$key2]) ? ($ar[$key1][$key2] += $increment) : $initial; } function add_or_initialize_multi_3(mixed $ar, mixed $key1, mixed $key2, mixed $key3, mixed $increment = 1, mixed $initial = 0) : mixed { return isset($ar[$key1][$key2][$key3]) ? ($ar[$key1][$key2][$key3] += $increment) : $initial; } ?>