Re: [PHP] Reflection question

2009-04-14 Thread Pulni4kiya
The problem is to get the parameters and mostly their type-hinting. At the end I decided to just cast the ReflectionParameter classes to strings and get the type-hinting from there, even though it shouldn't normally be done this way, but I don't think there's a better way now. -- PHP General

[PHP] Reflection question

2009-04-14 Thread Pulni4kiya
Hi, everyone! I need to do the following: Let's say I have this class: class A { public function b(array $c, $d = 6) { ... } } I need to get this in runtime: "public function b(array $c, $d = 6)" What's the best way to do it? (I don't quite like the idea of reading the file in which the class

Re: [PHP] Re: class_is_loadable?

2008-07-05 Thread Pulni4kiya
Well reimplementing autoloading doesn't seem such a bad idea. With the integrated autoload ...there is one very stupid way of doing what you want. Something like this (I suppose you know which class is the parent of the one that is 'missing'): eval("class $class_name extends THE_PARENT {}"); Yo

[PHP] Re: class_is_loadable?

2008-07-05 Thread Pulni4kiya
First of all, I don't think using autoload is recommended. If you really want to do it that way, you could check if the file which autoload will try to include exists and if it does, include it and create your object. Actually to make the script more safe, after including the file you should