3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Item { public static $c = 0; public $i; public function __construct() { $this->i = self::$c; self::$c += 1; } } $collection = new \SplDoublyLinkedList(); $collection->add(0, new Item()); $collection->add(1, new Item()); foreach ($collection as $i=>$item) { echo $i . ' ' . $item->i . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 24
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 24
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/YCTpO
function name:  (null)
number of ops:  26
compiled vars:  !0 = $collection, !1 = $item, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $3      'SplDoublyLinkedList'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   14     3        INIT_METHOD_CALL                                         !0, 'add'
          4        SEND_VAL_EX                                              0
          5        NEW                                              $6      'Item'
          6        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $6
          8        DO_FCALL                                      0          
   15     9        INIT_METHOD_CALL                                         !0, 'add'
         10        SEND_VAL_EX                                              1
         11        NEW                                              $9      'Item'
         12        DO_FCALL                                      0          
         13        SEND_VAR_NO_REF_EX                                       $9
         14        DO_FCALL                                      0          
   18    15      > FE_RESET_R                                       $12     !0, ->24
         16    > > FE_FETCH_R                                       ~13     $12, !1, ->24
         17    >   ASSIGN                                                   !2, ~13
   19    18        CONCAT                                           ~15     !2, '+'
         19        FETCH_OBJ_R                                      ~16     !1, 'i'
         20        CONCAT                                           ~17     ~15, ~16
         21        CONCAT                                           ~18     ~17, '%0A'
         22        ECHO                                                     ~18
   18    23      > JMP                                                      ->16
         24    >   FE_FREE                                                  $12
   20    25      > RETURN                                                   1

Class Item:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YCTpO
function name:  __construct
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_STATIC_PROP_R          unknown             ~1      'c'
          1        ASSIGN_OBJ                                               'i'
          2        OP_DATA                                                  ~1
    8     3        ASSIGN_STATIC_PROP_OP                         1          'c'
          4        OP_DATA                                                  1
    9     5      > RETURN                                                   null

End of function __construct

End of class Item.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.59 ms | 1395 KiB | 13 Q