function_exists
laravel/octane
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return true if the given function has been defined
function_exists
(
string $function
):
bool
exit(
11
);
}
if (!
function_exists
(
'dd'
)) {
function
dd
(...
$vars
)
{
throw new
DdException
(
$vars
);
bin/bootstrap.php
public function
handle
(
$event
):
void
{
if (!
function_exists
(
'\\Symfony\\Component\\HttpFoundation\\File\\is_uploaded_file'
)) {
require
__DIR__
.
'/../../fixes/fix-symfony-file-validation.php'
;
}
}
src/Listeners/EnsureUploadedFilesAreValid.php
public function
handle
(
$event
):
void
{
if (!
function_exists
(
'\\Symfony\\Component\\HttpFoundation\\File\\move_uploaded_file'
)) {
require
__DIR__
.
'/../../fixes/fix-symfony-file-moving.php'
;
}
}
src/Listeners/EnsureUploadedFilesCanBeMoved.php
protected function
clearOpcodeCache
()
{
foreach ([
'apcu_clear_cache'
,
'opcache_reset'
] as
$function
) {
if (
function_exists
(
$function
)) {
$function
();
}
}
src/Swoole/Handlers/OnWorkerStart.php