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
 [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

Pull Requests

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: Thu Dec 26 20:01:29 2024 UTC