php / php/php-src

Chage FFI::cdef() return FFI\CDef object

Open
#8,554 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #8585 by @chopins — closed without merging
Extension: ffi Feature Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

Now, FFI::cdef() return a FFI object, then through FFI object call C function.
The above reasons cause some method support call by statically and non-statically, and these method will need exclude in zend_ffi_handlers.get_method. if C DLL has same name function will not be call, or add new FFI method must insert to execlude list.
So suggest FFI::cdef() return object of other class, For example use FFI\CDef instead of FFI object.
FFI\CDef is not construrct and extend in PHP code, Similarly FFI\CData.
Through FFI\CDef of zend_ffi_handlers.get_method will call C function. and FFI non-statically method add one paramter receive FFI\CDef object. this is cause in compatibility.

see: #8585

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the FFI::cdef() entry point, zend_ffi_handlers.get_method, and the discussion in linked issue #8585. Establish the compatibility impact of returning FFI\CDef and passing it to non-static methods; done requires an agreed API design rather than an unresolved proposal.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, php
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.