rfc:ffi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:ffi [2018/12/10 09:11] – Rename FFI:array_type() into FFI::arrayType() dmitryrfc:ffi [2020/08/01 23:54] (current) – RFC was implemented carusogabriel
Line 3: Line 3:
   * Date: 2018-12-04   * Date: 2018-12-04
   * Author: Dmitry Stogov, dmitry@zend.com   * Author: Dmitry Stogov, dmitry@zend.com
-  * Status: Under Discussion+  * Status: Implemented (in PHP 7.4)
   * First Published at: https://wiki.php.net/rfc/ffi   * First Published at: https://wiki.php.net/rfc/ffi
  
Line 230: Line 230:
 ===== PHP FFI API Restriction ===== ===== PHP FFI API Restriction =====
  
-FFI API opens all the C power, and consequently, also an enormous possibility to have something go wrong, crash PHP, or even worse. To minimize risk PHP FFI API usage may be restricted. By default FFI API may be used only in CLI scripts and preloaded PHP files. This may be changed through **ffi.enable** INI directive.+FFI API opens all the C power, and consequently, also an enormous possibility to have something go wrong, crash PHP, or even worse. To minimize risk PHP FFI API usage may be restricted. By default FFI API may be used only in CLI scripts and preloaded PHP files. This may be changed through **ffi.enable** INI directive. This is INI_SYSTEM directive and it's value can't be changed at run-time.
  
   * **ffi.enable=false** completely disables PHP FFI API   * **ffi.enable=false** completely disables PHP FFI API
Line 332: Line 332:
   ffi.enable=false|preload|true    ffi.enable=false|preload|true 
  
-allows enabling or disabling FFI API usage, or restricting it only to preloaded files. The default value is **preload**+allows enabling or disabling FFI API usage, or restricting it only to preloaded files. The default value is **preload**. This is INI_SYSTEM directive and it's value can't be changed at run-time.
  
 ===== Open Issues ===== ===== Open Issues =====
Line 345: Line 345:
   * Sara Golemon thought, PHP needs something similar to [[https://github.com/facebook/hhvm/wiki/extension-api|HHVM HNI]]   * Sara Golemon thought, PHP needs something similar to [[https://github.com/facebook/hhvm/wiki/extension-api|HHVM HNI]]
  
-The usability of this FFI extension was proved by [[https://github.com/dstogov/php-tensorflow|TensoFlow binding]], implemented in pure PHP.+The usability of this FFI extension was proved by [[https://github.com/dstogov/php-tensorflow|TensorFlow binding]], implemented in pure PHP.
  
 ===== Future Scope ===== ===== Future Scope =====
Line 353: Line 353:
 Include FFI extension into PHP-7.4 (bundle) Include FFI extension into PHP-7.4 (bundle)
 This project requires 50%+1 majority This project requires 50%+1 majority
 +The voting started 2018-12-20 and will close on 2019-01-09
 +
 +<doodle title="Include FFI extension into PHP-7.4 (bundle)?" auth="user" voteType="single" closed="true">
 +   * Yes
 +   * No
 +</doodle>
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
Line 359: Line 365:
 ===== Implementation ===== ===== Implementation =====
 After the project is implemented, this section should contain  After the project is implemented, this section should contain 
-  - the version(s) it was merged into +  - it was merged into master (7.4) 
-  - a link to the git commit(s) +  - a link to the git [[https://github.com/php/php-src/commit/e089d506d5c7716c62cee5232d32ab22d0ddde26|commit]] 
-  - a link to the PHP manual entry for the feature +  - [[https://www.php.net/manual/en/book.ffi.php|PHP manual entry]] for the feature
-  - a link to the language specification section (if any)+
  
 ===== References ===== ===== References =====
rfc/ffi.1544433104.txt.gz · Last modified: 2018/12/10 09:11 by dmitry