|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45473 Argument 2 passed as integer, integer expected?
Submitted: 2008-07-10 07:02 UTC Modified: 2008-07-10 07:28 UTC
From: strictly dot rubbadub at gmail dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.2.6 OS: Windows Vista :(
Private report: No CVE-ID: None
 [2008-07-10 07:02 UTC] strictly dot rubbadub at gmail dot com
What I'm trying to do:  Ensure that $arg2 input is only an integer.
Either this is a bug, Windows Vista sucks (bug or not vista sucks period.), or I'm doing something wrong here.


Reproduce code:
function blah(array $arg1, integer $arg2, integer $arg3){ return false; }

Expected result:

Actual result:
Catchable fatal error: Argument 2 passed to blah() must be an instance of integer, integer given, called in C:\i\need\linux\blah.php on line 4 and defined in C:\i\need\linux\blah.php on line 2


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-10 07:28 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

You can only typehint object and array variable types in your function definition. Your code looks for a class named 'integer', which obviously isn't there, hence the error.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 15:01:32 2024 UTC