Re: [PHP-DEV] PHP 4.0 Bug #8935 Updated: A reference to 'this' cannot be used in the constructor method for a class.

2001-03-11 Thread Lars Torben Wilson

Jani Taskinen writes:
> On Sun, 11 Mar 2001, Lars Torben Wilson wrote:
> 
> >Now, it's Sunday morning, I just crawled out of my nice warm bed, and
> >I haven't finished my first cup of bad coffee yet--but if
> 
> Have that cup of coffee first.. :)
> 
> >  Duplicate == Repeated information, and
> >  Repeated Information == Useless Bug Report, and
> >  Useless Bug Report == Bogus,
> 
> This is why I added the bogus status. Duplicate != useless.
> Sometimes duplicates add more info to the original report,
> e.g. better gdb backtraces.
> 
> >does not, therefore:
> >
> >  Duplicate == Bogus?
> >And both Duplicate and Bogus mean that the bug report is dead and
> >shouldn't be touched (I tend to agree with Stas on this one):
> 
> Duplicate: Same bug but from different submitter.
>They have also the right to know if bug is fixed.
> 
> Bogus: e.g. A report submitted (accidently) twice. Or some
>empty report without enough info..spam..etc.

OK, that makes a lot more sense, thanks. 
 
> >Just wondering...and this is just an addled early-morning
> >thought...what would be the downside of have a very simple Open/Closed
> >flag field for each report, along with a status modifier field of
> >Duplicate, Analyzed, Bogus, etc.
> 
> Well..we are currently designing the new bug system. And it will
> be more powerful than the current one. And it'll be much easier
> to modify and add new features than the current one is.. :)
> 
> --Jani

Wicked. Lemme know if you need someone to write the docs for it.


-- 
++
|Torben Wilson <[EMAIL PROTECTED]>Adcore Finland|
|http://www.coastnet.com/~torbenhttp://www.adcore.com|
|Ph: 1.604.709.0506 [EMAIL PROTECTED]|
++

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] PHP 4.0 Bug #8935 Updated: A reference to 'this' cannot be used in the constructor method for a class.

2001-03-11 Thread Jani Taskinen

On Sun, 11 Mar 2001, Lars Torben Wilson wrote:

>Now, it's Sunday morning, I just crawled out of my nice warm bed, and
>I haven't finished my first cup of bad coffee yet--but if

Have that cup of coffee first.. :)

>  Duplicate == Repeated information, and
>  Repeated Information == Useless Bug Report, and
>  Useless Bug Report == Bogus,

This is why I added the bogus status. Duplicate != useless.
Sometimes duplicates add more info to the original report,
e.g. better gdb backtraces.

>does not, therefore:
>
>  Duplicate == Bogus?
>And both Duplicate and Bogus mean that the bug report is dead and
>shouldn't be touched (I tend to agree with Stas on this one):

Duplicate: Same bug but from different submitter.
   They have also the right to know if bug is fixed.

Bogus: e.g. A report submitted (accidently) twice. Or some
   empty report without enough info..spam..etc.

>Just wondering...and this is just an addled early-morning
>thought...what would be the downside of have a very simple Open/Closed
>flag field for each report, along with a status modifier field of
>Duplicate, Analyzed, Bogus, etc.

Well..we are currently designing the new bug system. And it will
be more powerful than the current one. And it'll be much easier
to modify and add new features than the current one is.. :)

--Jani



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] PHP 4.0 Bug #8935 Updated: A reference to 'this' cannot be used in the constructor method for a class.

2001-03-11 Thread Lars Torben Wilson

Jani Taskinen writes:
> On Sun, 11 Mar 2001, Stanislav Malyshev wrote:
> 
> >JT>> Uhm..I have always closed the duplicates after the original (which they
> >JT>> refer to) was closed. Any opinions about this? As the current bug system
> >
> >I thought "Duplicate" itself is a closed status. Like, work continues on
> >the original and the duplicate is officialy dead from now, nobody tocuhes
> >it anymore.
> 
> If that bug system was smart enough, it would close childs too when the
> parent is closed. But it isn't. So you should always close also the
> duplicates when the original is fixed. This way the ones who submitted
> the duplicates know also that it's fixed.
> 
> Bogus == Dead. :)
> 
> --Jani

