Date: 11/10/00
- Next message: paul.d.rowlands <email protected>: "[PHP-DEV] PHP 4.0 Bug #7743: gd lib problems displaying dynamic images"
- Previous message: paul.d.rowlands <email protected>: "[PHP-DEV] PHP 4.0 Bug #7742: Forms not working with php 4.0.3p1 (windows NT)"
- In reply to: Andi Gutmans: "[PHP-DEV] $obj = new foo() patch"
- Next in thread: Andi Gutmans: "[PHP-DEV] Re: [PHP-QA] $obj = new foo() patch"
- Reply: Andi Gutmans: "[PHP-DEV] Re: [PHP-QA] $obj = new foo() patch"
- Reply: Mike Heath: "RE: [PHP-DEV] Re: [PHP-QA] $obj = new foo() patch"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Andi Gutmans wrote:
>
> Guys,
>
> I have submitted a patch to the Zend Engine which is considered
> experimental. It is supposed to fix the problem with the $obj = new foo()
> statement when the constructor of foo() assigns $this by reference to other
> symbol table entries. Basically, the Zend Engine will explicitly assign new
> foo() by reference to $obj because this is pretty much the only thing which
> makes sense in this case.
> NOTE: If you do $obj2 = $obj1 = new foo(), "$obj2 = $obj1" will still
> assign by value and not by reference.
> This patch is only meant to fix this problematic bug which has about 5
> entries in the bugs database.
> Please check it out. If there are any problems/concerns with this bug it is
> best to leave it out for 4.0.4 but it should not harm anyone's scripts.
> The following bugs are probably solved now: 6529, 6896, 7454, 7455, 7482
> Anyway, please grab a fresh CVS tree and check that your OOP code still
> works :)
> Thanks!
> Andi
This code doesn't work no more as it did before:
<?php
class B {
function bb() {
global $a;
echo "b";
$a->aa();
}
}
class A {
function aa() {
echo "A";
}
}
function t() {
global $a;
$a = new A;
$a->aa();
global $b;
$b = new B;
$b->bb();
}
t();
?>
Output should be AbA.
I get:
Ab
Fatal error: Call to a member function on a non-object in
/h/home/kir/public_html/a.php on line 18
--With best regards, Kirill Maximov QA team.
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: paul.d.rowlands <email protected>: "[PHP-DEV] PHP 4.0 Bug #7743: gd lib problems displaying dynamic images"
- Previous message: paul.d.rowlands <email protected>: "[PHP-DEV] PHP 4.0 Bug #7742: Forms not working with php 4.0.3p1 (windows NT)"
- In reply to: Andi Gutmans: "[PHP-DEV] $obj = new foo() patch"
- Next in thread: Andi Gutmans: "[PHP-DEV] Re: [PHP-QA] $obj = new foo() patch"
- Reply: Andi Gutmans: "[PHP-DEV] Re: [PHP-QA] $obj = new foo() patch"
- Reply: Mike Heath: "RE: [PHP-DEV] Re: [PHP-QA] $obj = new foo() patch"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

