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: 2020-02-28 14:58 UTC
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: nikic (profile)
Status: Closed Package: Reflection related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-02-28 14:58 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2020-02-28 14:58 UTC] nikic@php.net
This has been fixed in PHP 8.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 14:01:31 2024 UTC