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
This patch looks fine to me.
Any objections before I commit it?
Andi
At 03:07 PM 10/24/2004 +0200, Andrey Hristov wrote:
Hi,
I have cooked a small patch which allowsis_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 parameterThe 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.phptThanks,
Andrey
Applied. Can you please update PHP 5.0 NEWS?
Thanks,
Andi
At 03:07 PM 10/24/2004 +0200, Andrey Hristov wrote:
Hi,
I have cooked a small patch which allowsis_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 parameterThe 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.phptThanks,
Andrey