#28094 [Opn->Bgs]: class type hints ambiguity

From: Date: Wed, 21 Apr 2004 14:41:49 +0000
Subject: #28094 [Opn->Bgs]: class type hints ambiguity
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-58524@lists.php.net to get a copy of this message
ID: 28094 Updated by: amt@php.net Reported By: steve at przepiora dot org -Status: Open +Status: Bogus Bug Type: Zend Engine 2 problem Operating System: windows xp PHP Version: 5.0.0RC1 New Comment: Class type hints do not work with non-classes, like strings, integers, and arrays. The error message is telling you it's expecting a class named "string." :) Previous Comments: ------------------------------------------------------------------------ [2004-04-21 16:40:25] steve at przepiora dot org Description: ------------ When using class type hints with a string a runtime error occurs. Reproduce code: --------------- <?php function foo(string $bar){ echo $bar; } foo("baz"); ?> Expected result: ---------------- The printout of "baz" Actual result: -------------- Fatal error: Argument 1 must be an object of class string in c:\program files\apache group\Apache\htdocs\index.php on line 2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28094&edit=1

« previous php.bugs (#58524) next »