Skip to content

Commit 0462f49

Browse files
committed
Fix GH-2201: Drop imagesx() return false description
As of PHP 8.0.0, GD images are objects, while previously they have been resources. If incompatible objects are passed to respective GD functions, that throws a `TypeError` which does not have to be documented explicitly. If invalid resources have been passed, that emitted `E_WARNING` and the functions returned `false`. In a perfect world, we would document that for each function, but to be brief, we just augment the respective language-snippet to express that valid `gd` resources have been expected. Readers should be able to figure out the detailed behavior (and would want to avoid passing invalid resources anyway).
1 parent 96bc008 commit 0462f49

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

language-snippets.ent

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ purposes.</simpara></warning>'>
962962
<entry>8.0.0</entry>
963963
<entry>
964964
<parameter>image</parameter> expects a <classname>GdImage</classname>
965-
instance now; previously, a <type>resource</type> was expected.
965+
instance now; previously, a valid <literal>gd</literal> <type>resource</type> was expected.
966966
</entry>
967967
</row>'>
968968

reference/image/functions/imagesx.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
<refsect1 role="returnvalues">
2727
&reftitle.returnvalues;
2828
<para>
29-
Return the width of the <parameter>image</parameter> or &false; on
30-
errors.
29+
Return the width of the <parameter>image</parameter>.
3130
</para>
3231
</refsect1>
3332

0 commit comments

Comments
 (0)