Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions reference/ffi/ffi.cdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@
Any C data can be visualized using <function>var_dump</function>, <function>print_r</function>, etc.
</simpara>
</listitem>
<listitem>
<simpara>
<classname>FFI\CData</classname> can now be assigned to structs and fields as of PHP 8.3.0.
</simpara>
</listitem>
</itemizedlist>
<note>
<simpara>
Expand All @@ -107,6 +112,28 @@

</section>

<section role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.3.0</entry>
<entry>
<classname>FFI\CData</classname> can now be assigned to structs and fields.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>

</partintro>

<!-- &reference.ffi.entities.ffi-cdata; -->
Expand Down
33 changes: 25 additions & 8 deletions reference/ffi/ffi/cast.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="FFI">
<modifier>public</modifier> <modifier>static</modifier> <type class="union"><type>FFI\CData</type><type>null</type></type><methodname>FFI::cast</methodname>
<methodparam><type class="union"><type>FFI\CType</type><type>string</type></type><parameter>type</parameter></methodparam>
<methodparam><type class="union"><type>FFI\CData</type><type>int</type><type>float</type><type>bool</type><type>null</type></type><parameter role="reference">ptr</parameter></methodparam>
</methodsynopsis>
<methodsynopsis role="FFI">
<modifier>public</modifier> <type class="union"><type>FFI\CData</type><type>null</type></type><methodname>FFI::cast</methodname>
<methodparam><type class="union"><type>FFI\CType</type><type>string</type></type><parameter>type</parameter></methodparam>
Expand All @@ -24,9 +19,7 @@
The resulting object does not own the C data, and the source <parameter>ptr</parameter>
must survive the result. The C type may be specified as a <type>string</type> with any
valid C type declaration or as <classname>FFI\CType</classname> object, created before.
If this method is called statically, it must only use predefined C type names (e.g.
<literal>int</literal>, <literal>char</literal>, etc.); if the method is called as
instance method, any type declared for the instance is allowed.
Any type declared for the instance is allowed.
</para>
</refsect1>

Expand Down Expand Up @@ -60,6 +53,30 @@
</para>
</refsect1>

<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.3.0</entry>
<entry>
Calling <methodname>FFI::cast</methodname> statically is now deprecated.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
Expand Down
33 changes: 24 additions & 9 deletions reference/ffi/ffi/new.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="FFI">
<modifier>public</modifier> <modifier>static</modifier> <type class="union"><type>FFI\CData</type><type>null</type></type><methodname>FFI::new</methodname>
<methodparam><type class="union"><type>FFI\CType</type><type>string</type></type><parameter>type</parameter></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>owned</parameter><initializer>&true;</initializer></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>persistent</parameter><initializer>&false;</initializer></methodparam>
</methodsynopsis>
<methodsynopsis role="FFI">
<modifier>public</modifier> <type class="union"><type>FFI\CData</type><type>null</type></type><methodname>FFI::new</methodname>
<methodparam><type class="union"><type>FFI\CType</type><type>string</type></type><parameter>type</parameter></methodparam>
Expand All @@ -22,9 +16,7 @@
</methodsynopsis>
<para>
Creates a native data structure of the given C type.
If this method is called statically, it must only use predefined C type names (e.g.
<literal>int</literal>, <literal>char</literal>, etc.); if the method is called as
instance method, any type declared for the instance is allowed.
Any type declared for the instance is allowed.
</para>
</refsect1>

Expand Down Expand Up @@ -72,6 +64,29 @@
</para>
</refsect1>

<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.3.0</entry>
<entry>
Calling <methodname>FFI::new</methodname> statically is now deprecated.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Expand Down
32 changes: 25 additions & 7 deletions reference/ffi/ffi/type.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,14 @@

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="FFI">
<modifier>public</modifier> <modifier>static</modifier> <type class="union"><type>FFI\CType</type><type>null</type></type><methodname>FFI::type</methodname>
<methodparam><type>string</type><parameter>type</parameter></methodparam>
</methodsynopsis>
<methodsynopsis role="FFI">
<modifier>public</modifier> <type class="union"><type>FFI\CType</type><type>null</type></type><methodname>FFI::type</methodname>
<methodparam><type>string</type><parameter>type</parameter></methodparam>
</methodsynopsis>
<para>
This function creates and returns a <classname>FFI\CType</classname> object for the
given <type>string</type> containing a C type declaration.
If this method is called statically, it must only use predefined C type names (e.g.
<literal>int</literal>, <literal>char</literal>, etc.); if the method is called as
instance method, any type declared for the instance is allowed.
Any type declared for the instance is allowed.
</para>
</refsect1>

Expand All @@ -47,6 +41,30 @@
</para>
</refsect1>

<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.3.0</entry>
<entry>
Calling <methodname>FFI::type</methodname> statically is now deprecated.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
Expand Down