3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'attachment;filename=unnamed.jpg;filename*=UTF-8\'\'unnamed.jpg\''; preg_match('/^.*?filename=(["\'])?([^"\']+)\1?(?:;|$)/m', $str, $matches); print_r($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tPK8T
function name:  (null)
number of ops:  10
compiled vars:  !0 = $str, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'attachment%3Bfilename%3Dunnamed.jpg%3Bfilename%2A%3DUTF-8%27%27unnamed.jpg%27'
    4     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%5E.%2A%3Ffilename%3D%28%5B%22%27%5D%29%3F%28%5B%5E%22%27%5D%2B%29%5C1%3F%28%3F%3A%3B%7C%24%29%2Fm'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    6     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.49 ms | 1010 KiB | 15 Q