php.net |  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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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/functions.inc on line 89

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

var $sid="";

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] nikic@php.net
Automatic comment from SVN on behalf of nikic
Revision: http://svn.php.net/viewvc/?view=revision&revision=349373
Log: Added changelog documentation to mb_convert_case()

Patch by thg2k.

Closes php/doc-en#59.
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Feb 08 02:05:49 2023 UTC