php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #78254 Provide information about imported functions and variables for FFI definitions
Submitted: 2019-07-05 09:43 UTC Modified: 2021-12-01 17:53 UTC
From: lisachenko dot it at gmail dot com Assigned:
Status: Open Package: FFI (PECL)
PHP Version: Next Minor Version OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
9 - 8 = ?
Subscribe to this entry?

 
 [2019-07-05 09:43 UTC] lisachenko dot it at gmail dot com
Description:
------------
When some functions/variables are imported into FFI object, it would be nice to provide this information via declared properties/methods information. 


Test script:
---------------
<?php
// create FFI object, loading libc and exporting function printf()
$ffi = FFI::cdef("
    int printf(const char *format, ...);
    int errno;", 
    "libc.so.6");

// Would be nice to have report about imported properties and methods, also in introspection
var_dump($ffi, get_object_vars($ffi), get_class_methods($ffi));

Expected result:
----------------
Information about existing properties and existing methods. Maybe even with ability to reflect them via Reflection, eg. extract a closure instance.

Actual result:
--------------
There is no information about imported variables and functions.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-09-16 21:22 UTC] cmb@php.net
-Package: ffi +Package: FFI
 [2021-12-01 17:53 UTC] cmb@php.net
-PHP Version: 7.4.0alpha2 +PHP Version: Next Minor Version
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Sep 27 04:05:53 2022 UTC