Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13489 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82318 invoked by uid 1010); 24 Oct 2004 13:09:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 82293 invoked from network); 24 Oct 2004 13:09:29 -0000 Received: from unknown (HELO iko.gotobg.net) (80.168.8.116) by pb1.pair.com with SMTP; 24 Oct 2004 13:09:29 -0000 Received: from pd9519909.dip.t-dialin.net ([217.81.153.9] helo=[192.168.0.30]) by iko.gotobg.net with esmtpa (Exim 4.43) id 1CLi7m-0008FB-Pr for internals@lists.php.net; Sun, 24 Oct 2004 16:09:31 +0300 Message-ID: <417BA8FD.2050205@hristov.com> Date: Sun, 24 Oct 2004 15:07:09 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a4) Gecko/20040918 X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - iko.gotobg.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - hristov.com X-Source: X-Source-Args: X-Source-Dir: Subject: [PATCH] is_subclass_of(mixed, string) From: php@hristov.com (Andrey Hristov) Hi, I have cooked a small patch which allows is_subclass_of() the accept not only an object as first parameter but a string as well. When string is passed the function checks whether the class specified is subclass of the second parameter class a{} class b{} extends a{} is_subclass_of("a", "a") //false is_subclass_of("b", "a") //true currently only objects are allowed as first parameter The patch can be seen here : http://www.hristov.com/andrey/projects/php_stuff/patches/is_subclass_of.patch.txt The phpt file is : http://www.hristov.com/andrey/projects/php_stuff/patches/is_subclass_of.phpt Thanks, Andrey