3v4l.org

run code in 500+ PHP versions simultaneously
<?php // create array of objects $arr = []; $tx = ["ans1","ans2","ans3"]; for ($i = 0, $max = 3; $i < $max; $i++) { $arr[] = new stdClass; $arr[$i]->text = $tx[$i]; } //***** First Answer ******* $nu = array_map( function($e) { return $e->text; }, $arr); //***** Second Answer ******* $str = join(",",$nu); // ***** Output ********* print_r( $nu ); print_r( $str );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
Branch analysis from position: 5
filename:       /in/KBVcb
function name:  (null)
number of ops:  34
compiled vars:  !0 = $arr, !1 = $tx, !2 = $i, !3 = $max, !4 = $nu, !5 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                       !0, <array>
    6     1        ASSIGN                                                       !1, <array>
    8     2        ASSIGN                                                       !2, 0
          3        ASSIGN                                                       !3, 3
          4      > JMP                                                          ->14
    9     5    >   NEW                                                  $11     'stdClass'
          6        DO_FCALL                                          0          
          7        ASSIGN_DIM                                                   !0
          8        OP_DATA                                                      $11
   10     9        FETCH_DIM_R                                          ~15     !1, !2
         10        FETCH_DIM_W                                          $13     !0, !2
         11        ASSIGN_OBJ                                                   $13, 'text'
         12        OP_DATA                                                      ~15
    8    13        PRE_INC                                                      !2
         14    >   IS_SMALLER                                                   !2, !3
         15      > JMPNZ                                                        ~17, ->5
   15    16    >   INIT_FCALL                                                   'array_map'
         17        DECLARE_LAMBDA_FUNCTION                              ~18     [0]
   19    18        SEND_VAL                                                     ~18
         19        SEND_VAR                                                     !0
   15    20        DO_ICALL                                             $19     
         21        ASSIGN                                                       !4, $19
   22    22        INIT_FCALL                                                   'join'
         23        SEND_VAL                                                     '%2C'
         24        SEND_VAR                                                     !4
         25        DO_ICALL                                             $21     
         26        ASSIGN                                                       !5, $21
   25    27        INIT_FCALL                                                   'print_r'
         28        SEND_VAR                                                     !4
         29        DO_ICALL                                                     
   26    30        INIT_FCALL                                                   'print_r'
         31        SEND_VAR                                                     !5
         32        DO_ICALL                                                     
         33      > 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/KBVcb
function name:  {closure:/in/KBVcb:15}
number of ops:  4
compiled vars:  !0 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   RECV                                                 !0      
   17     1        FETCH_OBJ_R                                          ~1      !0, 'text'
          2      > RETURN                                                       ~1
   19     3*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
173.1 ms | 3040 KiB | 16 Q