ID: 38128 Updated by: [EMAIL PROTECTED] Reported By: obluda dot x at seznam dot cz -Status: Open +Status: Wont fix Bug Type: Feature/Change Request -Operating System: all +Operating System: * -PHP Version: 5CVS-2006-07-18 (CVS) +PHP Version: * New Comment:
Ressource and Object typehinting are the only types we probably add in some future. But we discussed and disagreed to the others already. There is no need and it actually would contradict the php way where all variables are casted as needed. Previous Comments: ------------------------------------------------------------------------ [2006-07-18 05:55:28] obluda dot x at seznam dot cz Description: ------------ Currently, only object and array arguments of a function can be hinted. However, if you can't hint non-class/non-array argument, you have to leave argument unhinted, which allows passing of class/array besides of scalar types. I propose adding new type-hinting keyword 'scalar', which matches complement to currently possible hints. Think also about 'resource' hint. Reproduce code: --------------- <?php function show ( scalar $string ) { echo $string; } show("hello\n"); show(new stdClass()); ?> Expected result: ---------------- hello Error... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38128&edit=1