|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59 $this keyword parser error
Submitted: 1998-02-11 23:38 UTC Modified: 1998-02-12 00:19 UTC
From: jon at clearink dot com Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0b4 OS: solaris 2.5.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jon at clearink dot com
New email:
PHP Version: OS:


 [1998-02-11 23:38 UTC] jon at clearink dot com
referencing a variable which is a string by the $this within a string doesn't work.

$qry = "UPDATE visits SET timeout=Now(), WHERE sessionid='$this->$sid'";

if i do this, it works:

$sid = $this->$sid;
$qry = "UPDATE visits SET timeout=Now(), WHERE sessionid='$sid'";

the parser error is:

Parse error: parse error, expecting `STRING' in includes/ on line 89

$sid is declared at the top of the class as:

var $sid="";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-02-12 00:19 UTC] rasmus
Not a bug, typo in script.

  $sid = $this->$sid  should be $sid=$this->sid
 [2020-03-10 20:52 UTC]
Automatic comment from SVN on behalf of nikic
Log: Added changelog documentation to mb_convert_case()

Patch by thg2k.

Closes php/doc-en#59.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 10:01:29 2024 UTC