Forum und email

method_exists

(PHP 4, PHP 5)

method_exists — Zisťuje, či metóda triedy existuje

Popis

bool method_exists ( object $object , string $method_name )

Táto funkcia vracia TRUE ake metóda udaná ako method_name bola definovaná pre daný object , inak FALSE.

Example#1 method_exists() príklad

<?php
$directory 
= new Directory('.');
var_dump(method_exists($directory,'read'));
?>

Výstupom tohto skriptu bude :

bool(true)