Cheetah
is_a.php
Go to the documentation of this file.
1 <?php
2 
8 // +----------------------------------------------------------------------+
9 // | PHP Version 4 |
10 // +----------------------------------------------------------------------+
11 // | Copyright (c) 1997-2004 The PHP Group |
12 // +----------------------------------------------------------------------+
13 // | This source file is subject to version 3.0 of the PHP license, |
14 // | that is bundled with this package in the file LICENSE, and is |
15 // | available at through the world-wide-web at |
16 // | http://www.php.net/license/3_0.txt. |
17 // | If you did not receive a copy of the PHP license and are unable to |
18 // | obtain it through the world-wide-web, please send a note to |
19 // | license@php.net so we can mail you a copy immediately. |
20 // +----------------------------------------------------------------------+
21 // | Authors: Aidan Lister <aidan@php.net> |
22 // +----------------------------------------------------------------------+
23 //
24 // $Id: is_a.php,v 1.2 2005/11/21 10:57:23 ggiunta Exp $
25 
26 
38 if (!function_exists('is_a')) {
39  function is_a($object, $class)
40  {
41  if (!is_object($object)) {
42  return false;
43  }
44 
45  if (get_class($object) == strtolower($class)) {
46  return true;
47  } else {
48  return is_subclass_of($object, $class);
49  }
50  }
51 }
52 
53 ?>
php