Bug #67454 [Opn->Csd]: ReflectionParameter functions not working on core functions

From: Date: Fri, 28 Feb 2020 14:58:53 +0000
Subject: Bug #67454 [Opn->Csd]: ReflectionParameter functions not working on core functions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225789@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67454&edit=1 ID: 67454 Updated by: nikic@php.net Reported by: mail at markbiesheuvel dot nl Summary: ReflectionParameter functions not working on core functions -Status: Open +Status: Closed Type: Bug Package: Reflection related PHP Version: Irrelevant -Assigned To: +Assigned To: nikic Block user comment: N Private report: N New Comment: This has been fixed in PHP 8. Previous Comments: ------------------------------------------------------------------------ [2014-06-16 15:07:24] 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67454&edit=1

« previous php.bugs (#225789) next »