3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text1 = <<<EOD <tr class="aaa"> <td class="bbb"> <p> あああああ </p> </td> <tr> EOD; $text2 = <<<EOD <tr class="aaa"> <td class="bbb"> あああああ </td> <tr> EOD; echo "【RESULT 1】\n\n"; echo preg_replace_callback( '@(<br[^>]*+>)|\s?<p>|</p>\s?|(?<=<t(?:r|d))[^>]*+(?=>)@', function ($matches) { return isset($matches[1]) ? '、' : ''; }, $text1 ); echo "\n\n【RESULT 2】\n\n"; echo preg_replace_callback( '@(<br[^>]*+>)|\s?</?+p>\s?|(?<=<t(?:r|d))[^>]*+(?=>)@', function ($matches) { return isset($matches[1]) ? '、' : ''; }, $text2 );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OhTUD
function name:  (null)
number of ops:  19
compiled vars:  !0 = $text1, !1 = $text2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Ctr+class%3D%22aaa%22%3E%0A%3Ctd+class%3D%22bbb%22%3E%0A%3Cp%3E%0A%E3%81%82%E3%81%82%E3%81%82%E3%81%82%E3%81%82%0A%3C%2Fp%3E%0A%3C%2Ftd%3E%0A%3Ctr%3E'
   13     1        ASSIGN                                                   !1, '%3Ctr+class%3D%22aaa%22%3E%0A%3Ctd+class%3D%22bbb%22%3E%0A%E3%81%82%E3%81%82%E3%81%82%E3%81%82%E3%81%82%0A%3C%2Ftd%3E%0A%3Ctr%3E'
   21     2        ECHO                                                     '%E3%80%90RESULT+1%E3%80%91%0A%0A'
   23     3        INIT_FCALL                                               'preg_replace_callback'
   24     4        SEND_VAL                                                 '%40%28%3Cbr%5B%5E%3E%5D%2A%2B%3E%29%7C%5Cs%3F%3Cp%3E%7C%3C%2Fp%3E%5Cs%3F%7C%28%3F%3C%3D%3Ct%28%3F%3Ar%7Cd%29%29%5B%5E%3E%5D%2A%2B%28%3F%3D%3E%29%40'
   25     5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FOhTUD%3A25%240'
   27     6        SEND_VAL                                                 ~4
   28     7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $5      
          9        ECHO                                                     $5
   31    10        ECHO                                                     '%0A%0A%E3%80%90RESULT+2%E3%80%91%0A%0A'
   33    11        INIT_FCALL                                               'preg_replace_callback'
   34    12        SEND_VAL                                                 '%40%28%3Cbr%5B%5E%3E%5D%2A%2B%3E%29%7C%5Cs%3F%3C%2F%3F%2Bp%3E%5Cs%3F%7C%28%3F%3C%3D%3Ct%28%3F%3Ar%7Cd%29%29%5B%5E%3E%5D%2A%2B%28%3F%3D%3E%29%40'
   35    13        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FOhTUD%3A35%241'
   37    14        SEND_VAL                                                 ~6
   38    15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $7      
         17        ECHO                                                     $7
   39    18      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FOhTUD%3A25%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OhTUD
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   26     1        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 1
          2      > JMPZ                                                     ~1, ->5
          3    >   QM_ASSIGN                                        ~2      '%E3%80%81'
          4      > JMP                                                      ->6
          5    >   QM_ASSIGN                                        ~2      ''
          6    > > RETURN                                                   ~2
   27     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FOhTUD%3A25%240

Function %00%7Bclosure%7D%2Fin%2FOhTUD%3A35%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OhTUD
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
   36     1        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 1
          2      > JMPZ                                                     ~1, ->5
          3    >   QM_ASSIGN                                        ~2      '%E3%80%81'
          4      > JMP                                                      ->6
          5    >   QM_ASSIGN                                        ~2      ''
          6    > > RETURN                                                   ~2
   37     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FOhTUD%3A35%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.38 ms | 1400 KiB | 15 Q