Please drop this thread; we're not changing the behaviour of static.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Quoting Marcus Boerger <[EMAIL PROTECTED]>:
> In fact it may be related. As i said before it is one of the ways to get to
> a class.
>
The class is related to the object. The method is related to the class. Is the
method related to the object? It is not.
There are many indirect ways to get to a
Hello Josh,
Sunday, February 22, 2004, 6:30:38 AM, you wrote:
> If I'm not mistaken, Java does not allow calls to static methods via object
> instances. It simply doesn't make sense to couple the unecessary object instance
> into a method call in which it has absolutely no bearing.
> If the obje
Josh Fuhs wrote:
Quoting Josh Fuhs <[EMAIL PROTECTED]>:
If I'm not mistaken, Java does not allow calls to static methods via
object instances.
Sorry, I retract this. Someone just showed me an example of it.
But it still seems like a bad practice.
So why? as i stated before the only difference betw
> Quoting Josh Fuhs <[EMAIL PROTECTED]>:
> If I'm not mistaken, Java does not allow calls to static methods via
> object instances.
Sorry, I retract this. Someone just showed me an example of it.
But it still seems like a bad practice.
Josh
--
PHP Internals - PHP Runtime Development Mailing Li
Hello Josh,
Sunday, February 22, 2004, 6:44:14 AM, you wrote:
> Sorry, mis-click.
> Quoting Josh Fuhs <[EMAIL PROTECTED]>:
>> If I'm not mistaken, Java does not allow calls to static methods via object
>> instances. It simply doesn't make sense to couple the unecessary object
>> instance
>> int
Also, direct usage of classnames should be allowed, and in this case,
the usual syntax should be used.
ClassName->staticMethod();
On 22 Feb 2004, at 12:30 AM, Josh Fuhs wrote:
$stringName::staticMethod();
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://ww
Sorry, mis-click.
Quoting Josh Fuhs <[EMAIL PROTECTED]>:
> If I'm not mistaken, Java does not allow calls to static methods via object
> instances. It simply doesn't make sense to couple the unecessary object
> instance
> into a method call in which it has absolutely no bearing.
>
> If the objec
If I'm not mistaken, Java does not allow calls to static methods via object
instances. It simply doesn't make sense to couple the unecessary object instance
into a method call in which it has absolutely no bearing.
If the object has nothing to do with the operation, then there's no point for it
to
Isn't this a contradiction?
On 21 Feb 2004, at 9:10 PM, Art Hundiak wrote:
static methods and
static class variables should be consistent. Currently, you cannot
access a
class variable via an object instance.
And for what it's worth, I see no reason why static methods cannot be
called
from ob
On Friday 20 February 2004 20:23, Herr Witten wrote:
> Well, calling a static method from an instance breaks down the logic.
> If it is static, then the instance has absolutely no bearing when
> calling it. Therefore, it logically makes sense to call only from the
> class name.
>
> Moreover, making
Well, calling a static method from an instance breaks down the logic.
If it is static, then the instance has absolutely no bearing when
calling it. Therefore, it logically makes sense to call only from the
class name.
Moreover, making a distinction between the method calling syntax begins
to m
On Wed, 18 Feb 2004 17:37:31 +, Wez Furlong wrote:
> C++ allows $a->bar() when bar() is a static method (yes, it is called
> in a static context there too).
>
> IMO, there should be no error, warning or notice here.
>
I Agree. PHP is fine the way it is.
Cristiano Duarte
--
PHP Internals -
At 17:21 19/02/2004, Marcus Boerger wrote:
calling a static method from
anywhere is absolutley fine. This of course includes calling a static
method of an instance's class, however that is syntactically accomplished.
That's exactly correct.
Zeev
--
PHP Internals - PHP Runtime Development Mailing
At 19:37 18/02/2004, Wez Furlong wrote:
C++ allows $a->bar() when bar() is a static method (yes, it is called
in a static context there too).
IMO, there should be no error, warning or notice here.
Same here.
Zeev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http:
Hello Pierre-Alain,
Thursday, February 19, 2004, 4:28:50 PM, you wrote:
> On Thu, 19 Feb 2004 16:21:50 +0100
> Marcus Boerger <[EMAIL PROTECTED]> wrote:
>> But why the hell do you want a message, calling a static method from
>> anywhere is absolutley fine. This of course includes calling a stati
Pierre-Alain Joye wrote:
And PEAR does not lead PHP devs but the counter, imho.
it_sure_doesnt (althoughItWouldLikeTo) ;)
--
Hartmut Holzgraefe <[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
On Thu, 19 Feb 2004 16:21:50 +0100
Marcus Boerger <[EMAIL PROTECTED]> wrote:
> But why the hell do you want a message, calling a static method from
> anywhere is absolutley fine. This of course includes calling a static
> method of an instance's class, however that is syntactically
> accomplished.
Hello Hans,
Thursday, February 19, 2004, 4:14:53 PM, you wrote:
> Timm Friebe wrote:
>> On Wed, 2004-02-18 at 18:40, Hans Lellelid wrote:
>>
>>>foreach($entities as $ent) {
>>> $peer = $ent->getPeer(); // e.g. might be BookPeer
>>> $peer->doSelect(new Criteria()); //static: BookPeer::do
Hello Pierre-Alain,
Thursday, February 19, 2004, 4:10:09 PM, you wrote:
> On Thu, 19 Feb 2004 16:02:10 +0100 (CET)
> Derick Rethans <[EMAIL PROTECTED]> wrote:
>> But it should get set in non-static methods...which doesn't happen now
>> :)
> $this is set in non static methods if the method is ca
Timm Friebe wrote:
On Wed, 2004-02-18 at 18:40, Hans Lellelid wrote:
foreach($entities as $ent) {
$peer = $ent->getPeer(); // e.g. might be BookPeer
$peer->doSelect(new Criteria()); //static: BookPeer::doSelect()
}
$m= new Reflection_Method($ent->getPeer(), 'doSelect');
$m->invok
Pierre-Alain Joye wrote:
One sure thing, $this should not be set in static methods.
I completely agree - the headache of fixing PEAR's "kind of static"
methods is really annoying, and not really fixable. A method should
either be static, non-static, or split into two methods, one that is
st
On Thu, 19 Feb 2004 16:02:10 +0100 (CET)
Derick Rethans <[EMAIL PROTECTED]> wrote:
> But it should get set in non-static methods...which doesn't happen now
> :)
$this is set in non static methods if the method is called from an
instance of the object and not set if called statically. It's exactly
Pierre-Alain Joye wrote:
One sure thing, $this should not be set in static methods.
ACK
--
Hartmut Holzgraefe <[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Marcus Boerger wrote:
A static and a non static member function are two absolute completley
different things.
sure they are (in certain ways), but when *calling* them (from a class
users point of view, not an implementors point of view) the only
difference is that the static member is guaranteed t
On Thu, 19 Feb 2004, Pierre-Alain Joye wrote:
> On Thu, 19 Feb 2004 15:49:42 +0100
> Marcus Boerger <[EMAIL PROTECTED]> wrote:
>
> > A static and a non static member function are two absolute completley
> > different things. Anyway calling a static method from an instance as
> > $instance->staticm
On Thu, 19 Feb 2004 15:49:42 +0100
Marcus Boerger <[EMAIL PROTECTED]> wrote:
> A static and a non static member function are two absolute completley
> different things. Anyway calling a static method from an instance as
> $instance->staticmethod() or $instance::staticmethod() should be
> allowed.
Hello Hartmut,
Thursday, February 19, 2004, 10:03:33 AM, you wrote:
> Greg Beaver wrote:
>> Hi,
>>
>> I agree that allowing $a->bar() with a static method is too confusing,
>> and should not be allowed. However, the ability to call a static method
>> of an object (variable class name, in othe
On Wed, 2004-02-18 at 18:40, Hans Lellelid wrote:
> Hi -
[...]
> foreach($entities as $ent) {
> $peer = $ent->getPeer(); // e.g. might be BookPeer
> $peer->doSelect(new Criteria()); //static: BookPeer::doSelect()
> }
$m= new Reflection_Method($ent->getPeer(), 'doSelect');
$m->invoke(NU
Hartmut Holzgraefe wrote:
Greg Beaver wrote:
Hi,
I agree that allowing $a->bar() with a static method is too confusing,
and should not be allowed. However, the ability to call a static
method of an object (variable class name, in other words), is
invaluable. What if PHP simply allowed $objec
Greg Beaver wrote:
Hi,
I agree that allowing $a->bar() with a static method is too confusing,
and should not be allowed. However, the ability to call a static method
of an object (variable class name, in other words), is invaluable. What
if PHP simply allowed $object::staticMethod() syntax?
W
On 18 Feb 2004 at 12:33, John Coggeshall wrote:
> No. There is *no* reason why static methods should be called from
an
> object context. Doing so is more than a notice -- its flat out wrong
and
> defeats the entire purpose of having static in the first place...
I agree with John.
I would even
Hi -
Pierre-Alain Joye wrote:
On Wed, 18 Feb 2004 12:23:04 -0500
John Coggeshall <[EMAIL PROTECTED]> wrote:
class foo {
static function bar() {
}
}
$a = new foo();
$a->bar(); /* Unacceptable and contradictory to the concept of static
*/ foo::bar(); /* Acceptable */
I have the sam
On Wed, 18 Feb 2004 12:33:35 -0500
John Coggeshall <[EMAIL PROTECTED]> wrote:
> No. There is *no* reason why static methods should be called from an
> object context. Doing so is more than a notice -- its flat out wrong
> and defeats the entire purpose of having static in the first place...
I on
C++ allows $a->bar() when bar() is a static method (yes, it is called
in a static context there too).
IMO, there should be no error, warning or notice here.
--Wez.
> > class foo {
> > static function bar() {
> > }
> > }
> > $a = new foo();
> > $a->bar(); /* Unacceptable and contradictory to the
On Wed, 18 Feb 2004 12:14:04 -0500
John Coggeshall <[EMAIL PROTECTED]> wrote:
> if I download a new class from some site, or otherwise use someone
> else's code, how do I know other than digging through the source on
> a method's context? If $this isn't set I can't do the check, and if
> then engi
On Wed, 2004-02-18 at 12:30, Pierre-Alain Joye wrote:
> We are talking about the same thing. A notice (error sounds too
> drastic here) should be raised if a static method is called from the
> instanciated object.
No. There is *no* reason why static methods should be called from an
object context
On Wed, 18 Feb 2004 12:23:04 -0500
John Coggeshall <[EMAIL PROTECTED]> wrote:
> class foo {
> static function bar() {
> }
> }
> $a = new foo();
> $a->bar(); /* Unacceptable and contradictory to the concept of static
> */ foo::bar(); /* Acceptable */
I have the same problem as George :
On Wed, 2004-02-18 at 12:21, George Schlossnagle wrote:
> Maybe I'm having a slow-English day, but how is the first sentence here
> is not intrinsically self-contradictory?
:)
class foo {
static function bar() {
}
}
$a = new foo();
$a->bar(); /* Unacceptable and contradictory t
On Feb 18, 2004, at 12:14 PM, John Coggeshall wrote:
This is a completely acceptable thing, and it is IMO completely wrong
to
even allow in the engine. foo::bar() should be the only accepted syntax
for static functions.
Maybe I'm having a slow-English day, but how is the first sentence here
is no
> imho, this is the expected behavior. At least a notice should be raised.
> I do not see a reason to define $this if a method is explicitly defined
> as static (means it should not be called dynamically). Declare the
> same funciton as public|private|protected and everything works fine.
There is
41 matches
Mail list logo