Now, it's Sunday morning, I just crawled out of my nice warm bed, and
I haven't finished my first cup of bad coffee yet--but if 

  Duplicate == Repeated information, and
  Repeated Information == Useless Bug Report, and
  Useless Bug Report == Bogus, 

does not, therefore:

  Duplicate == Bogus?

And both Duplicate and Bogus mean that the bug report is dead and
shouldn't be touched (I tend to agree with Stas on this one):

Just wondering...and this is just an addled early-morning
thought...what would be the downside of have a very simple Open/Closed
flag field for each report, along with a status modifier field of
Duplicate, Analyzed, Bogus, etc.



-- 
++
|Torben Wilson <[EMAIL PROTECTED]>Adcore Finland|
|http://www.coastnet.com/~torbenhttp://www.adcore.com|
|Ph: 1.604.709.0506 [EMAIL PROTECTED]|
++

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] PHP 4.0 Bug #8935 Updated: A reference to 'this' cannot be used in the constructor method for a class.

2001-03-11 Thread Jani Taskinen

On Sun, 11 Mar 2001, Stanislav Malyshev wrote:

>JT>> Uhm..I have always closed the duplicates after the original (which they
>JT>> refer to) was closed. Any opinions about this? As the current bug system
>
>I thought "Duplicate" itself is a closed status. Like, work continues on
>the original and the duplicate is officialy dead from now, nobody tocuhes
>it anymore.

If that bug system was smart enough, it would close childs too when the
parent is closed. But it isn't. So you should always close also the
duplicates when the original is fixed. This way the ones who submitted
the duplicates know also that it's fixed.

Bogus == Dead. :)

--Jani



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] PHP 4.0 Bug #8935 Updated: A reference to 'this' cannot be used in the constructor method for a class.

2001-03-11 Thread Stanislav Malyshev

JT>> Uhm..I have always closed the duplicates after the original (which they
JT>> refer to) was closed. Any opinions about this? As the current bug system

I thought "Duplicate" itself is a closed status. Like, work continues on
the original and the duplicate is officialy dead from now, nobody tocuhes
it anymore.

-- 
Stanislav Malyshev, Zend Products Engineer
[EMAIL PROTECTED]  http://www.zend.com/ +972-3-6139665 ext.115



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] PHP 4.0 Bug #8935 Updated: A reference to 'this' cannot be used in the constructor method for a class.

2001-03-09 Thread Jani Taskinen

On Sat, 10 Mar 2001, André Langhorst wrote:

>Jani Taskinen wrote:
>
>> Uhm..I have always closed the duplicates after the original (which they
>> refer to) was closed. Any opinions about this? As the current bug system
>> doesn't have any support for 'multiple' closing, I think it's better to
>> close bugs after they are fixed, be it a duplicate or not.
>
>I have left the duplicates alone after fixing... hmm, it's better to have them 
>closed,  agreed.

Yep. As that way (if the report has been in status 'duplicate' a long
time) the bug reporter will know that it's now fixed.

--Jani



--
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] PHP 4.0 Bug #8935 Updated: A reference to 'this' cannot be used in the constructor method for a class.

2001-03-09 Thread Derick Rethans

On Sat, 10 Mar 2001, Jani Taskinen wrote:

>
> Uhm..I have always closed the duplicates after the original (which they
> refer to) was closed. Any opinions about this? As the current bug system
> doesn't have any support for 'multiple' closing, I think it's better to
> close bugs after they are fixed, be it a duplicate or not.

Yep, looks to me that duplicate bugs should be closed too. ANyway, that's
how I do it.

