3v4l.org

run code in 500+ PHP versions simultaneously
<?php if (preg_match('~\.(png|gif|jpe?g|bmp)~i', "https://example.com/test.png")) { echo 'image only'; } else { echo 'image + other types'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bDFDv
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   FRAMELESS_ICALL_2                preg_match          ~0      '%7E%5C.%28png%7Cgif%7Cjpe%3Fg%7Cbmp%29%7Ei', 'https%3A%2F%2Fexample.com%2Ftest.png'
          1      > JMPZ                                                         ~0, ->4
    4     2    >   ECHO                                                         'image+only'
    3     3      > JMP                                                          ->5
    7     4    >   ECHO                                                         'image+%2B+other+types'
    8     5    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.94 ms | 2570 KiB | 13 Q