Files
MediCompanions/app/functions.php
T
2026-06-22 11:23:05 +08:00

45 lines
937 B
PHP

<?php
/**
* Here is your custom functions.
*/
if (!function_exists('dd')) {
/**
* Dump the passed variables and end the script.
*
* @param mixed ...$args
* @return void
*/
function dd(...$args): void
{
if (!in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && !headers_sent()) {
header('Content-Type: text/html; charset=utf-8');
}
foreach ($args as $arg) {
\var_dump($arg);
}
exit(1);
}
}
if (!function_exists('dump')) {
/**
* Dump the passed variables without ending the script.
*
* @param mixed ...$args
* @return void
*/
function dump(...$args): void
{
if (!in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && !headers_sent()) {
header('Content-Type: text/html; charset=utf-8');
}
foreach ($args as $arg) {
\var_dump($arg);
}
}
}