3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_lang = array('a'=>'a harfi','b'=>'b harfi'); $c = 'Hello world {[a]} please'; $c = preg_replace_callback('/\{\[(.*?)\]\}/', function($m) use ($_lang) { return isset($_lang[trim($m[1])]) ? $_lang[trim($m[1])] : $m[1]; }, $c); echo $c;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svrH2
function name:  (null)
number of ops:  12
compiled vars:  !0 = $_lang, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 'Hello+world+%7B%5Ba%5D%7D+please'
    5     2        INIT_FCALL                                               'preg_replace_callback'
          3        SEND_VAL                                                 '%2F%5C%7B%5C%5B%28.%2A%3F%29%5C%5D%5C%7D%2F'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FsvrH2%3A5%240'
          5        BIND_LEXICAL                                             ~4, !0
          6        SEND_VAL                                                 ~4
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !1, $5
    6    10        ECHO                                                     !1
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FsvrH2%3A5%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svrH2
function name:  {closure}
number of ops:  19
compiled vars:  !0 = $m, !1 = $_lang
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        INIT_FCALL                                               'trim'
          3        FETCH_DIM_R                                      ~2      !0, 1
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6        ISSET_ISEMPTY_DIM_OBJ                         0          !1, $3
          7      > JMPZ                                                     ~4, ->15
          8    >   INIT_FCALL                                               'trim'
          9        FETCH_DIM_R                                      ~5      !0, 1
         10        SEND_VAL                                                 ~5
         11        DO_ICALL                                         $6      
         12        FETCH_DIM_R                                      ~7      !1, $6
         13        QM_ASSIGN                                        ~8      ~7
         14      > JMP                                                      ->17
         15    >   FETCH_DIM_R                                      ~9      !0, 1
         16        QM_ASSIGN                                        ~8      ~9
         17    > > RETURN                                                   ~8
         18*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FsvrH2%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.37 ms | 1396 KiB | 17 Q