3v4l.org

run code in 500+ 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                              ~2      [0]
    6     4        SEND_VAL                                                     ~2
          5        SEND_VAR                                                     !0
    4     6        DO_ICALL                                             $3      
    6     7        ECHO                                                         $3
          8      > 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/4ECni
function name:  {closure:/in/4ECni:4}
number of ops:  14
compiled vars:  !0 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
    5     1        INIT_FCALL                                                   'array_map'
          2        DECLARE_LAMBDA_FUNCTION                              ~1      [0]
          3        SEND_VAL                                                     ~1
          4        INIT_FCALL                                                   'explode'
          5        SEND_VAL                                                     '%2C'
          6        FETCH_DIM_R                                          ~2      !0, 1
          7        SEND_VAL                                                     ~2
          8        DO_ICALL                                             $3      
          9        SEND_VAR                                                     $3
         10        DO_ICALL                                             $4      
         11        FRAMELESS_ICALL_2                implode             ~5      '', $4
         12      > RETURN                                                       ~5
    6    13*     > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4ECni
function name:  {closure:{closure:/in/4ECni:4}:5}
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 Dynamic Function 0

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.57 ms | 2100 KiB | 17 Q