|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65437 "Cannot redeclare function" alerts only when is used
Submitted: 2013-08-12 12:38 UTC Modified: 2013-08-12 13:38 UTC
From: joni2back at gmail dot com Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
 [2013-08-12 12:38 UTC] joni2back at gmail dot com
PHP throws fatal error only when the duplicate function is called.

Test script:
Fatal error:
    function php()
        function php()


    function php()
        function php()

Expected result:
PHP should notify this problem (duplicate function) regardless the explicit call 
of the function

Actual result:
PHP does not notify if the duplicate function is not used


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-12 13:38 UTC]
-Status: Open +Status: Not a bug
 [2013-08-12 13:38 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 define functions conditionally in PHP:

function a() {
  function b() {}

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Sep 24 19:01:25 2020 UTC