3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('HAZELFENCES_WEBSITE', 'https://test.com'); $text = '[youtube]https://www.youtube.com/watch?v=xHLE2LTAItw&amp;t=53s[/youtube]'; if (preg_match_all("/\[youtube\]((\s|.)+?)\[\/youtube\]/i", $text, $matches)) { $allMatches = count($matches[0]); if (is_array($matches[0]) && $allMatches > 0) { for ($i = 0; $i < $allMatches; $i++) { $text = str_replace("watch?v=", "embed/", $text); if (strpos($matches[0][$i], "&amp;t=") !== false) { $text = str_replace("&amp;t=", "?start=", $text); $text = preg_replace("#s\[\/youtube\]#i", "&enablejsapi=1&origin=". HAZELFENCES_WEBSITE ."[/youtube]", $text); } else { $text = preg_replace("#\[\/youtube\]#i", "?enablejsapi=1&origin=". HAZELFENCES_WEBSITE ."[/youtube]", $text); } } $text = preg_replace("/\[youtube\]((\s|.)+?)\[\/youtube\]/i", "<iframe width=\"640\" height=\"510\" src=\"\\1\" loading=\"lazy\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>", $text); } } echo $text;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 70
Branch analysis from position: 11
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 70
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 22
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 52
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 22
Branch analysis from position: 64
Branch analysis from position: 22
Branch analysis from position: 52
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 22
Branch analysis from position: 64
Branch analysis from position: 22
Branch analysis from position: 70
Branch analysis from position: 19
Branch analysis from position: 70
filename:       /in/Yelmp
function name:  (null)
number of ops:  72
compiled vars:  !0 = $text, !1 = $matches, !2 = $allMatches, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'HAZELFENCES_WEBSITE'
          2        SEND_VAL                                                 'https%3A%2F%2Ftest.com'
          3        DO_ICALL                                                 
    3     4        ASSIGN                                                   !0, '%5Byoutube%5Dhttps%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DxHLE2LTAItw%26amp%3Bt%3D53s%5B%2Fyoutube%5D'
    4     5        INIT_FCALL                                               'preg_match_all'
          6        SEND_VAL                                                 '%2F%5C%5Byoutube%5C%5D%28%28%5Cs%7C.%29%2B%3F%29%5C%5B%5C%2Fyoutube%5C%5D%2Fi'
          7        SEND_VAR                                                 !0
          8        SEND_REF                                                 !1
          9        DO_ICALL                                         $6      
         10      > JMPZ                                                     $6, ->70
    5    11    >   FETCH_DIM_R                                      ~7      !1, 0
         12        COUNT                                            ~8      ~7
         13        ASSIGN                                                   !2, ~8
    7    14        FETCH_DIM_R                                      ~10     !1, 0
         15        TYPE_CHECK                                  128  ~11     ~10
         16      > JMPZ_EX                                          ~11     ~11, ->19
         17    >   IS_SMALLER                                       ~12     0, !2
         18        BOOL                                             ~11     ~12
         19    > > JMPZ                                                     ~11, ->70
    8    20    >   ASSIGN                                                   !3, 0
         21      > JMP                                                      ->62
    9    22    >   INIT_FCALL                                               'str_replace'
         23        SEND_VAL                                                 'watch%3Fv%3D'
         24        SEND_VAL                                                 'embed%2F'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $14     
         27        ASSIGN                                                   !0, $14
   11    28        INIT_FCALL                                               'strpos'
         29        FETCH_DIM_R                                      ~16     !1, 0
         30        FETCH_DIM_R                                      ~17     ~16, !3
         31        SEND_VAL                                                 ~17
         32        SEND_VAL                                                 '%26amp%3Bt%3D'
         33        DO_ICALL                                         $18     
         34        TYPE_CHECK                                  1018          $18
         35      > JMPZ                                                     ~19, ->52
   12    36    >   INIT_FCALL                                               'str_replace'
         37        SEND_VAL                                                 '%26amp%3Bt%3D'
         38        SEND_VAL                                                 '%3Fstart%3D'
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                         $20     
         41        ASSIGN                                                   !0, $20
   13    42        INIT_FCALL                                               'preg_replace'
         43        SEND_VAL                                                 '%23s%5C%5B%5C%2Fyoutube%5C%5D%23i'
         44        FETCH_CONSTANT                                   ~22     'HAZELFENCES_WEBSITE'
         45        CONCAT                                           ~23     '%26enablejsapi%3D1%26origin%3D', ~22
         46        CONCAT                                           ~24     ~23, '%5B%2Fyoutube%5D'
         47        SEND_VAL                                                 ~24
         48        SEND_VAR                                                 !0
         49        DO_ICALL                                         $25     
         50        ASSIGN                                                   !0, $25
   11    51      > JMP                                                      ->61
   15    52    >   INIT_FCALL                                               'preg_replace'
         53        SEND_VAL                                                 '%23%5C%5B%5C%2Fyoutube%5C%5D%23i'
         54        FETCH_CONSTANT                                   ~27     'HAZELFENCES_WEBSITE'
         55        CONCAT                                           ~28     '%3Fenablejsapi%3D1%26origin%3D', ~27
         56        CONCAT                                           ~29     ~28, '%5B%2Fyoutube%5D'
         57        SEND_VAL                                                 ~29
         58        SEND_VAR                                                 !0
         59        DO_ICALL                                         $30     
         60        ASSIGN                                                   !0, $30
    8    61    >   PRE_INC                                                  !3
         62    >   IS_SMALLER                                               !3, !2
         63      > JMPNZ                                                    ~33, ->22
   19    64    >   INIT_FCALL                                               'preg_replace'
         65        SEND_VAL                                                 '%2F%5C%5Byoutube%5C%5D%28%28%5Cs%7C.%29%2B%3F%29%5C%5B%5C%2Fyoutube%5C%5D%2Fi'
         66        SEND_VAL                                                 '%3Ciframe+width%3D%22640%22+height%3D%22510%22+src%3D%22%5C1%22+loading%3D%22lazy%22+frameborder%3D%220%22+allow%3D%22accelerometer%3B+autoplay%3B+encrypted-media%3B+gyroscope%3B+picture-in-picture%22+allowfullscreen%3E%3C%2Fiframe%3E'
         67        SEND_VAR                                                 !0
         68        DO_ICALL                                         $34     
         69        ASSIGN                                                   !0, $34
   23    70    >   ECHO                                                     !0
   24    71      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.29 ms | 1007 KiB | 18 Q