3v4l.org

run code in 300+ PHP versions simultaneously
<?php $prefix = 'pre_'; $clients = [ (object) ['user_login' => 'foo'], (object) ['user_login' => 'bar'], (object) ['user_login' => 'buzz'], ]; $result = [ 'label' => 'Assign to user', 'desc' => 'Choose a user', 'id' => $prefix . 'client', 'type' => 'radio', 'options' => array_map( fn($user) => [ 'label' => $user->user_login, 'value' => $user->user_login, ], $clients ) ]; var_export($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KiXfE
function name:  (null)
number of ops:  24
compiled vars:  !0 = $prefix, !1 = $clients, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'pre_'
    5     1        CAST                                          8  ~4      <array>
          2        INIT_ARRAY                                       ~5      ~4
    6     3        CAST                                          8  ~6      <array>
          4        ADD_ARRAY_ELEMENT                                ~5      ~6
    7     5        CAST                                          8  ~7      <array>
          6        ADD_ARRAY_ELEMENT                                ~5      ~7
    4     7        ASSIGN                                                   !1, ~5
   11     8        INIT_ARRAY                                       ~9      'Assign+to+user', 'label'
   12     9        ADD_ARRAY_ELEMENT                                ~9      'Choose+a+user', 'desc'
   13    10        CONCAT                                           ~10     !0, 'client'
         11        ADD_ARRAY_ELEMENT                                ~9      ~10, 'id'
   14    12        ADD_ARRAY_ELEMENT                                ~9      'radio', 'type'
   15    13        INIT_FCALL                                               'array_map'
   16    14        DECLARE_LAMBDA_FUNCTION                          ~11     [0]
   19    15        SEND_VAL                                                 ~11
   20    16        SEND_VAR                                                 !1
   15    17        DO_ICALL                                         $12     
   20    18        ADD_ARRAY_ELEMENT                                ~9      $12, 'options'
   10    19        ASSIGN                                                   !2, ~9
   24    20        INIT_FCALL                                               'var_export'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
         23      > 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/KiXfE
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        FETCH_OBJ_R                                      ~1      !0, 'user_login'
          2        INIT_ARRAY                                       ~2      ~1, 'label'
   18     3        FETCH_OBJ_R                                      ~3      !0, 'user_login'
          4        ADD_ARRAY_ELEMENT                                ~2      ~3, 'value'
          5      > RETURN                                                   ~2
   19     6*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.04 ms | 1000 KiB | 15 Q