php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67454 ReflectionParameter functions not working on core functions
Submitted: 2014-06-16 15:07 UTC Modified: -
Votes:2
Avg. Score:4.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: mail at markbiesheuvel dot nl Assigned:
Status: Open Package: Reflection related
PHP Version: Irrelevant OS:
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: mail at markbiesheuvel dot nl
New email:
PHP Version: OS:

 

 [2014-06-16 15:07 UTC] mail at markbiesheuvel dot nl
Description:
------------
Certain functions on instances of ReflectionParameter will not return the correct value for core functions.

So far I found out that isArray and isCallable will always return false (as far as I tested) and isPassedByReference and isOptional will return the correct value.

In the test script I used array_key_exists and array_walk and a user definied function array_magic. The difference between the expected and actual result are:

array_key_exists
  search
    isArray
array_walk
  input
    isArray
  funcname
    isCallable

    

Test script:
---------------
http://ideone.com/bQWV2U

Expected result:
----------------
array_key_exists
  key
    isPassedByReference: false
    isOptional:          false
    isArray:             false
    isCallable:          false
  search
    isPassedByReference: false
    isOptional:          false
    isArray:             true
    isCallable:          false

array_walk
  input
    isPassedByReference: true
    isOptional:          false
    isArray:             true
    isCallable:          false
  funcname
    isPassedByReference: false
    isOptional:          false
    isArray:             false
    isCallable:          true
  userdata
    isPassedByReference: false
    isOptional:          true
    isArray:             false
    isCallable:          false

array_magic
  function
    isPassedByReference: false
    isOptional:          false
    isArray:             false
    isCallable:          true
  array
    isPassedByReference: true
    isOptional:          false
    isArray:             true
    isCallable:          false
  additional
    isPassedByReference: false
    isOptional:          true
    isArray:             true
    isCallable:          false


Actual result:
--------------
array_key_exists
  key
    isPassedByReference: false
    isOptional:          false
    isArray:             false
    isCallable:          false
  search
    isPassedByReference: false
    isOptional:          false
    isArray:             false
    isCallable:          false

array_walk
  input
    isPassedByReference: true
    isOptional:          false
    isArray:             false
    isCallable:          false
  funcname
    isPassedByReference: false
    isOptional:          false
    isArray:             false
    isCallable:          false
  userdata
    isPassedByReference: false
    isOptional:          true
    isArray:             false
    isCallable:          false

array_magic
  function
    isPassedByReference: false
    isOptional:          false
    isArray:             false
    isCallable:          true
  array
    isPassedByReference: true
    isOptional:          false
    isArray:             true
    isCallable:          false
  additional
    isPassedByReference: false
    isOptional:          true
    isArray:             true
    isCallable:          false


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Nov 14 06:01:35 2019 UTC