3v4l.org

run code in 500+ PHP versions simultaneously
<?php define('HAZELFENCES_WEBSITE', 'https://test.com'); $text = '[youtube]https://www.youtube.com/watch?v=xHLE2LTAItw&amp;t=53s[/youtube]'; $text .= '[youtube]https://www.youtube.com/watch?v=xHLE2LTAItw[/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 = 12, Position 2 = 53
Branch analysis from position: 12
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 53
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 23
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 41
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 23
Branch analysis from position: 50
Branch analysis from position: 23
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 23
Branch analysis from position: 50
Branch analysis from position: 23
Branch analysis from position: 53
Branch analysis from position: 20
Branch analysis from position: 53
filename:       /in/JTAUp
function name:  (null)
number of ops:  55
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        ASSIGN_OP                                         8          !0, '%5Byoutube%5Dhttps%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DxHLE2LTAItw%5B%2Fyoutube%5D'
    5     6        INIT_FCALL                                                   'preg_match_all'
          7        SEND_VAL                                                     '%2F%5C%5Byoutube%5C%5D%28%28%5Cs%7C.%29%2B%3F%29%5C%5B%5C%2Fyoutube%5C%5D%2Fi'
          8        SEND_VAR                                                     !0
          9        SEND_REF                                                     !1
         10        DO_ICALL                                             $7      
         11      > JMPZ                                                         $7, ->53
    6    12    >   FETCH_DIM_R                                          ~8      !1, 0
         13        COUNT                                                ~9      ~8
         14        ASSIGN                                                       !2, ~9
    8    15        FETCH_DIM_R                                          ~11     !1, 0
         16        TYPE_CHECK                                      128  ~12     ~11
         17      > JMPZ_EX                                              ~12     ~12, ->20
         18    >   IS_SMALLER                                           ~13     0, !2
         19        BOOL                                                 ~12     ~13
         20    > > JMPZ                                                         ~12, ->53
    9    21    >   ASSIGN                                                       !3, 0
         22      > JMP                                                          ->48
   10    23    >   FRAMELESS_ICALL_3                str_replace         ~15     'watch%3Fv%3D', 'embed%2F'
         24        OP_DATA                                                      !0
         25        ASSIGN                                                       !0, ~15
   12    26        FETCH_DIM_R                                          ~17     !1, 0
         27        FETCH_DIM_R                                          ~18     ~17, !3
         28        FRAMELESS_ICALL_2                strpos              ~19     ~18, '%26amp%3Bt%3D'
         29        TYPE_CHECK                                      1018          ~19
         30      > JMPZ                                                         ~20, ->41
   13    31    >   FRAMELESS_ICALL_3                str_replace         ~21     '%26amp%3Bt%3D', '%3Fstart%3D'
         32        OP_DATA                                                      !0
         33        ASSIGN                                                       !0, ~21
   14    34        FETCH_CONSTANT                                       ~23     'HAZELFENCES_WEBSITE'
         35        CONCAT                                               ~24     '%26enablejsapi%3D1%26origin%3D', ~23
         36        CONCAT                                               ~25     ~24, '%5B%2Fyoutube%5D'
         37        FRAMELESS_ICALL_3                preg_replace        ~26     '%23s%5C%5B%5C%2Fyoutube%5C%5D%23i', ~25
         38        OP_DATA                                                      !0
         39        ASSIGN                                                       !0, ~26
   12    40      > JMP                                                          ->47
   16    41    >   FETCH_CONSTANT                                       ~28     'HAZELFENCES_WEBSITE'
         42        CONCAT                                               ~29     '%3Fenablejsapi%3D1%26origin%3D', ~28
         43        CONCAT                                               ~30     ~29, '%5B%2Fyoutube%5D'
         44        FRAMELESS_ICALL_3                preg_replace        ~31     '%23%5C%5B%5C%2Fyoutube%5C%5D%23i', ~30
         45        OP_DATA                                                      !0
         46        ASSIGN                                                       !0, ~31
    9    47    >   PRE_INC                                                      !3
         48    >   IS_SMALLER                                                   !3, !2
         49      > JMPNZ                                                        ~34, ->23
   20    50    >   FRAMELESS_ICALL_3                preg_replace        ~35     '%2F%5C%5Byoutube%5C%5D%28%28%5Cs%7C.%29%2B%3F%29%5C%5B%5C%2Fyoutube%5C%5D%2Fi', '%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'
         51        OP_DATA                                                      !0
         52        ASSIGN                                                       !0, ~35
   24    53    >   ECHO                                                         !0
   25    54      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.25 ms | 1966 KiB | 15 Q