3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array =[]; $newobj1 = new stdClass();//create a new $newobj2 = new stdClass();//create a new $newobj3 = new stdClass();//create a new $newobj1->ID = 1; $newobj2->ID = 2; $newobj3->ID = 3; $results = [$newobj1,$newobj2,$newobj3]; echo "<pre>"; print_r($results); //print new object $expected = []; foreach ($results as $key=>$obj){ $expected[] = $obj->ID; } echo implode(',',$expected); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 32
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/oUCkL
function name:  (null)
number of ops:  39
compiled vars:  !0 = $array, !1 = $newobj1, !2 = $newobj2, !3 = $newobj3, !4 = $results, !5 = $expected, !6 = $obj, !7 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        NEW                                              $9      'stdClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $9
    5     4        NEW                                              $12     'stdClass'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !2, $12
    6     7        NEW                                              $15     'stdClass'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !3, $15
    7    10        ASSIGN_OBJ                                               !1, 'ID'
         11        OP_DATA                                                  1
    8    12        ASSIGN_OBJ                                               !2, 'ID'
         13        OP_DATA                                                  2
    9    14        ASSIGN_OBJ                                               !3, 'ID'
         15        OP_DATA                                                  3
   10    16        INIT_ARRAY                                       ~21     !1
         17        ADD_ARRAY_ELEMENT                                ~21     !2
         18        ADD_ARRAY_ELEMENT                                ~21     !3
         19        ASSIGN                                                   !4, ~21
   12    20        ECHO                                                     '%3Cpre%3E'
   13    21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !4
         23        DO_ICALL                                                 
   15    24        ASSIGN                                                   !5, <array>
   16    25      > FE_RESET_R                                       $25     !4, ->32
         26    > > FE_FETCH_R                                       ~26     $25, !6, ->32
         27    >   ASSIGN                                                   !7, ~26
   17    28        FETCH_OBJ_R                                      ~29     !6, 'ID'
         29        ASSIGN_DIM                                               !5
         30        OP_DATA                                                  ~29
   16    31      > JMP                                                      ->26
         32    >   FE_FREE                                                  $25
   19    33        INIT_FCALL                                               'implode'
         34        SEND_VAL                                                 '%2C'
         35        SEND_VAR                                                 !5
         36        DO_ICALL                                         $30     
         37        ECHO                                                     $30
   22    38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.28 ms | 1004 KiB | 15 Q