Re: [PHP-DEV] Bug or Feature: ini_get() return value

2002-05-01 Thread derick
Hello Ian, On Wed, 1 May 2002, Ian Thurlbeck wrote: > Is this a bug or a feature? > > Tested on Apache 1.3.22 + PHP 4.1.2 and > Apache 2.0.35 + PHP 4.2.0RC4 > > With php.ini setting "some_var=On" I get the following: > > ini_get("some_var") returns 1 > > Fair enough. > > If you set "some_v

[PHP-DEV] Bug or Feature: ini_get() return value

2002-05-01 Thread Ian Thurlbeck
Dear All Is this a bug or a feature? Tested on Apache 1.3.22 + PHP 4.1.2 and Apache 2.0.35 + PHP 4.2.0RC4 With php.ini setting "some_var=On" I get the following: ini_get("some_var") returns 1 Fair enough. If you set "some_var=Off" the results are: ini_get("some_var") returns "" i.e. ini_

Re: [PHP-DEV] bug or feature?

2001-05-22 Thread Zeev Suraski
At 15:49 22/5/2001, Kristian Köhntopp wrote: >Zeev Suraski wrote: > > It's good that this question was asked, but really, be prepared to the fact > > that 'no' can also be an answer. > >Then let me rephrase the question: What is the recommended >way to signal error conditions from the inside of an

Re: [PHP-DEV] bug or feature?

2001-05-21 Thread Kristian Köhntopp
Zeev Suraski wrote: > It's good that this question was asked, but really, be prepared to the fact > that 'no' can also be an answer. Then let me rephrase the question: What is the recommended way to signal error conditions from the inside of an object constructor? Kristian -- Kristian Köhntopp

Re: [PHP-DEV] bug or feature?

2001-05-21 Thread Zeev Suraski
There's nothing special about $this, and thus, it can be quite a headache to have to implement something that does special things by just assigning to this variable. Let's put it this way, knowing what I know about the engine's implementation, I have very good reasons to say that this is a side

Re: [PHP-DEV] bug or feature?

2001-05-21 Thread Kristian Köhntopp
Stig Sæther Bakken wrote: > I disagree with your conclusion here. If a side-effect is useful > enough and people want to use it, why not document it de-bastardize > it? The fact that other OO languages implement this should be a hint > that it shouldn't be impossible to do in a different OO mode

Re: [PHP-DEV] bug or feature?

2001-05-18 Thread Stig Sæther Bakken
I disagree with your conclusion here. If a side-effect is useful enough and people want to use it, why not document it de-bastardize it? The fact that other OO languages implement this should be a hint that it shouldn't be impossible to do in a different OO model. Why care more about forward co

Re: [PHP-DEV] bug or feature?

2001-05-18 Thread Zeev Suraski
At 20:39 18/5/2001, Hartmut Holzgraefe wrote: >Zeev Suraski wrote: > > > > Guys, > > This isn't up for a vote... It's a side effect of implementation, and > > other implementations may invalidate it. We can't document it as a > > feature, because it may bite us big time in the future. > >Is it j

Re: [PHP-DEV] bug or feature?

2001-05-18 Thread Hartmut Holzgraefe
Zeev Suraski wrote: > > Guys, > This isn't up for a vote... It's a side effect of implementation, and > other implementations may invalidate it. We can't document it as a > feature, because it may bite us big time in the future. Is it just me, or are you refering to very different people by 'w

Re: [PHP-DEV] bug or feature?

2001-05-18 Thread Zeev Suraski
At 20:00 18/5/2001, Andrei Zmievski wrote: >On Fri, 18 May 2001, Zeev Suraski wrote: > > Yes, but still, a side effect. Could end up changing in the future, > and we > > don't want to have to limit ourselves to implementations that have this > > side effect. > >Well, if we define it as a feature

Re: [PHP-DEV] bug or feature?

