3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface NodeInterface { public function addNode(Node $node); public function isLeaf(); public function isNode(); public function getKey(); public function setKey($key); public function getValue(); public function setValue($value); public function getUid(); public function uid(); public function key(); public function value(); } class ArrComp implements NodeInterface { protected $uid; protected $nodes; protected $value; public function __construct($key = null, $value = null) { $this->uid = rand(0, 9) . md5(rand(10, 99) . time() . rand(100, 999)) . rand(1000, 9999); $this->value = new stdClass; $this->value->key = $key; $this->value->val = $value; $this->nodes = []; } public function addNode(Node $node) { $this->nodes[] = $node; return $this; } public function isLeaf() { return count($this->nodes) == 0; } public function isNode() { return count($this->nodes) > 0; } public function getKey() { return $this->value->key; } public function key() { return $this->value->key; } public function setKey($key = null) { $this->value->key = $key; return $this; } public function getValue() { return $this->value->val; } public function value() { return $this->value->val; } public function setValue($value = null) { $this->value->val = $value; return $this; } public function getUid() { return $this->uid; } public function uid() { return $this->uid; } } $comp = new ArrComp('pk'); var_dump($comp);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  (null)
number of ops:  9
compiled vars:  !0 = $comp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   DECLARE_CLASS                                            'arrcomp'
   92     1        NEW                                              $1      'ArrComp'
          2        SEND_VAL_EX                                              'pk'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   93     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class NodeInterface:
Function addnode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  addNode
number of ops:  2
compiled vars:  !0 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function addnode

Function isleaf:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  isLeaf
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   null

End of function isleaf

Function isnode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  isNode
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   null

End of function isnode

Function getkey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  getKey
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   null

End of function getkey

Function setkey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  setKey
number of ops:  2
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function setkey

Function getvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  getValue
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   null

End of function getvalue

Function setvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  setValue
number of ops:  2
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function setvalue

Function getuid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  getUid
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E > > RETURN                                                   null

End of function getuid

Function uid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  uid
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   null

End of function uid

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

End of function key

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

End of function value

End of class NodeInterface.

Class ArrComp:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  __construct
number of ops:  42
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      null
   26     2        INIT_FCALL                                               'rand'
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 9
          5        DO_ICALL                                         $3      
          6        INIT_FCALL                                               'md5'
          7        INIT_FCALL                                               'rand'
          8        SEND_VAL                                                 10
          9        SEND_VAL                                                 99
         10        DO_ICALL                                         $4      
         11        INIT_FCALL                                               'time'
         12        DO_ICALL                                         $5      
         13        CONCAT                                           ~6      $4, $5
         14        INIT_FCALL                                               'rand'
         15        SEND_VAL                                                 100
         16        SEND_VAL                                                 999
         17        DO_ICALL                                         $7      
         18        CONCAT                                           ~8      ~6, $7
         19        SEND_VAL                                                 ~8
         20        DO_ICALL                                         $9      
         21        CONCAT                                           ~10     $3, $9
         22        INIT_FCALL                                               'rand'
         23        SEND_VAL                                                 1000
         24        SEND_VAL                                                 9999
         25        DO_ICALL                                         $11     
         26        CONCAT                                           ~12     ~10, $11
         27        ASSIGN_OBJ                                               'uid'
         28        OP_DATA                                                  ~12
   27    29        NEW                                              $14     'stdClass'
         30        DO_FCALL                                      0          
         31        ASSIGN_OBJ                                               'value'
         32        OP_DATA                                                  $14
   28    33        FETCH_OBJ_W                                      $16     'value'
         34        ASSIGN_OBJ                                               $16, 'key'
         35        OP_DATA                                                  !0
   29    36        FETCH_OBJ_W                                      $18     'value'
         37        ASSIGN_OBJ                                               $18, 'val'
         38        OP_DATA                                                  !1
   30    39        ASSIGN_OBJ                                               'nodes'
         40        OP_DATA                                                  <array>
   31    41      > RETURN                                                   null

End of function __construct

Function addnode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  addNode
number of ops:  7
compiled vars:  !0 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   RECV                                             !0      
   35     1        FETCH_OBJ_W                                      $1      'nodes'
          2        ASSIGN_DIM                                               $1
          3        OP_DATA                                                  !0
   36     4        FETCH_THIS                                       ~3      
          5      > RETURN                                                   ~3
   37     6*     > RETURN                                                   null

End of function addnode

Function isleaf:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  isLeaf
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   FETCH_OBJ_R                                      ~0      'nodes'
          1        COUNT                                            ~1      ~0
          2        IS_EQUAL                                         ~2      ~1, 0
          3      > RETURN                                                   ~2
   42     4*     > RETURN                                                   null

End of function isleaf

Function isnode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  isNode
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   46     0  E >   FETCH_OBJ_R                                      ~0      'nodes'
          1        COUNT                                            ~1      ~0
          2        IS_SMALLER                                       ~2      0, ~1
          3      > RETURN                                                   ~2
   47     4*     > RETURN                                                   null

End of function isnode

Function getkey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  getKey
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   51     0  E >   FETCH_OBJ_R                                      ~0      'value'
          1        FETCH_OBJ_R                                      ~1      ~0, 'key'
          2      > RETURN                                                   ~1
   52     3*     > RETURN                                                   null

End of function getkey

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

End of function key

Function setkey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  setKey
number of ops:  7
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   59     0  E >   RECV_INIT                                        !0      null
   61     1        FETCH_OBJ_W                                      $1      'value'
          2        ASSIGN_OBJ                                               $1, 'key'
          3        OP_DATA                                                  !0
   62     4        FETCH_THIS                                       ~3      
          5      > RETURN                                                   ~3
   63     6*     > RETURN                                                   null

End of function setkey

Function getvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  getValue
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   67     0  E >   FETCH_OBJ_R                                      ~0      'value'
          1        FETCH_OBJ_R                                      ~1      ~0, 'val'
          2      > RETURN                                                   ~1
   68     3*     > RETURN                                                   null

End of function getvalue

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

End of function value

Function setvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hRIZ
function name:  setValue
number of ops:  7
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   75     0  E >   RECV_INIT                                        !0      null
   77     1        FETCH_OBJ_W                                      $1      'value'
          2        ASSIGN_OBJ                                               $1, 'val'
          3        OP_DATA                                                  !0
   78     4        FETCH_THIS                                       ~3      
          5      > RETURN                                                   ~3
   79     6*     > RETURN                                                   null

End of function setvalue

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

End of function getuid

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

End of function uid

End of class ArrComp.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.98 ms | 1412 KiB | 21 Q