3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'this is some sample'; $base = 'this is some sample [shortcode/ attr="somth"]dfdfdfdf[shortcode]text[/shortcode][shortcodeniedzialajacy]'; $pattern = "/\[(shortcode)([ ][a-zA-Z0-9\"'=\\s]*\\]|\\])/"; $matches = array(); preg_match($pattern, $string, $matches); print_r($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GkNMt
function name:  (null)
number of ops:  13
compiled vars:  !0 = $string, !1 = $base, !2 = $pattern, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'this+is+some+sample'
    3     1        ASSIGN                                                   !1, 'this+is+some+sample+%5Bshortcode%2F+attr%3D%22somth%22%5Ddfdfdfdf%5Bshortcode%5Dtext%5B%2Fshortcode%5D%5Bshortcodeniedzialajacy%5D'
    4     2        ASSIGN                                                   !2, '%2F%5C%5B%28shortcode%29%28%5B+%5D%5Ba-zA-Z0-9%22%27%3D%5Cs%5D%2A%5C%5D%7C%5C%5D%29%2F'
    5     3        ASSIGN                                                   !3, <array>
    6     4        INIT_FCALL                                               'preg_match'
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !0
          7        SEND_REF                                                 !3
          8        DO_ICALL                                                 
    7     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !3
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.81 ms | 1394 KiB | 17 Q