From: wks at wks dot ch
Operating system: FreeBSD 4.5
PHP version: 5.0.0b1 (beta1)
PHP Bug Type: PostgreSQL related
Bug description: Notice: Undefined property: stdClass::
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 bug report at http://bugs.php.net/?id=24499&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=24499&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=24499&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24499&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24499&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24499&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24499&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24499&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24499&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24499&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24499&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24499&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24499&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24499&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24499&r=gnused