php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42118 PHP prototyping in methods/functions error with string type.
Submitted: 2007-07-27 00:15 UTC Modified: 2007-07-27 04:35 UTC
From: dinesh at dinsoft dot net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.3 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dinesh at dinsoft dot net
New email:
PHP Version: OS:

 

 [2007-07-27 00:15 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-27 00:21 UTC] dinesh at dinsoft dot net
It is actually not restricted to classes and stream_wrapper_register.
 [2007-07-27 04:35 UTC] jani@php.net
You don't have class called "string" set, do you? 
There is no type hinting for "string" type in PHP..
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 15:01:28 2024 UTC