3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = '<li class="dropdown-submenu active active-child"><a href="http://local.sonance.com/in-wall-in-ceiling/visual-performance">Visual Performance</a><ul class="level-3 dropdown-menu children-3"><li><a href="http://local.sonance.com/in-wall-in-ceiling/visual-performance#t1">Performance</a></li><li><a href="http://local.sonance.com/in-wall-in-ceiling/visual-performance#t2">Aesthetics</a></li><li><a href="http://local.sonance.com/in-wall-in-ceiling/visual-performance#t3">Installation</a></li></ul></li>'; $skipDictionary = array( 'all' => array( 'Visual Performance', 'ThinLine', 'Extreme', 'Architectural Series', 'Invisible Series', 'Cinema', 'Soundbar', 'Subwoofers', 'Sonance Landscape Series', 'Satellites', 'Subwoofers', 'Systems', 'Sonarray', 'Mariners', 'Medium' ) ); $replaceArray = array_map(function($val){ return '<span class="notranslate">'.$val.'</span>'; }, $skipDictionary['all']); foreach($skipDictionary['all'] AS $idx => $search) { $text = preg_replace('@(\s|\>|^)'.$search.'(\s|$)@', '\1' . $replaceArray[$idx], $text); } echo '<div>'.$text.'</div>';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 24
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 24
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/Vc5v2
function name:  (null)
number of ops:  29
compiled vars:  !0 = $text, !1 = $skipDictionary, !2 = $replaceArray, !3 = $search, !4 = $idx
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cli+class%3D%22dropdown-submenu+active+active-child%22%3E%3Ca+href%3D%22http%3A%2F%2Flocal.sonance.com%2Fin-wall-in-ceiling%2Fvisual-performance%22%3EVisual+Performance%3C%2Fa%3E%3Cul+class%3D%22level-3+dropdown-menu+children-3%22%3E%3Cli%3E%3Ca+href%3D%22http%3A%2F%2Flocal.sonance.com%2Fin-wall-in-ceiling%2Fvisual-performance%23t1%22%3EPerformance%3C%2Fa%3E%3C%2Fli%3E%3Cli%3E%3Ca+href%3D%22http%3A%2F%2Flocal.sonance.com%2Fin-wall-in-ceiling%2Fvisual-performance%23t2%22%3EAesthetics%3C%2Fa%3E%3C%2Fli%3E%3Cli%3E%3Ca+href%3D%22http%3A%2F%2Flocal.sonance.com%2Fin-wall-in-ceiling%2Fvisual-performance%23t3%22%3EInstallation%3C%2Fa%3E%3C%2Fli%3E%3C%2Ful%3E%3C%2Fli%3E'
    3     1        ASSIGN                                                   !1, <array>
   23     2        INIT_FCALL                                               'array_map'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FVc5v2%3A23%240'
   25     4        SEND_VAL                                                 ~7
          5        FETCH_DIM_R                                      ~8      !1, 'all'
          6        SEND_VAL                                                 ~8
          7        DO_ICALL                                         $9      
   23     8        ASSIGN                                                   !2, $9
   27     9        FETCH_DIM_R                                      ~11     !1, 'all'
         10      > FE_RESET_R                                       $12     ~11, ->24
         11    > > FE_FETCH_R                                       ~13     $12, !3, ->24
         12    >   ASSIGN                                                   !4, ~13
   28    13        INIT_FCALL                                               'preg_replace'
         14        CONCAT                                           ~15     '%40%28%5Cs%7C%5C%3E%7C%5E%29', !3
         15        CONCAT                                           ~16     ~15, '%28%5Cs%7C%24%29%40'
         16        SEND_VAL                                                 ~16
         17        FETCH_DIM_R                                      ~17     !2, !4
         18        CONCAT                                           ~18     '%5C1', ~17
         19        SEND_VAL                                                 ~18
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $19     
         22        ASSIGN                                                   !0, $19
   27    23      > JMP                                                      ->11
         24    >   FE_FREE                                                  $12
   31    25        CONCAT                                           ~21     '%3Cdiv%3E', !0
         26        CONCAT                                           ~22     ~21, '%3C%2Fdiv%3E'
         27        ECHO                                                     ~22
         28      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FVc5v2%3A23%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Vc5v2
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   24     1        CONCAT                                           ~1      '%3Cspan+class%3D%22notranslate%22%3E', !0
          2        CONCAT                                           ~2      ~1, '%3C%2Fspan%3E'
          3      > RETURN                                                   ~2
   25     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FVc5v2%3A23%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.87 ms | 1392 KiB | 17 Q