extension_loaded
symfony/var-dumper
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Find out whether an extension is loaded
extension_loaded
(
string $extension
):
bool
{
$location
=
$timeZone
->
getLocation
();
$formatted
= (new
\DateTime
(
'now'
,
$timeZone
))->
format
(
$location
?
'e (P)'
:
'P'
);
$title
=
$location
&&
\extension_loaded
(
'intl'
) ?
\Locale
::
getDisplayRegion
(
'-'
.
$location
[
'country_code'
]) :
''
;
$z
= [
Caster
::
PREFIX_VIRTUAL
.
'timezone'
=> new
ConstStub
(
$formatted
,
$title
)];
Caster/DateCaster.php
public function
provideTimeZones
()
{
$xRegion
=
\extension_loaded
(
'intl'
) ?
'%s'
:
''
;
return [
Tests/Caster/DateCasterTest.php
public function
testGenerator
()
{
if (
\extension_loaded
(
'xdebug'
)) {
$this
->
markTestSkipped
(
'xdebug is active'
);
}
Tests/Caster/ReflectionCasterTest.php