ID:               30630
 Updated by:       [EMAIL PROTECTED]
 Reported By:      boccara at netvision dot net dot il
-Status:           Open
+Status:           Feedback
 Bug Type:         Reproducible crash
 Operating System: win 2K / apache 2.0.49
 PHP Version:      4.3.9
 New Comment:

Remove all the zend extensions from your configuration, and try again.
Only disabling them is not good enough!


Previous Comments:
------------------------------------------------------------------------

[2004-10-31 21:45:26] boccara at netvision dot net dot il

function endl()
{
echo "<br>";
}

------------------------------------------------------------------------

[2004-10-31 21:23:23] boccara at netvision dot net dot il

the line 2018 in the fatal error is:

$SousTotal->AddDevis('gagne',$RefEditeur,$Gagne);

------------------------------------------------------------------------

[2004-10-31 21:20:10] boccara at netvision dot net dot il

dbfetch us an function created to choose a fetch according to the
database.
in our case it is MSSQL.
this function works already since 4 years.

Function dbFetch ($iResult, &$tabColonne) {

  $iNbCol = 0; // Permet de recuperer une erreur ou le nombre de
colonnes
  $tabColonne = array();
  switch (SGBD) {

    case "ODBC":
        $iNbCol = odbc_fetch_into($iResult, &$tabColonne);
      break;

    case "MSQL":
        $tabColonne = mysql_fetch_row($iResult);
        if($tabColonne) $iNbCol = count($tabColonne);
      break;

    case "MSSQL":
        $tabColonne = mssql_fetch_array($iResult);
    if($tabColonne)
    {
        $iNbCol = count($tabColonne);
    }
     break;
  }
  return $iNbCol;
}

------------------------------------------------------------------------

[2004-10-31 19:04:31] boccara at netvision dot net dot il

Zend Studio Server  3.5.0
 
 Zend Server Center  3.5.0    
 
 Zend Engine  1.3.0    
 
 PHP  4.3.9    
 
 Zend Optimizer  2.5.5    
 
 Zend Debugger  3.5.2    
 
 Zend Extension Manager  1.0.4 


I also made a test with the Zend Optimiser on OFF and no change
difference , still the fatal error .....

------------------------------------------------------------------------

[2004-10-31 18:22:50] boccara at netvision dot net dot il

Description:
------------
Hello I have a defined a class that manage a 2 dimensions array
(table).
I have created 2 oblect of this class.
These oblect are inside a loop , a fetch from an sql query (MSSQL).
The oblects received data from the query.
Teh problem is that after a certain number of times in the loop (
always the same number of times depending to the query), I got an error
message:
Call to a member function on a non-object

when are called the function of the created object.
This is very strange, the created object seems to be deleted !!

I use Zend Studio, I use the debugger to search the bug, but there is
no syntax bug or anything else !?



Reproduce code:
---------------
class TotDevisParEditeur
{
        var $VecEditeur = array();
        var $value = array();

        function GetValue($type,$editeur)
        {
                return  $this->VecEditeur[$editeur][$type];
        }

        function Display($type,$editeur)
        {
                echo $this->VecEditeur[$editeur][$type];
                endl();
        }

        function AddDevis($type,$editeur,$numOfdevis)
        {
                $value[$type] = $this->GetValue($type,$editeur) + $numOfdevis;

                $this->VecEditeur[$editeur] = $value;

                $this->Display($type,$editeur);
        }
}

/////////////////////////////////////////////////////////

$SousTotal = new TotDevisParEditeur;
        $SousTotalCom = array();
        $SousTotalCom['gagne'] = new TotDevisParEditeur;
        $SousTotalCom['perdu'] = new TotDevisParEditeur;
        $SousTotalCom['encours'] = new TotDevisParEditeur;

        
                
while (dbFetch($iTableTmp, $Col))
{
/*
in this portion of code there is no redefinition of the object !!
just value are assigned to $RefEditeur, $Gagne,...
*/

$SousTotal->AddDevis('gagne',$RefEditeur,$Gagne);
                $SousTotal->AddDevis('perdu',$RefEditeur,$Perdu);
                $SousTotal->AddDevis('encours',$RefEditeur,$Encours);
        
                $SousTotalCom['gagne']->AddDevis($Gestionnaire,$RefEditeur,$Gagne);
                $SousTotalCom['perdu']->AddDevis($Gestionnaire,$RefEditeur,$Perdu);
                $SousTotalCom['encours']->AddDevis($Gestionnaire,$RefEditeur,$Encours);

}



Expected result:
----------------
.... results .....

************************************
0000010215-------VR------>
0
0
2
6---- VR ------>
0
0
2
************************************
0000010215-------CA2------>
0
0
1
6---- CA2 ------>
2
0
1
************************************
0000010215-------VR------>
0
0
1
6---- VR ------>
0
0
3
************************************
0000008896-------VR------>
************************
instead of the error it should continue !!!!!!!!!!!!
*************************

Actual result:
--------------
last section of the result 

************************************
0000010215-------VR------>
0
0
2
6---- VR ------>
0
0
2
************************************
0000010215-------CA2------>
0
0
1
6---- CA2 ------>
2
0
1
************************************
0000010215-------VR------>
0
0
1
6---- VR ------>
0
0
3
************************************
0000008896-------VR------>

Fatal error: Call to a member function on a non-object in c:\Program
Files\Apache Group\Apache2\htdocs\speedevis\lib\StatRev.inc.php on line
2018



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=30630&edit=1

Reply via email to