3v4l.org

run code in 300+ PHP versions simultaneously
<?php $desc = "this <br>is a test"; $maxLen = 7; $structured_desc = "<span>" . mb_substr($desc, 0, $maxLen) . "</span>" . mb_substr($desc, $maxLen); $structured_desc = preg_replace('/<([^>]*)<\/span>([^>]*)>/', '<span><$1$2>', $structured_desc); echo $structured_desc;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nIEc2
function name:  (null)
number of ops:  23
compiled vars:  !0 = $desc, !1 = $maxLen, !2 = $structured_desc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'this+%3Cbr%3Eis+a+test'
    4     1        ASSIGN                                                   !1, 7
    5     2        INIT_FCALL                                               'mb_substr'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $5      
          7        CONCAT                                           ~6      '%3Cspan%3E', $5
          8        CONCAT                                           ~7      ~6, '%3C%2Fspan%3E'
          9        INIT_FCALL                                               'mb_substr'
         10        SEND_VAR                                                 !0
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $8      
         13        CONCAT                                           ~9      ~7, $8
         14        ASSIGN                                                   !2, ~9
    6    15        INIT_FCALL                                               'preg_replace'
         16        SEND_VAL                                                 '%2F%3C%28%5B%5E%3E%5D%2A%29%3C%5C%2Fspan%3E%28%5B%5E%3E%5D%2A%29%3E%2F'
         17        SEND_VAL                                                 '%3Cspan%3E%3C%241%242%3E'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $11     
         20        ASSIGN                                                   !2, $11
    7    21        ECHO                                                     !2
    8    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
128.42 ms | 1399 KiB | 17 Q