3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C{ public $title = 'a'; public $blah = 'b'; }; $ar = [new C, new C]; $result = ''; $comma = ''; foreach($ar as $item){ $result .= $comma.'"'.$item->title.'"'."\n"; $comma = ','; } echo $result;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/Knfg7
function name:  (null)
number of ops:  22
compiled vars:  !0 = $ar, !1 = $result, !2 = $comma, !3 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $4      'C'
          1        DO_FCALL                                      0          
          2        INIT_ARRAY                                       ~6      $4
          3        NEW                                              $7      'C'
          4        DO_FCALL                                      0          
          5        ADD_ARRAY_ELEMENT                                ~6      $7
          6        ASSIGN                                                   !0, ~6
    8     7        ASSIGN                                                   !1, ''
    9     8        ASSIGN                                                   !2, ''
   10     9      > FE_RESET_R                                       $12     !0, ->19
         10    > > FE_FETCH_R                                               $12, !3, ->19
   11    11    >   CONCAT                                           ~13     !2, '%22'
         12        FETCH_OBJ_R                                      ~14     !3, 'title'
         13        CONCAT                                           ~15     ~13, ~14
         14        CONCAT                                           ~16     ~15, '%22'
         15        CONCAT                                           ~17     ~16, '%0A'
         16        ASSIGN_OP                                     8          !1, ~17
   12    17        ASSIGN                                                   !2, '%2C'
   10    18      > JMP                                                      ->10
         19    >   FE_FREE                                                  $12
   15    20        ECHO                                                     !1
         21      > RETURN                                                   1

Class C: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.05 ms | 1394 KiB | 13 Q