Derick



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] PHP 4.0 Bug #8935 Updated: A reference to 'this' cannot be used in the constructor method for a class.

2001-03-09 Thread Jani Taskinen


Uhm..I have always closed the duplicates after the original (which they
refer to) was closed. Any opinions about this? As the current bug system
doesn't have any support for 'multiple' closing, I think it's better to
close bugs after they are fixed, be it a duplicate or not.

--Jani


On 9 Mar 2001 [EMAIL PROTECTED] wrote:

>ID: 8935
>Updated by: andre
>Reported By: [EMAIL PROTECTED]
>Old-Status: Closed
>Status: Duplicate
>Bug Type: Class/Object related
>Assigned To:
>Comments:
>
>not really this is only a duplicate report for an already
>fixed bug...
>
>Previous Comments:
>---
>
>[2001-03-09 17:09:08] [EMAIL PROTECTED]
>It's fixed -> closed.
>
>--Jani
>
>
>---
>
>[2001-03-09 13:50:45] [EMAIL PROTECTED]
>this has been fixed for months,
>please use =& new instead of = new in this special case
>
>---
>
>[2001-02-24 14:14:09] [EMAIL PROTECTED]
>Please see the 4.0.4 release change log a lot of things along this line were fixed.
>
>James
>
>---
>
>[2001-01-26 09:37:16] [EMAIL PROTECTED]
>The following script demonstrates the problem.
>
>/*
>thistest.php
>jp, 2001-01-25
>Demonstration of bug in passing '$this' as a reference in the constructor.
>The problem is that it will not be a reference to the newly created object that is 
>passed but rather a new copy. This is demonstrated below.
>
>The Container class is just a driver class
>
>The bug is demostrated in the A1 class. The A class uses an Init() method to pass the 
>'$this' reference which is a workaround for this particular bug.
>
>Analysis of problem:
>It seems that the '$this' pointer is not safe to use in the constructor since it 
>probably doesn't get properly initialized for the object until after the constructor 
>has been run.
>
>*/
>
>
>
>class ContainerA {
>var $a;
>function ContainerA() {
>$this->a=new A();
>$this->a->Init();
>echo "A val before calling change: ".$this->a->val."";
>$this->a->bobj->ChangeA();
>echo "A val after calling change (should be 3): ".$this->a->val."";
>}
>}
>
>class A {
>var $val=1;
>var $bobj=null;
>
>function A() {
>   $this->bobj = new B();
>}
>function Init() {
>   // Workaround it is safe to use a refernce to this outside the constuctor
>   $this->bobj->Init(&$this);
>}
>function SetVal($v) {
>$this->val=$v;
>}
>};
>
>class B {
>  var $aobj=null;
>  function B() {
>  }
>  function Init(&$obj) {
> $this->aobj=&$obj;
>  }
>  function ChangeA() {
> $this->aobj->SetVal(3);
>  }
>};
>
>class ContainerA1 {
>var $a;
>function ContainerA1() {
>$this->a=new A1();
>echo "A val before calling change: ".$this->a->val."";
>$this->a->bobj->ChangeA();
>echo "A val after calling change (should be 3): ".$this->a->val."";
>}
>}
>
>// BUG
>class A1 {
>var $val=1;
>var $bobj=null;
>
>function A1() {
>$this->bobj = new B();
>
>// BUG. A reference of 'this' is NOT passed here as it seems but a copy!
>// Hence the bobj will contain another copy of A1 and not the one we
>// are just creating.
>$this->bobj->Init(&$this);
>}
>function SetVal($v) {
>$this->val=$v;
>}
>};
>
>echo "Demonstration of 'this' bug.";
>echo "Using class A (workaround)";
>$c1=new ContainerA();
>
>echo "Using class A1 (BUG)";
>$c1=new ContainerA1();
>
>?>
>
>---
>
>
>
>ATTENTION! Do NOT reply to this email!
>To reply, use the web interface found at http://bugs.php.net/?id=8935&edit=2
>
>
>


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]