downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<get_parent_classis_a>
Last updated: Thu, 26 Jun 2008

interface_exists

(PHP 5 >= 5.0.2)

interface_exists — Checks if the interface has been defined

Description

bool interface_exists ( string $interface_name [, bool $autoload ] )

Checks if the given interface has been defined.

Parameters

interface_name

The interface name

autoload

Whether to call __autoload or not by default

Return Values

Returns TRUE if the interface given by interface_name has been defined, FALSE otherwise.

Examples

Example #1 interface_exists() example

<?php
// Check the interface exists before trying to use it
if (interface_exists('MyInterface')) {
   class
MyClass implements MyInterface
  
{
      
// Methods
  
}
}

?>

See Also



add a noteadd a note User Contributed Notes
Checks if the interface has been defined
There are no user contributed notes for this page.




<get_parent_classis_a>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs