3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = <<<HTML <table> <thead> <tr> <th>1</th> <th>2</th> </tr> </thead> <tbody> <tr> <td> <table> <thead> <tr> <th>A</th> <th>B</th> </tr> </thead> <tbody> <tr> <td>C</td> <td>D</td> </tr> </tbody> </table> </td> <td>4</td> </tr> </tbody> </table> HTML; var_dump( preg_replace_callback('~<table.*?</table>~is', function ($match) { return '<div>' . $match[0] . '</div>'; }, $content) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fme05
function name:  (null)
number of ops:  11
compiled vars:  !0 = $content
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '++++%3Ctable%3E%0A++++++++%3Cthead%3E%0A++++++++++++%3Ctr%3E%0A++++++++++++++++%3Cth%3E1%3C%2Fth%3E%0A++++++++++++++++%3Cth%3E2%3C%2Fth%3E%0A++++++++++++%3C%2Ftr%3E%0A++++++++%3C%2Fthead%3E++++%0A++++++++%3Ctbody%3E%0A++++++++++++%3Ctr%3E%0A++++++++++++++++%3Ctd%3E%0A++++++++++++++++++++%3Ctable%3E%0A++++++++++++++++++++++++%3Cthead%3E%0A++++++++++++++++++++++++++++%3Ctr%3E%0A++++++++++++++++++++++++++++++++%3Cth%3EA%3C%2Fth%3E%0A++++++++++++++++++++++++++++++++%3Cth%3EB%3C%2Fth%3E%0A++++++++++++++++++++++++++++%3C%2Ftr%3E%0A++++++++++++++++++++++++%3C%2Fthead%3E++++%0A++++++++++++++++++++++++%3Ctbody%3E%0A++++++++++++++++++++++++++++%3Ctr%3E%0A++++++++++++++++++++++++++++++++%3Ctd%3EC%3C%2Ftd%3E%0A++++++++++++++++++++++++++++++++%3Ctd%3ED%3C%2Ftd%3E%0A++++++++++++++++++++++++++++%3C%2Ftr%3E%0A++++++++++++++++++++++++%3C%2Ftbody%3E%0A++++++++++++++++++++%3C%2Ftable%3E++++++++++++++++%0A++++++++++++++++%3C%2Ftd%3E%0A++++++++++++++++%3Ctd%3E4%3C%2Ftd%3E%0A++++++++++++%3C%2Ftr%3E%0A++++++++%3C%2Ftbody%3E%0A++++%3C%2Ftable%3E'
   34     1        INIT_FCALL                                               'var_dump'
   35     2        INIT_FCALL                                               'preg_replace_callback'
          3        SEND_VAL                                                 '%7E%3Ctable.%2A%3F%3C%2Ftable%3E%7Eis'
          4        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   37     5        SEND_VAL                                                 ~2
          6        SEND_VAR                                                 !0
   35     7        DO_ICALL                                         $3      
   37     8        SEND_VAR                                                 $3
   34     9        DO_ICALL                                                 
   38    10      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fme05
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
   36     1        FETCH_DIM_R                                      ~1      !0, 0
          2        CONCAT                                           ~2      '%3Cdiv%3E', ~1
          3        CONCAT                                           ~3      ~2, '%3C%2Fdiv%3E'
          4      > RETURN                                                   ~3
   37     5*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.57 ms | 1002 KiB | 15 Q