3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyList implements Countable { public $items; public function __construct($items) { $this->items = $items; } public function __size() { return count($this->items); } } $list = new MyList([1, 2, 3]); echo count($list);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ksjOb
function name:  (null)
number of ops:  8
compiled vars:  !0 = $list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'mylist'
   18     1        NEW                                              $1      'MyList'
          2        SEND_VAL_EX                                              <array>
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   19     5        COUNT                                            ~4      !0
          6        ECHO                                                     ~4
          7      > RETURN                                                   1

Class MyList:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ksjOb
function name:  __construct
number of ops:  4
compiled vars:  !0 = $items
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'items'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function __construct

Function __size:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ksjOb
function name:  __size
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'items'
          1        COUNT                                            ~1      ~0
          2      > RETURN                                                   ~1
   15     3*     > RETURN                                                   null

End of function __size

End of class MyList.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.02 ms | 1393 KiB | 13 Q