1   <?php
  2   /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3   // +----------------------------------------------------------------------+
  4   // | PHP Version 4                                                        |
  5   // +----------------------------------------------------------------------+
  6   // | Copyright (c) 1997-2004 The PHP Group                                |
  7   // +----------------------------------------------------------------------+
  8   // | This source file is subject to version 3.0 of the PHP license,       |
  9   // | that is bundled with this package in the file LICENSE, and is        |
  10   // | available at through the world-wide-web at                           |
  11   // | http://www.php.net/license/3_0.txt.                                  |
  12   // | If you did not receive a copy of the PHP license and are unable to   |
  13   // | obtain it through the world-wide-web, please send a note to          |
  14   // | license@php.net so we can mail you a copy immediately.               |
  15   // +----------------------------------------------------------------------+
  16   // | Authors: Aidan Lister <aidan@php.net>                                |
  17   // +----------------------------------------------------------------------+
  18   //
  19   // $Id: is_a.php,v 1.1 2004-10-26 18:22:16 kostja Exp $
  20   //
  21  
  22  
  23   /**
  24    * Replace function is_a()
  25    *
  26    * @category    PHP
  27    * @package     PHP_Compat
  28    * @link        http://php.net/function.is_a
  29    * @author      Aidan Lister <aidan@php.net>
  30    * @version     $Revision: 1.1 $
  31    * @since       PHP 4.2.0
  32    * @require     PHP 4.0.0 (is_subclass_of)
  33    */
  34   if (!function_exists('is_a'))
  35   {
  36       function is_a ($object, $class)
  37       {
  38           if (get_class($object) == strtolower($class)) {
  39               return true;
  40           }
  41  
  42           else {
  43               return is_subclass_of($object, $class);
  44           }
  45       }
  46   }
  47  
  48   ?>