php.net |  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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: louis at mulliemedia dot com
New email:
PHP Version: OS:

 

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

PHP Version 5.0.0RC3

Reproduce code:
---------------
<?php

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

}
$ob = &new Test;
$ob->Test();
?>

Expected result:
----------------
this Should print

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

Patches

Pull Requests

History

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

You can only use constants as default values.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 03:01:28 2024 UTC