ID: 31785 Updated by: [EMAIL PROTECTED] Reported By: CaptainN at adcstudio dot com -Status: Open +Status: Bogus Bug Type: Feature/Change Request -Operating System: All of them +Operating System: * -PHP Version: Irrelevant +PHP Version: 5.* New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php 1) Use interfaces 2) We will never add support for base types Previous Comments: ------------------------------------------------------------------------ [2005-01-31 23:18:42] CaptainN at adcstudio dot com Description: ------------ Since php is a dynamicly typed language, it would be great if we could supply multiple type hints for a function or method. This would kind of be like function argument type overloading, where the overload is handled within the same function. It could look something like the example below. In this example, both Class1 and Class2 could have __toString methods defined, so that it doesn't matter what the rest of the class looks like, since this function is just going to convert them to strings, then output that value anyway: Reproduce code: --------------- function testFunction(ClassName1|ClassName2 $Obj) { echo 'Class Info: ' . $Obj; } /* Another example (combined with support for built in types in type hinting): */ function SetupDatabase(DatabaseConfig|boolean $config=false) { if ($config) { $this->config = $config; } $this->Connect(); } Expected result: ---------------- If this is not the proper place to post these kinds of requests/feature explorations, please let me know. Thanks. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31785&edit=1