Christoph Michael Becker


PHP RFC: Deprecate png2wbmp() and jpeg2wbmp()


png2wbmp() and jpeg2wbmp() are the only direct image format conversion functions available in ext/gd which makes them rather special, particularly as libgd doesn't offer any such functions 1). Furthermore WBMP 2) has been invented to support WAP 3), which appears to be mostly obsolete nowadays.


Therefore I propose to deprecate the png2wbmp() and jpeg2wbmp() functions as of PHP 7.2, and to remove them as of PHP 8.0. During the deprecation phase calling either function should emit an E_DEPRECATED error.

The main benefit in doing so would be easier maintainance of the libgd bindings (_php_image_convert() alone accounts for rougly 200 lines). An additional benefit would be to have a slightly cleaner and less confusing API (Why are there no other conversion functions? Why don't these functions follow the general “image” prefix rule?)

Backward Incompatible Changes

Obviously, code still using png2wbmp() or jpeg2wbmp() would break. However, fallback functions could easily implemented in userland. The supposedly long deprecation period should give users ample time to cater to the removal.

Proposed PHP Version(s)

  • Deprecation as of next PHP 7.x
  • Removal as of next major (supposedly PHP 8.0)

Open Issues

Currently none.

Unaffected PHP Functionality

imagewbmp() and image2wbmp() are not subject of this RFC, and as such their functionality will remain unmodified.

Patches and Tests

PR implementing the deprecation:


  1. PR #2164 has been merged into master (what is supposed to become PHP-7.2) with
  2. The deprecation and removal has been documented with
  3. The language specification is not affected by this RFC


instead they are defined in the libgd binding using libgd's image reading and writing functions
Wireless Application Protocol Bitmap Format
Wireless Application Protocol


An option needs 50%+1 votes to win

Deprecate png2wbmp() and jpeg2wbmp() (100% approved)
User Vote
ajf Yes
bwoebi Yes
cmb Yes
colinodell Yes
daverandom Yes
galvao Yes
guilhermeblanco Yes
jhdxr Yes
kalle Yes
kguest Yes
levim Yes
mbeccati Yes
mgocobachi Yes
mrook Yes
ocramius Yes
pierrick Yes
sammyk Yes
santiagolizardo Yes
svpernova09 Yes
zimt Yes