php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46058 ReflectionMethod::invoke - wrong behavior (PHP_5_2 only)
Submitted: 2008-09-11 19:40 UTC Modified: 2009-09-02 19:29 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: felipe@php.net Assigned:
Status: Wont fix Package: Reflection related
PHP Version: 5.2CVS-2009-04-30 OS: *
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: felipe@php.net
New email:
PHP Version: OS:

 

 [2008-09-11 19:40 UTC] felipe@php.net
Description:
------------
Currently the behavior is different of 5.3 and HEAD.

Note also: the method name in the warning message.

Reproduce code:
---------------
<?php

$x = new ReflectionMethod('reflectionfunction', 'invoke');
var_dump($x->invokeArgs(new ReflectionFunction('trim'), array(' foobar ')));

Expected result:
----------------
string(6) "foobar"

Actual result:
--------------
Fatal error: Non-static method ReflectionFunction::trim() cannot be called statically in %s on line %d

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-02 19:29 UTC] jani@php.net
So use 5.3 or HEAD. Not a security bug or critical.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 12:01:30 2024 UTC