3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = 'id=1 username=foobar comment=This is a sample comment'; $result = preg_replace_callback( '/\b(comment=)(.+)$/ms', function (array $matches) { return $matches[0] . preg_replace("/[\r\n]+/", " ", $matches[1]); }, $data ); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m33Fe
function name:  (null)
number of ops:  12
compiled vars:  !0 = $data, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'id%3D1%0A%0Ausername%3Dfoobar%0A%0Acomment%3DThis+is%0A%0Aa+sample%0A%0Acomment'
   12     1        INIT_FCALL                                               'preg_replace_callback'
   13     2        SEND_VAL                                                 '%2F%5Cb%28comment%3D%29%28.%2B%29%24%2Fms'
   14     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fm33Fe%3A14%240'
   16     4        SEND_VAL                                                 ~3
   17     5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
   12     7        ASSIGN                                                   !1, $4
   20     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fm33Fe%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m33Fe
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        FETCH_DIM_R                                      ~1      !0, 0
          2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAL                                                 '%2F%5B%0D%0A%5D%2B%2F'
          4        SEND_VAL                                                 '+'
          5        FETCH_DIM_R                                      ~2      !0, 1
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                         $3      
          8        CONCAT                                           ~4      ~1, $3
          9      > RETURN                                                   ~4
   16    10*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fm33Fe%3A14%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.75 ms | 1395 KiB | 19 Q