3v4l.org

run code in 300+ 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 ********* var_dump( $nu, $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/gPRWO
function name:  (null)
number of ops:  32
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                                  '%00%7Bclosure%7D%2Fin%2FgPRWO%3A15%240'
   19    18        SEND_VAL                                                 ~18
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $19     
   15    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                                               'var_dump'
         28        SEND_VAR                                                 !4
         29        SEND_VAR                                                 !5
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FgPRWO%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gPRWO
function name:  {closure}
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 function %00%7Bclosure%7D%2Fin%2FgPRWO%3A15%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.53 ms | 1400 KiB | 19 Q