<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.ffi.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'intro.ffi.php',
    1 => 'Вступ',
    2 => 'Вступ',
  ),
  'up' => 
  array (
    0 => 'book.ffi.php',
    1 => 'FFI',
  ),
  'prev' => 
  array (
    0 => 'book.ffi.php',
    1 => 'FFI',
  ),
  'next' => 
  array (
    0 => 'ffi.setup.php',
    1 => 'Встановлення/налаштування',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ffi/book.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="intro.ffi" class="preface">
  <h1 class="title">Вступ</h1>
  <p class="para">
   This extension allows the loading of shared libraries (<var class="filename">.DLL</var> or
   <var class="filename">.so</var>), calling of C functions and accessing of C data structures
   in pure PHP, without having to have deep knowledge of the Zend extension API, and
   without having to learn a third “intermediate” language.
   The public API is implemented as a single class <span class="classname"><a href="class.ffi.php" class="classname">FFI</a></span> with
   several static methods (some of them may be called dynamically), and overloaded object
   methods, which perform the actual interaction with C data.
  </p>
  <div class="caution"><strong class="caution">Застереження</strong>
   <p class="para">
    FFI is dangerous, since it allows to interface with the system on a very low level.
    The FFI extension should only be used by developers having a working knowledge of C
    and the used C APIs. To minimize the risk, the FFI API usage may be restricted
    with the <a href="ffi.configuration.php#ini.ffi.enable" class="link">ffi.enable</a> <var class="filename">php.ini</var> directive.
   </p>
  </div>
  <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
   <p class="para">
    The FFI extension does not render the classic PHP extension API obsolete; it is merely
    provided for ad-hoc interfacing with C functions and data structures.
   </p>
  </p></blockquote>
  <div class="tip"><strong class="tip">Підказка</strong>
   <p class="para">
    Currently, accessing FFI data structures is significantly (about 2 times) slower
    than accessing native PHP arrays and objects. Therefore, it makes no sense to use
    the FFI extension for speed; however, it may make sense to use it to reduce memory
    consumption.
   </p>
  </div>
 </div><?php manual_footer($setup); ?>