ID: 42118 User updated by: dinesh at dinsoft dot net -Summary: stream_wrapper_register() with function prototyping with types Reported By: dinesh at dinsoft dot net Status: Open Bug Type: Scripting Engine problem Operating System: Windows PHP Version: 5.2.3 New Comment:
It is actually not restricted to classes and stream_wrapper_register. Previous Comments: ------------------------------------------------------------------------ [2007-07-27 00:15:32] dinesh at dinsoft dot net Description: ------------ The error message produced by PHP is a non sense. This should just work. Reproduce code: --------------- class DSProxy { function stream_open(string $path, string $mode, int $options, string $opened_path) { return false; } ... } stream_wrapper_register('proxy', 'DSProxy') or die("ERROR: Could not register the proxy protocol!\n"); $fp = fopen('proxy://www.dinsoft.net', 'r'); Expected result: ---------------- I expect it to work, or at least to produce a meaning full error message. Actual result: -------------- PHP Catchable fatal error: Argument 1 passed to DSProxy::stream_open() must be an instance of string, string given in E:\dev\flights\proxy.php on line 8 Catchable fatal error: Argument 1 passed to DSProxy::stream_open() must be an in stance of string, string given in E:\dev\flights\proxy.php on line 8 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42118&edit=1