3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <figure data-trix-attachment="{&quot;content&quot;:&quot;<span class=\&quot;trix-token\&quot; data-token-id=\&quot;landlord_name\&quot;>Jméno pronajímatele</span>&quot;}" data-trix-content-type="undefined" class="attachment attachment--content"><span class="trix-token">Jméno pronajímatele</span><figcaption class="attachment__caption"></figcaption></figure> HTML; $figureOpenTagPattern = \sprintf('<figure data-token-id="%s"[^>]*>', $token->name); $figureOpenTagReplacement = \sprintf('<figure data-token-id="%s">', $token->name); $figureEndTag = '<\/figure>'; $html = \preg_replace( '/' . $figureOpenTagPattern . '(.+)' . $figureEndTag . '/U', $figureOpenTagReplacement . \sprintf('<span class="trix-token %s %s" data-token-id="%s">%s</span>', $token->name, $tokenClass, $token->name, $token->value) . '</figure>', $html, ); echo $html;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QmJR6
function name:  (null)
number of ops:  38
compiled vars:  !0 = $html, !1 = $figureOpenTagPattern, !2 = $token, !3 = $figureOpenTagReplacement, !4 = $figureEndTag, !5 = $tokenClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cfigure+data-trix-attachment%3D%22%7B%26quot%3Bcontent%26quot%3B%3A%26quot%3B%3Cspan+class%3D%5C%26quot%3Btrix-token%5C%26quot%3B+data-token-id%3D%5C%26quot%3Blandlord_name%5C%26quot%3B%3EJm%C3%A9no+pronaj%C3%ADmatele%3C%2Fspan%3E%26quot%3B%7D%22+data-trix-content-type%3D%22undefined%22+class%3D%22attachment+attachment--content%22%3E%3Cspan+class%3D%22trix-token%22%3EJm%C3%A9no+pronaj%C3%ADmatele%3C%2Fspan%3E%3Cfigcaption+class%3D%22attachment__caption%22%3E%3C%2Ffigcaption%3E%3C%2Ffigure%3E'
    5     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 '%3Cfigure+data-token-id%3D%22%25s%22%5B%5E%3E%5D%2A%3E'
          3        FETCH_OBJ_R                                      ~7      !2, 'name'
          4        SEND_VAL                                                 ~7
          5        DO_ICALL                                         $8      
          6        ASSIGN                                                   !1, $8
    6     7        INIT_FCALL                                               'sprintf'
          8        SEND_VAL                                                 '%3Cfigure+data-token-id%3D%22%25s%22%3E'
          9        FETCH_OBJ_R                                      ~10     !2, 'name'
         10        SEND_VAL                                                 ~10
         11        DO_ICALL                                         $11     
         12        ASSIGN                                                   !3, $11
    7    13        ASSIGN                                                   !4, '%3C%5C%2Ffigure%3E'
    8    14        INIT_FCALL                                               'preg_replace'
    9    15        CONCAT                                           ~14     '%2F', !1
         16        CONCAT                                           ~15     ~14, '%28.%2B%29'
         17        CONCAT                                           ~16     ~15, !4
         18        CONCAT                                           ~17     ~16, '%2FU'
         19        SEND_VAL                                                 ~17
   10    20        INIT_FCALL                                               'sprintf'
         21        SEND_VAL                                                 '%3Cspan+class%3D%22trix-token+%25s+%25s%22+data-token-id%3D%22%25s%22%3E%25s%3C%2Fspan%3E'
         22        FETCH_OBJ_R                                      ~18     !2, 'name'
         23        SEND_VAL                                                 ~18
         24        SEND_VAR                                                 !5
         25        FETCH_OBJ_R                                      ~19     !2, 'name'
         26        SEND_VAL                                                 ~19
         27        FETCH_OBJ_R                                      ~20     !2, 'value'
         28        SEND_VAL                                                 ~20
         29        DO_ICALL                                         $21     
         30        CONCAT                                           ~22     !3, $21
         31        CONCAT                                           ~23     ~22, '%3C%2Ffigure%3E'
         32        SEND_VAL                                                 ~23
   11    33        SEND_VAR                                                 !0
    8    34        DO_ICALL                                         $24     
         35        ASSIGN                                                   !0, $24
   14    36        ECHO                                                     !0
   15    37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.81 ms | 1016 KiB | 15 Q