Is there a way to tell the php complier that I want a specific implicit conversion from one type to another?
A simple example:
class Integer
{
public $
PHP5 has type hinting, with limitations: http://ca2.php.net/manual/en/language.oop5.typehinting.php
Specified types must be objects or array, so built in types such as string and int are not allowed.
This is not a conversion, but will throw an error if an object of the specified type is not passed to the method or function, as in your example.