php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #54307 isset && is_numeric
Submitted: 2011-03-18 12:42 UTC Modified: 2011-03-19 14:08 UTC
From: jball606 at gmail dot com Assigned:
Status: Closed Package: Output Control
PHP Version: 5.3.6 OS: *nix & 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: jball606 at gmail dot com
New email:
PHP Version: OS:

 

 [2011-03-18 12:42 UTC] jball606 at gmail dot com
Description:
------------
I would kill for a way to do isset && check if the value is s specific data type such as numeric.  My code is loaded with if(isset($a) && is_numeric($a)).  It would be nice to do that in a single function (isset($a,[is_numeric])).

Thank you taking the time to read my request.

Expected result:
----------------
$var = isset($a,[is_numeric]);

$var = true,false

Actual result:
--------------
$var = isset($a,[is_numeric]);

$var = true,false

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-19 14:08 UTC] jball606 at gmail dot com
I learned you can bypass the warning with the reference to a variable

function bob(&$fred)

wont give me the notice of undefined variable.  My Bad.
 [2011-03-19 14:08 UTC] jball606 at gmail dot com
-Status: Open +Status: Closed
 [2011-03-19 14:08 UTC] jball606 at gmail dot com
Want to close
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Oct 28 10:03:33 2021 UTC