Re: [PHP-DEV] $this availability inside static-functions

2005-07-26 Thread Sebastian Mendel
Andi Gutmans wrote: > I haven't quite understood what is wrong with instantiating the object. i think its faster to just pull out the name (single value) from a database than the whole object (row or even rows from different tables) > After all, it most probably reflects some external data (or t

Re: [PHP-DEV] $this availability inside static-functions

2005-07-25 Thread Andi Gutmans
I haven't quite understood what is wrong with instantiating the object. After all, it most probably reflects some external data (or the name wouldn't mean anything). Not creating the object itself won't save you anything. Anyway, you can still do Foo::getName($object_id), if that $object_id cor

Re: [PHP-DEV] $this availability inside static-functions

2005-07-22 Thread Sebastian Mendel
patrick müller wrote: > Sebastian Mendel wrote: > >> how about if i need a name for object not loaded? >> >> Class::getName( $object_id ); >> > > Weird, i thought you must know the classname for a static > call :) not the classname, the objectname f.e. the name for the object of type customer wit

Re: [PHP-DEV] $this availability inside static-functions

2005-07-22 Thread patrick müller
Sebastian Mendel wrote: how about if i need a name for object not loaded? Class::getName( $object_id ); Weird, i thought you must know the classname for a static call :) -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] $this availability inside static-functions

2005-07-21 Thread Sebastian Mendel
Sean Coates wrote: >> i know this hack, but it does not work, if the statically called method >> is from the same class as the calling object > > Good point. Sorry for not noticing. > ... I have no idea WHY someone would want to do this.. that said, I > don't know of a way to do it, either. a fun

Re: [PHP-DEV] $this availability inside static-functions

2005-07-21 Thread Sean Coates
i know this hack, but it does not work, if the statically called method is from the same class as the calling object Good point. Sorry for not noticing. .. I have no idea WHY someone would want to do this.. that said, I don't know of a way to do it, either. S -- PHP Internals - PHP Runtime D

Re: [PHP-DEV] $this availability inside static-functions

2005-07-21 Thread Sebastian Mendel
Sean Coates schrieb: >> how can i check if a method is called statically when called from inside >> another object? (without debug_bactrace()) > > type="own">http://blog.phpdoc.info/archives/4-Schizophrenic-Methods.html > > Short answer: > $isStatic = !(isset($this) && get_class($this) == __CLAS

Re: [PHP-DEV] $this availability inside static-functions

2005-07-21 Thread Sean Coates
how can i check if a method is called statically when called from inside another object? (without debug_bactrace()) type="own">http://blog.phpdoc.info/archives/4-Schizophrenic-Methods.html Short answer: $isStatic = !(isset($this) && get_class($this) == __CLASS__); HTH S -- PHP Internals - P

[PHP-DEV] $this availability inside static-functions

2005-07-21 Thread Sebastian Mendel
Hi, at first, im really really sorry to bother the internals-list with this problem (especially Derick for coming back from playing somewhere else ... (<[EMAIL PROTECTED]>) ), but i didnt find an answer on php.general or german php mailinglist if anybody just can point me to any discussions, webs