3v4l.org

run code in 300+ PHP versions simultaneously
<?php function removeDivsWthoutAttributes($text) { return preg_replace('@<(div)[ ]*>(.*?)</\1>@si', '$2', $text); } var_dump(removeDivsWthoutAttributes("<a>test</a>sadas<div class=\"sdf\">TEST </div> <div>dffsdf</div> <div >fooBar</div>"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eMjJ9
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'removedivswthoutattributes'
          2        SEND_VAL                                                 '%3Ca%3Etest%3C%2Fa%3Esadas%3Cdiv+class%3D%22sdf%22%3ETEST+%3C%2Fdiv%3E+%3Cdiv%3Edffsdf%3C%2Fdiv%3E+%3Cdiv++++%3EfooBar%3C%2Fdiv%3E'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function removedivswthoutattributes:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eMjJ9
function name:  removeDivsWthoutAttributes
number of ops:  8
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%40%3C%28div%29%5B+%5D%2A%3E%28.%2A%3F%29%3C%2F%5C1%3E%40si'
          3        SEND_VAL                                                 '%242'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
    5     7*     > RETURN                                                   null

End of function removedivswthoutattributes

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.82 ms | 1005 KiB | 16 Q