php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44210 Parser accepts functions in functions
Submitted: 2008-02-22 10:09 UTC Modified: 2008-02-22 11:17 UTC
From: dorthe at luebbert dot net Assigned:
Status: Not a bug Package: *Compile Issues
PHP Version: 5.2.5 OS: Linux
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: dorthe at luebbert dot net
New email:
PHP Version: OS:

 

 [2008-02-22 10:09 UTC] dorthe at luebbert dot net
Description:
------------
php -l does not report any error on the code listed above(result of a unresolved merge conflict), this means functions are accepted within functions (it does not work if you add public to the doA or doB-function).


Reproduce code:
---------------
<?php
class something
{

  public function getData()
  {
     print "foo";
    function doA()
    {
     return $a;
    }


    function doB()
    {
     return $b;
    }
    print "bar";
    return $data;
  }
}
?>

Expected result:
----------------
error.

Actual result:
--------------
no error

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-22 11:17 UTC] felipe@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

This isn't a bug.

See http://docs.php.net/functions
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 07:01:33 2025 UTC