|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: louis at mulliemedia dot com
New email:
PHP Version: OS:


 [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: Fri Feb 03 11:03:46 2023 UTC