This is an old revision of the document!

PHP RFC: Deprecate png2wbmp() and jpeg2wbmp()


png2wbmp() and jpeg2wbmp() are the only direct image format conversion functions available in ext/gd what 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.

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.

Proposed PHP Version(s)

  • Deprecation as of next PHP 7.x
  • Removal

List the proposed PHP versions that the feature will be included in. Use relative versions such as “next PHP 7.x” or “next PHP 7.x.y”.

RFC Impact


Describe the impact to CLI, Development web server, embedded PHP etc.

To Existing Extensions

Will existing extensions be affected?

To Opcache

It is necessary to develop RFC's with opcache in mind, since opcache is a core extension distributed with PHP.

Please explain how you have verified your RFC's compatibility with opcache.

New Constants

Describe any new constants so they can be accurately and comprehensively explained in the PHP documentation.

php.ini Defaults

If there are any php.ini settings then list:

  • hardcoded default values
  • php.ini-development values
  • php.ini-production values

Open Issues

Make sure there are no open issues when the vote starts!

Unaffected PHP Functionality

List existing areas/features of PHP that will not be changed by the RFC.

This helps avoid any ambiguity, shows that you have thought deeply about the RFC's impact, and helps reduces mail list noise.

Future Scope

This sections details areas where the feature might be improved in future, but that are not currently proposed in this RFC.

Proposed Voting Choices

Include these so readers know where you are heading and can discuss the proposed voting options.

State whether this project requires a 2/3 or 50%+1 majority (see voting)

Patches and Tests

Links to any external patches and tests go here.

If there is no patch, make it clear who will create a patch, or whether a volunteer to help with implementation is needed.

Make it clear if the patch is intended to be the final patch, or is just a prototype.


After the project is implemented, this section should contain

  1. the version(s) it was merged to
  2. a link to the git commit(s)
  3. a link to the PHP manual entry for the feature


Links to external references, discussions or RFCs

Rejected Features

Keep this updated with features that were discussed on the mail lists.

instead they are defined in the libgd binding using libgd's image reading and writing functions
Wireless Application Protocol Bitmap Format
Wireless Application Protocol
rfc/deprecate-png-jpeg-2wbmp.1476532989.txt.gz · Last modified: 2017/09/22 13:28 (external edit)