|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2020-10-01 14:42 UTC] matt dot peveler at gmail dot com
Description: ------------ The documentation says that the second argument to imagexbm (like the other functions) is optional, and that if not included, the output will be sent to stdout instead of to a file. However, on running the test script, I get a PHP Warning about the second argument missing and nothing is outputted to stdout. Changing the used function to imagegif (or any other variant) works as expected. Test script: --------------- <?php // Create a blank image and add some text $im = imagecreatetruecolor(120, 20); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color); // Output the image imagexbm($im); // Free up memory imagedestroy($im); Expected result: ---------------- Output the imagexbm binary to stdout Actual result: -------------- PHP Warning: imagexbm() expects at least 2 parameters, 1 given in /tmp/test.php on line 9 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 13:00:01 2025 UTC |
The docs are wrong about this. The second parameter is not optional, but it is nullable; so you could do imagexbm($im, null); As of PHP 8.0.0, the second parameter is actually optional, though.