3v4l.org

run code in 300+ PHP versions simultaneously
<?php function __(string $text, string $domain = 'default') { return $text; } function register_sidebar(array $payload) { var_export($payload); echo "\n---\n"; } $input = 'sideone:1,sidetwo:1,sidethree:0'; foreach (explode(',', $input) as $pair) { if (preg_match('/^([^:]+):1$/', $pair, $m)) { register_sidebar([ 'name' => __('Footer Column ' . $m[1], 'wecodeart'), 'id' => 'footer-' . $m[1], 'before_widget' => '<div>', 'after_widget' => '</div>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>', ]); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 31
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 31
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 30
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 30
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/PM9mN
function name:  (null)
number of ops:  33
compiled vars:  !0 = $input, !1 = $pair, !2 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, 'sideone%3A1%2Csidetwo%3A1%2Csidethree%3A0'
   14     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5      > FE_RESET_R                                       $5      $4, ->31
          6    > > FE_FETCH_R                                               $5, !1, ->31
   15     7    >   INIT_FCALL                                               'preg_match'
          8        SEND_VAL                                                 '%2F%5E%28%5B%5E%3A%5D%2B%29%3A1%24%2F'
          9        SEND_VAR                                                 !1
         10        SEND_REF                                                 !2
         11        DO_ICALL                                         $6      
         12      > JMPZ                                                     $6, ->30
   16    13    >   INIT_FCALL                                               'register_sidebar'
   17    14        INIT_FCALL                                               '__'
         15        FETCH_DIM_R                                      ~7      !2, 1
         16        CONCAT                                           ~8      'Footer+Column+', ~7
         17        SEND_VAL                                                 ~8
         18        SEND_VAL                                                 'wecodeart'
         19        DO_FCALL                                      0  $9      
         20        INIT_ARRAY                                       ~10     $9, 'name'
   18    21        FETCH_DIM_R                                      ~11     !2, 1
         22        CONCAT                                           ~12     'footer-', ~11
         23        ADD_ARRAY_ELEMENT                                ~10     ~12, 'id'
   19    24        ADD_ARRAY_ELEMENT                                ~10     '%3Cdiv%3E', 'before_widget'
   20    25        ADD_ARRAY_ELEMENT                                ~10     '%3C%2Fdiv%3E', 'after_widget'
   21    26        ADD_ARRAY_ELEMENT                                ~10     '%3Ch2+class%3D%22widget-title%22%3E', 'before_title'
   22    27        ADD_ARRAY_ELEMENT                                ~10     '%3C%2Fh2%3E', 'after_title'
         28        SEND_VAL                                                 ~10
   16    29        DO_FCALL                                      0          
   14    30    > > JMP                                                      ->6
         31    >   FE_FREE                                                  $5
   25    32      > RETURN                                                   1

Function __:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PM9mN
function name:  __
number of ops:  4
compiled vars:  !0 = $text, !1 = $domain
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      'default'
    4     2      > RETURN                                                   !0
    5     3*     > RETURN                                                   null

End of function __

Function register_sidebar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PM9mN
function name:  register_sidebar
number of ops:  6
compiled vars:  !0 = $payload
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'var_export'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    9     4        ECHO                                                     '%0A---%0A'
   10     5      > RETURN                                                   null

End of function register_sidebar

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
281.17 ms | 1020 KiB | 18 Q