3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'binary_function([x,y]) and binary_function([x1,y1,z1])'; echo preg_replace_callback('~binary_function\(\[(.*?)]\)~', function ($m) { return implode("", array_map(function ($x) { return strtoupper($x); }, explode(",", $m[1]))); }, $text);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4ECni
function name:  (null)
number of ops:  9
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'binary_function%28%5Bx%2Cy%5D%29+and+binary_function%28%5Bx1%2Cy1%2Cz1%5D%29'
    4     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%7Ebinary_function%5C%28%5C%5B%28.%2A%3F%29%5D%5C%29%7E'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4ECni%3A4%240'
    6     4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        ECHO                                                     $3
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F4ECni%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4ECni
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 ''
          3        INIT_FCALL                                               'array_map'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4ECni%3A5%241'
          5        SEND_VAL                                                 ~1
          6        INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 '%2C'
          8        FETCH_DIM_R                                      ~2      !0, 1
          9        SEND_VAL                                                 ~2
         10        DO_ICALL                                         $3      
         11        SEND_VAR                                                 $3
         12        DO_ICALL                                         $4      
         13        SEND_VAR                                                 $4
         14        DO_ICALL                                         $5      
         15      > RETURN                                                   $5
    6    16*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F4ECni%3A4%240

Function %00%7Bclosure%7D%2Fin%2F4ECni%3A5%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4ECni
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'strtoupper'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
          5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F4ECni%3A5%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.71 ms | 1400 KiB | 23 Q