3v4l.org

run code in 300+ PHP versions simultaneously
<?php $files = array('header','detay','footer'); echo './cache/' . implode('', $files) . EXT; echo '<br>'; $_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/o8srZ
function name:  (null)
number of ops:  22
compiled vars:  !0 = $files, !1 = $_lang, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 ''
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        CONCAT                                           ~5      '.%2Fcache%2F', $4
          6        FETCH_CONSTANT                                   ~6      'EXT'
          7        CONCAT                                           ~7      ~5, ~6
          8        ECHO                                                     ~7
    4     9        ECHO                                                     '%3Cbr%3E'
    5    10        ASSIGN                                                   !1, <array>
    6    11        ASSIGN                                                   !2, 'Hello+world+%7B%5Ba%5D%7D+please'
    7    12        INIT_FCALL                                               'preg_replace_callback'
         13        SEND_VAL                                                 '%2F%5C%7B%5C%5B%28.%2A%3F%29%5C%5D%5C%7D%2F'
         14        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fo8srZ%3A7%240'
         15        BIND_LEXICAL                                             ~10, !1
         16        SEND_VAL                                                 ~10
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $11     
         19        ASSIGN                                                   !2, $11
    8    20        ECHO                                                     !2
         21      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fo8srZ%3A7%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/o8srZ
function name:  {closure}
number of ops:  19
compiled vars:  !0 = $m, !1 = $_lang
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     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%2Fo8srZ%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.17 ms | 1400 KiB | 19 Q