In PHP you can do the following thing:
class Something {// bla bla}
function functionName(Something $object) {
// Do stuff here ^^^^^^^^^
}
You can't typehint scalar types in PHP. The only chance is to use a wrapper type. The SPL library ships with SplInt for that purpose.
Update: Looks like PHP 7 offers that feature. Sigh, times changed :)
You can't do this for scalar types see the manual:
And a quote from there:
Type hints cannot be used with scalar types such as int or string. Resources and Traits are not allowed either.
But you will be able to to this with PHP 7: https://wiki.php.net/rfc/scalar_type_hints_v5