Bug #78543 [NEW]: is_callable() on FFI\CData -> Exception: Attempt to call non C function pointer

From: Date: Sun, 15 Sep 2019 12:25:13 +0000
Subject: Bug #78543 [NEW]: is_callable() on FFI\CData -> Exception: Attempt to call non C function pointer
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222753@lists.php.net to get a copy of this message
From: asmqb7 at gmail dot com Operating system: Linux PHP version: 7.4.0RC1 Package: *Extensibility Functions Bug Type: Bug Bug description:is_callable() on FFI\CData -> Exception: Attempt to call non C function pointer Description: ------------ Unsure what's happening, so not going to make myself look silly with wild and probably incorrect guesses. (Something something FFI\CData not being able to tell the difference between "are you callable" and actually being called... I'll be curious to read the patch.) Just started playing with FFI, which is very fun. I look forward to the crazy and awesome things this is going to make possible. Thanks so much :) Stumbled on this because my d() routine (generic-everything dumper) crashed in its type detector function. (NB. The testcase below drops is_callable()'s return value, since it makes no difference.) Test script: --------------- <?php $ffi = FFI::cdef(' struct test { int dummy; }; '); $test = $ffi->new('struct test'); is_callable($test); Expected result: ---------------- For is_callable() to return false Actual result: -------------- Fatal error: Uncaught FFI\Exception: Attempt to call non C function pointer in ... Stack trace: #0 ...: is_callable(Object(FFI\CData:struct test)) -- Edit bug report at https://bugs.php.net/bug.php?id=78543&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=78543&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78543&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78543&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78543&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78543&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78543&r=support Expected behavior: https://bugs.php.net/fix.php?id=78543&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78543&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78543&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78543&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=78543&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=78543&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78543&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78543&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78543&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78543&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78543&r=mysqlcfg

« previous php.bugs (#222753) next »