|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-09-30 14:52 UTC] sniper@php.net
[2003-09-30 14:54 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 17:00:01 2025 UTC |
Description: ------------ This is a weird bug, because I do only get it in some browsers. It works fine in IExplorer, links, but not in Konqueror. All browsers are "cookies enable". I have a class, with some vars. When I use session_start in a class->function, i cannot access $this nor $this->vars I read some similar bugs are in php4.0 and solved in 4.1.0 and I have 4.1.2 Reproduce code: --------------- class PayUser { var $pay_user, $passwd, $ses_id, $db, $new; function PayUser($id) { include_once("base.php"); // this is where i create $db $this->db = $db; $select = $this->db->exec("SELECT * from pay_users where p_user='$id'"); // this means $this->db exists and it works /// code omited.. } function login($pass) { // print_r($this) // before the session_start() prints me the object session_start(); print_r($this) /// after session_start() $this is not asigned $sid = session_id(); $sql = "UPDATE pay_users SET ses_id='$sid' where p_user='".$this->pay_user."'"; $this->db->exec($sql); // Fatal error: Call to a member function on a non-object in this line... because $this does not exist // more code omited Expected result: ---------------- in the print($this) i should expect to print payuser Object ( [db] => database Object ( [con] => adodb_postgres7 Object ( [databaseType] => postgres7 [hasLimit] => 1 [ansiOuter] => 1 [dataProvider] => postgres... and the $this->db->exec($sql); should be executed, not to give the Fatal error: Call to a member function on a non-object in this line Actual result: -------------- the error... and the $this is lost...