php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #40438 Use mathematical sets in if conditions
Submitted: 2007-02-11 23:28 UTC Modified: 2020-11-23 15:40 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: anmeldung at snowgarden dot ch Assigned:
Status: Suspended Package: Scripting Engine problem
PHP Version: 5.2.1 OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
10 + 25 = ?
Subscribe to this entry?

 
 [2007-02-11 23:28 UTC] anmeldung at snowgarden dot ch
Description:
------------
It would be nice, if you can use some mathematical sets in if conditions. This would help to filter input values like integers, string and floats.
For example if you'll check if an input value within your range:
Normal representation -> if ($input >= 0 && $input <= 2)
Math. Set representation -> if ($input === [0; 2])

You can use braces (but they are used in PHP) to represent sets of string or numbers like -> colors === {'red', 'blue', 'yellow'}

There is also an international standard (ISO 31-11) that defines sets (http://en.wikipedia.org/wiki/ISO_31-11#Sets)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-30 23:58 UTC] cmb@php.net
-Package: Feature/Change Request +Package: Scripting Engine problem
 [2020-11-23 15:40 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2020-11-23 15:40 UTC] cmb@php.net
This feature needs discussion for which this bug tracker is not
really suitable.  Therefore, I you, or anybody else, is still
interested in this, please forward your request to the internals
mailing list.  For the time being, I'm suspending this ticket.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 05:01:28 2024 UTC