php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13850 CASE within SWITCH may crash apache
Submitted: 2001-10-27 13:12 UTC Modified: 2001-11-18 10:06 UTC
From: oxnoxo at web dot de Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.4 OS: Windows 2000 Pro SP1
Private report: No CVE-ID: None
 [2001-10-27 13:12 UTC] oxnoxo at web dot de
The following script raised an error in apache (1.3.19)permantly. The error message describes an "Memory Write Problem".

The reason are the operators after CASE. If they are removed
the script runs without errors.

The error can be reproduced.

I've tried it with different activated modules in PHP but the problem persists.

I think it should be better to put this into the documentation.

<?php

$foo = 20

switch($foo)
{
    case <50:
              echo "Less than 50";
              break;

    case >50 && <100
              echo "Between 50 and 100";
              break;

    default:
              echo "100";
              break;
}
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-28 11:17 UTC] jeroen@php.net
Unable to reproduce with 4.0.3pl1 or latest dev on linux, and also I can't reproduce on 4.0.4pl1 on windows.

I get (correctly) a parse error on (incorrectly, but known 'feature') the line with the switch.

Please try to upgrade, use at least 4.0.4pl1 and not 4.0.4.
 [2001-10-28 11:19 UTC] jeroen@php.net
Reclassified.

Please also be more specific on the error, are you saying it crashes? What's the html output? Could you post the URL here?
 [2001-11-18 10:06 UTC] sander@php.net
No feedback. Closing.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 16:01:30 2025 UTC