php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #46859 New switch statament
Submitted: 2008-12-13 16:53 UTC Modified: 2008-12-13 16:58 UTC
Votes:2
Avg. Score:3.0 ± 2.0
Reproduced:0 of 1 (0.0%)
From: 6r4845 at gmail dot com Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 5.3.0alpha3 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: 6r4845 at gmail dot com
New email:
PHP Version: OS:

 

 [2008-12-13 16:53 UTC] 6r4845 at gmail dot com
Description:
------------
/**
  Hello, i am figured new -- better look switch statement.
  Statement by now, is so ugly, discuisting and far away from style...
  Exectly i don't like these case 'index': look
  ------
  I am offering totaly new statement look, it would look something like class'es statement
  */

switch $var
{
  case Index
  {
    echo "Hello world";
  }

  case Second
  {
    echo "Hello again";
  }

  case const NEWS_PAGE
  {
    echo "News page!";
  }

  case Default
  {
    echo "Where do you thing you are?"
  }
}

/**
  And that is much more stylish than this:
  */

switch ($var){
  case 'Index':
    echo "Hello world";
  break;

  case 'Second':
    echo "Hello again";
  break;

  case NEWS_PAGE:
    echo "News page";
  break;

  default:
    echo "Where do you thing you are?"
  break;
}

/**
  I hope i take your attention, and will get reply about this :)
    Sorry for bad english
  */



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-13 16:58 UTC] colder@php.net
Adds no value, will be ambiguous parser-wise, and you miss the functionnality to have more than one cases for each blocks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 19:01:31 2024 UTC