KennisbankExamencentrum
NL · NLNederlands (Nederland)
Taal kiezen13

CKTIS / PHP

function_exists()

Zoekt zonder hoofdlettergevoeligheid naar een ingebouwde of zelf gedefinieerde functie.

Versie: PHP 8.4; repository runtime, production runtime not attested

Syntax

function_exists(string $function): bool

Zoekt zonder hoofdlettergevoeligheid naar een ingebouwde of zelf gedefinieerde functie. Taalconstructies zoals echo gelden niet als functies. Geef voor een functie in een namespace de gekwalificeerde naam op.

Signatuur

function_exists(string $function): bool

Uitvoer van het voorbeeld

[true,true,false]

Voorbeelden

<?php
namespace Shop;
function total() { return 5; }
echo json_encode([function_exists(__NAMESPACE__ . "\\TOTAL"),function_exists("strlen"),function_exists("echo")]);

Resultaat

[true,true,false]

Bronnen