|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29308 Using the $this->* syntax in a method's argument list produces a parse error.
Submitted: 2004-07-21 18:19 UTC Modified: 2004-07-21 20:29 UTC
From: louis at mulliemedia dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.0.0 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
4 + 47 = ?
Subscribe to this entry?

 [2004-07-21 18:19 UTC] louis at mulliemedia dot com
Using the $this->* syntax in a method's argument list produces a parse error at runtime.

PHP Version 5.0.0RC3

Reproduce code:

class Test
    var $LastResultSet='this Should print';
    function Test($Arg = $this->LastResultSet)
       print $Arg;

$ob = &new Test;

Expected result:
this Should print

Actual result:
Error in C:\Development\0.0.2\\test.php on line 6: parse error, unexpected T_VARIABLE


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-21 20:29 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

You can only use constants as default values.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Mar 28 05:03:37 2023 UTC