|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-08-09 01:31 UTC] rezinkin at mail dot ru
+++ crashed script:
<?
class B {
var $pA;
function B()
{
}
function Show_m_A()
{
echo $this->pA->Show_m_A();
}
}
class A {
var $m_A;
var $B;
function A($a)
{
$this->m_A = $a;
$this->B = new B();
$this->B->pA = &$this;
}
function Show_m_A()
{
echo "A->m_A = ".$this->m_A.'<BR>';
}
function Show_B_m_A()
{
echo $this->B->Show_m_A();
}
}
$a = new A(1);
$a->Show_m_A();
echo "<HR>";
$a->Show_B_m_A();
echo "<HR>";
$a->m_A = 2;
$a->Show_m_A();
echo "<HR>";
$a->Show_B_m_A();
echo "<HR>";
?>
+++ php.ini - default
+++ Additionlal modules : none
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 20:00:01 2025 UTC |
Here is a "light" version crashing my W2K system. I?ve also attached (in my eyes) equivalent non-crashing code. Crash code: <?php class a { } class b { function b(&$obj) { $this->a=&$obj; $this->a->b=&$this; }} $a=new a; $b=new b($a); ?> //var_dump($b); Equivalent non-crash code: <?php class a { } class b {} $a=new a; $b=new b; $a->b=&$b; $a->b->a=&$a; //var_dump($a); ?>