ID:               24499
 Updated by:       [EMAIL PROTECTED]
 Reported By:      wks at wks dot ch
-Status:           Critical
+Status:           Closed
 Bug Type:         Zend Engine 2 problem
 Operating System: *
 PHP Version:      5.0.0b1 (beta1)
 Assigned To:      helly
 New Comment:

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.




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

[2003-07-20 12:18:36] [EMAIL PROTECTED]

This affects more than ext/pgsql. some internal facility is wrong it
seems.

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

[2003-07-10 08:53:05] wks at wks dot ch

I've just changed the status from documentation to crash 'cause that's
what it does. In more details:

$this->id is a private variable of the class Id
$id->id is a propertie of a PostgreSQL object

php 5.0.0b1 is unable to dereference the $id->id property of the $id
PostgreSQL object !

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

[2003-07-05 07:25:26] wks at wks dot ch

There's unfortunately been added a note by someone who hasn't
understood the problem at all.

$this->id is a private variable of the class Id
$id-id is a propertie of a PostgreSQL object

php 5.0.0b1 is unable to derive the $id->id property of the $id
PostgreSQL object !

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

[2003-07-05 06:26:07] [EMAIL PROTECTED]

Make it a doc problem since you obviously didn't read the docs. And
close it since it's all your fault :-)

What you're missing....

class {
  private $id;
  function getId() {
    $this->id = 1;
    return $this->id;
  }
}

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

[2003-07-04 11:35:57] wks at wks dot ch

Description:
------------
In a class, if 'private' is used instead of 'var' for a variable
declaration then it fails with the Notice:

Undefined property: stdClassr'.

This still occurs if you make '$record = pg_fetch_object($q); return
$record->id;'

Reproduce code:
---------------
<?php
class   Id
{
        private $id;
//      var     $id;
        public function getId()
        {
                $conn   = pg_connect("dbname=db user=user
password=pwd");
                $q      = pg_query($conn, "SELECT id FROM id");
                $id     = pg_fetch_object($q);
                return $id->id;
        }
}
$id = new Id();
echo $id->getId();
?>

Expected result:
----------------
1

Actual result:
--------------
Notice: Undefined property: stdClass::$id in /path/id_test.php on line
11


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


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

Reply via email to