2001-05-18 Thread Zeev Suraski
Guys, This isn't up for a vote... It's a side effect of implementation, and other implementations may invalidate it. We can't document it as a feature, because it may bite us big time in the future. Zeev At 19:21 18/5/2001, Sebastian Bergmann wrote: >Kristian Köhntopp wrote: > > Assignments

Re: [PHP-DEV] bug or feature?

2001-05-18 Thread Zeev Suraski
At 16:31 18/5/2001, Oyvind Moll wrote: >Could the current behaviour be hard to keep in the future, with the >"$this assignment in constructor" syntax? Yes, it is. Zeev -- PHP Development Mailing List To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-ma

Re: [PHP-DEV] bug or feature?

2001-05-18 Thread Andrei Zmievski
On Fri, 18 May 2001, Zeev Suraski wrote: > Yes, but still, a side effect. Could end up changing in the future, and we > don't want to have to limit ourselves to implementations that have this > side effect. Well, if we define it as a feature, wouldn't you be able to support it in the future im

Re: [PHP-DEV] bug or feature?

2001-05-18 Thread Zeev Suraski
At 16:27 18/5/2001, Andrei Zmievski wrote: >On Fri, 18 May 2001, Zeev Suraski wrote: > > It's generally a side effect of the implementation, so I wouldn't be too > > keen on documenting as a feature, but as an undefined behavior. > >A very useful side effect, perhaps? Yes, but still, a side effec

Re: [PHP-DEV] bug or feature?

2001-05-18 Thread Sebastian Bergmann
Kristian Köhntopp wrote: > Assignments to self (to $this) are a very useful features and > common in other OO languages as well. I'd vote for keeping the > feature, document it as such and making it legal. +1 -- sebastian bergmann[EMAIL PROTECTED]

Re: [PHP-DEV] bug or feature?

2001-05-18 Thread Kristian Köhntopp
Oyvind Moll wrote: > Could the current behaviour be hard to keep in the future, with the > "$this assignment in constructor" syntax? Assignments to self (to $this) are a very useful features and common in other OO languages as well. I'd vote for keeping the feature, document it as such and making

Re: [PHP-DEV] bug or feature?

2001-05-18 Thread Oyvind Moll
* Zeev Suraski <[EMAIL PROTECTED]> | | At 16:08 18/5/2001, Andrei Zmievski wrote: | >On Fri, 18 May 2001, Stig Bakken wrote: | > > Anyway, I'd like to see "$this assignment in constructor": | > > | > > 1. dismissed as a bug | > > 2. documented as a feature, or | > | >+1 from me on this one. | | +

Re: [PHP-DEV] bug or feature?

2001-05-18 Thread Andrei Zmievski
On Fri, 18 May 2001, Zeev Suraski wrote: > It's generally a side effect of the implementation, so I wouldn't be too > keen on documenting as a feature, but as an undefined behavior. A very useful side effect, perhaps? -Andrei "Computers are useless. They can only give you answers."

Re: [PHP-DEV] bug or feature?

2001-05-18 Thread Zeev Suraski
At 16:08 18/5/2001, Andrei Zmievski wrote: >On Fri, 18 May 2001, Stig Bakken wrote: > > Anyway, I'd like to see "$this assignment in constructor": > > > > 1. dismissed as a bug > > 2. documented as a feature, or > >+1 from me on this one. +1 on what? :) It's generally a side effect of the implem

Re: [PHP-DEV] bug or feature?

2001-05-18 Thread Andrei Zmievski
On Fri, 18 May 2001, Stig Bakken wrote: > Anyway, I'd like to see "$this assignment in constructor": > > 1. dismissed as a bug > 2. documented as a feature, or +1 from me on this one. -Andrei Hacker: Any person who derives joy from discovering ways to circumvent limitations. -- PHP D

[PHP-DEV] bug or feature?

2001-05-18 Thread Stig Sæther Bakken
Zeev/Andi, Right now you can "replace" the object returned by "new Foo" by assigning $this in the Foo constructor, like this: class Foo extends PEAR { function Foo() { if (!init_foo_resource()) { $this = $this->raiseError("could not initialize foo resource");