php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32126 Apache crashes when calling a function declared in a "case" and with global var
Submitted: 2005-02-27 12:11 UTC Modified: 2005-02-27 12:26 UTC
From: ennixo at free dot fr Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.0.2 OS: Windows XP
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ennixo at free dot fr
New email:
PHP Version: OS:

 

 [2005-02-27 12:11 UTC] ennixo at free dot fr
Description:
------------
Apache crashes when calling a php function declared in a case statement and with a global variable.

Reproduce code:
---------------
$a = 1;
switch ($a)
{
    case 1:
        function test ()
        {
            global $plop;
            echo "test $plop";
        }
        $plop = "(bis)";
        test();
        break;
}

Expected result:
----------------
"test (bis)"

Actual result:
--------------
apache crashes.

just move the function outside the switch and it will work.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-27 12:26 UTC] tony2001@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

See #29944.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 09:01:33 2025 UTC