[php-src] Issue #20087: IMAGETYPE_SVG constant on standard extension and source code
| From: | llaville | Date: | Tue, 07 Oct 2025 04:01:29 +0000 |
| Subject: | [php-src] Issue #20087: IMAGETYPE_SVG constant on standard extension and source code | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-251007@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/20087
Author: llaville
### Description
While testing PHP 8.5.0RC1 on context of my project https://github.com/llaville/php-compatinfo-db,
I've noticed that PHP standard extension provide a
IMAGETYPE_SVG constant, but we
cannot find any implementation on GH repo
(except in a test file: https://github.com/php/php-src/blob/6872cf2eef921b9d27fa300ca5a7ad3bc27aee1c/ext/libxml/tests/image/imagetype_svg.phpt)
And so the implementation came from commit https://github.com/php/php-src/commit/0962c325fa464a2209e185f315d86434f8558fd2#diff-8957f0eefb83e6c580f2fc6f40c9033d68ac478fd43bab0610ab382e13908829
Search for : https://github.com/search?q=repo%3Aphp%2Fphp-src%20IMAGETYPE_S&type=code
The following code:
```shell
php --re standard | grep IMAGETYPE_
```
Resulted in this output:
```
Constant [ <persistent> int IMAGETYPE_GIF ] { 1 }
Constant [ <persistent> int IMAGETYPE_JPEG ] { 2 }
Constant [ <persistent> int IMAGETYPE_PNG ] { 3 }
Constant [ <persistent> int IMAGETYPE_SWF ] { 4 }
Constant [ <persistent> int IMAGETYPE_PSD ] { 5 }
Constant [ <persistent> int IMAGETYPE_BMP ] { 6 }
Constant [ <persistent> int IMAGETYPE_TIFF_II ] { 7 }
Constant [ <persistent> int IMAGETYPE_TIFF_MM ] { 8 }
Constant [ <persistent> int IMAGETYPE_JPC ] { 9 }
Constant [ <persistent> int IMAGETYPE_JP2 ] { 10 }
Constant [ <persistent> int IMAGETYPE_JPX ] { 11 }
Constant [ <persistent> int IMAGETYPE_JB2 ] { 12 }
Constant [ <persistent> int IMAGETYPE_SWC ] { 13 }
Constant [ <persistent> int IMAGETYPE_IFF ] { 14 }
Constant [ <persistent> int IMAGETYPE_WBMP ] { 15 }
Constant [ <persistent> int IMAGETYPE_JPEG2000 ] { 9 }
Constant [ <persistent> int IMAGETYPE_XBM ] { 16 }
Constant [ <persistent> int IMAGETYPE_ICO ] { 17 }
Constant [ <persistent> int IMAGETYPE_WEBP ] { 18 }
Constant [ <persistent> int IMAGETYPE_AVIF ] { 19 }
Constant [ <persistent> int IMAGETYPE_HEIF ] { 20 }
Constant [ <persistent> int IMAGETYPE_UNKNOWN ] { 0 }
Constant [ <persistent> int IMAGETYPE_COUNT ] { 22 }
Constant [ <persistent> int IMAGETYPE_SVG ] { 21 }
```
Can we have a clarification on this subject please ?
### PHP Version
```plain
PHP 8.5.0RC1 (cli) (built: Sep 26 2025 21:38:33) (NTS)
Copyright (c) The PHP Group
Built by https://github.com/docker-library/php
Zend Engine v4.5.0RC1, Copyright (c) Zend Technologies
with Zend OPcache v8.5.0RC1, Copyright (c), by Zend Technologies
```
### Operating System
Ubuntu 22.04 LTS