Currently there is no way to call a class constructor using
call_user_func or something similar, the only way is to use a reflection
object which is useless overhead and takes a few lines of code.
This would be very useful to be able to do
create_new(string $class, array $constructor_args)
Does anyone else see a need for this?
Hi!
create_new(string $class, array $constructor_args)
You can create new object via ReflectionClass::newInstance.
Stanislav Malyshev, Zend Software Architect
stas@zend.com http://www.zend.com/
(408)253-8829 MSN: stas@zend.com
Hi!
create_new(string $class, array $constructor_args)
You can create new object via ReflectionClass::newInstance.
Still, that just seems unnecessary, I usually compile without the
reflection stuff because i never use it. I'd like to be able to use this
like call_user_func, I'm pretty much doing the same thing.
--
Stanislav Malyshev, Zend Software Architect
stas@zend.com http://www.zend.com/
(408)253-8829 MSN: stas@zend.com
Hi all, esp. Johannes,
Am Mittwoch, den 30.04.2008, 13:05 -0400 schrieb Sam Barrow:
[...]
Still, that just seems unnecessary, I usually compile without the
reflection stuff because i never use it. I'd like to be able to use this
like call_user_func, I'm pretty much doing the same thing.
Oh, good hint. As the we already have hard enabling changes (SPL, PCRE)
in 5.3, shouldn't we force enabling reflections?
cu, Lars
Hi all, esp. Johannes,
Am Mittwoch, den 30.04.2008, 13:05 -0400 schrieb Sam Barrow:
[...]Still, that just seems unnecessary, I usually compile without the
reflection stuff because i never use it. I'd like to be able to use this
like call_user_func, I'm pretty much doing the same thing.Oh, good hint. As the we already have hard enabling changes (SPL, PCRE)
in 5.3, shouldn't we force enabling reflections?
Yes, I believe a feature like this should be always enabled,
as it's actually a part of the language/engine.
--
Wbr,
Antony Dovgal
Hello Antony, Johannes,
seeing this thread I agree. So that makes the list: PCRE, Reflection, SPL.
Johannes?
Wednesday, April 30, 2008, 9:22:19 PM, you wrote:
Hi all, esp. Johannes,
Am Mittwoch, den 30.04.2008, 13:05 -0400 schrieb Sam Barrow:
[...]Still, that just seems unnecessary, I usually compile without the
reflection stuff because i never use it. I'd like to be able to use this
like call_user_func, I'm pretty much doing the same thing.Oh, good hint. As the we already have hard enabling changes (SPL, PCRE)
in 5.3, shouldn't we force enabling reflections?
Yes, I believe a feature like this should be always enabled,
as it's actually a part of the language/engine.
--
Wbr,
Antony Dovgal
Best regards,
Marcus
Hello Antony, Johannes,
seeing this thread I agree. So that makes the list: PCRE, Reflection, SPL.
Johannes?
I was under the impression that was already the case for Reflection, so
I don't mind.
johannes
create_new(string $class, array $constructor_args)
Does anyone else see a need for this?
No.
Have you considered subscribing to php-general@?
Could you please first direct these questions to php-general@ and
gather feedback from there before you post it here?
You have been causing a massive amount of completely useless mails for
the last weeks, which is getting very annoying.
If you could first discuss these things on the general user list, or
even do a quick poll on your blog, before bringing them further into
the internals development list I would really appreciate it.
-Hannes
create_new(string $class, array $constructor_args)
Does anyone else see a need for this?
No.
Have you considered subscribing to php-general@?Could you please first direct these questions to php-general@ and
gather feedback from there before you post it here?
You have been causing a massive amount of completely useless mails for
the last weeks, which is getting very annoying.
If you could first discuss these things on the general user list, or
even do a quick poll on your blog, before bringing them further into
the internals development list I would really appreciate it.
I emailed about return type hinting, array access on function returns (1
or 2 emails), and calling class constructors dynamically (1 email). I
want to see if there's a need for any of this and then submit a patch,
I'm not just talking; I've spent quite a bit of time writing code.
PHP generals isn't going to help me with any of this, they're going to
tell me what I already know.
-Hannes