3v4l.org

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

Function %00%7Bclosure%7D%2Fin%2F534oN%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/534oN
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        FETCH_OBJ_R                                      ~1      !0, 'text'
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F534oN%3A14%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156 ms | 1392 KiB | 19 Q