3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface NodeInterface { public function addNode(Node $node); public function hasNodes(); public function getKey(); public function setKey($key); public function getNodes(); public function nodes(); public function getUid(); public function uid(); public function key(); } interface LeafInterface extends NodeInterface { public function getValue(); public function value(); } abstract class AbstractNode implements NodeInterface { protected $uid; protected $nodes; protected $key; public function __construct($key) { $this->uid = rand(0, 9) . md5(rand(10, 99) . time() . rand(100, 999)) . rand(1000, 9999); $this->key = $key; $this->nodes = []; } public function getKey() { return $this->value->key; } public function key() { return $this->value->key; } public function setKey($key) { $this->value->key = $key; return $this; } public function getUid() { return $this->uid; } public function uid() { return $this->uid; } } class ArrNode extends AbstractNode { public function addNode(Node $node) { $this->nodes[] = $node; return $this; } public function hasNodes() { return count($this->nodes) > 0; } public function getNodes() { return $this->nodes; } public function nodes() { return $this->nodes; } } class ArrLeaf extends AbstractNode implements LeafInterface { protected $value; public function __construct($key, $value) { parent::__construct($key); $this->value = $value; } public function addNode(Node $node) { return false; } public function hasNodes() { return false; } public function getNodes() { return false; } public function nodes() { return false; } public function getValue() { return $this->value; } public function value() { return $this->value; } } $pk = new ArrNode('pk'); $pkAttrs = new ArrNode('@attributes'); $pkAttrs->addNode(new ArrLeaf('excl', 'web_actions')); $pkAttrs->addNode(new ArrLeaf('system', 'depWEBsys')); $pkAttrs->addNode(new ArrLeaf('id', 'packet20130905133323986')); $comp->addNode($pkAttrs); var_dump($comp);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KHO46
function name:  (null)
number of ops:  40
compiled vars:  !0 = $pk, !1 = $pkAttrs, !2 = $comp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   DECLARE_CLASS                                            'leafinterface'
   22     1        DECLARE_CLASS                                            'abstractnode'
   62     2        DECLARE_CLASS                                            'arrnode', 'abstractnode'
   86     3        DECLARE_CLASS                                            'arrleaf', 'abstractnode'
  127     4        NEW                                              $3      'ArrNode'
          5        SEND_VAL_EX                                              'pk'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $3
  129     8        NEW                                              $6      'ArrNode'
          9        SEND_VAL_EX                                              '%40attributes'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $6
  130    12        INIT_METHOD_CALL                                         !1, 'addNode'
         13        NEW                                              $9      'ArrLeaf'
         14        SEND_VAL_EX                                              'excl'
         15        SEND_VAL_EX                                              'web_actions'
         16        DO_FCALL                                      0          
         17        SEND_VAR_NO_REF_EX                                       $9
         18        DO_FCALL                                      0          
  131    19        INIT_METHOD_CALL                                         !1, 'addNode'
         20        NEW                                              $12     'ArrLeaf'
         21        SEND_VAL_EX                                              'system'
         22        SEND_VAL_EX                                              'depWEBsys'
         23        DO_FCALL                                      0          
         24        SEND_VAR_NO_REF_EX                                       $12
         25        DO_FCALL                                      0          
  132    26        INIT_METHOD_CALL                                         !1, 'addNode'
         27        NEW                                              $15     'ArrLeaf'
         28        SEND_VAL_EX                                              'id'
         29        SEND_VAL_EX                                              'packet20130905133323986'
         30        DO_FCALL                                      0          
         31        SEND_VAR_NO_REF_EX                                       $15
         32        DO_FCALL                                      0          
  134    33        INIT_METHOD_CALL                                         !2, 'addNode'
         34        SEND_VAR_EX                                              !1
         35        DO_FCALL                                      0          
  135    36        INIT_FCALL                                               'var_dump'
         37        SEND_VAR                                                 !2
         38        DO_ICALL                                                 
         39      > RETURN                                                   1

Class NodeInterface:
Function addnode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KHO46
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 hasnodes:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KHO46
function name:  hasNodes
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   null

End of function hasnodes

Function getkey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KHO46
function name:  getKey
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     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/KHO46
function name:  setKey
number of ops:  2
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function setkey

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

End of function getnodes

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

End of function nodes

Function getuid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KHO46
function name:  getUid
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     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/KHO46
function name:  uid
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     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/KHO46
function name:  key
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   null

End of function key

End of class NodeInterface.

Class LeafInterface:
Function getvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KHO46
function name:  getValue
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E > > 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/KHO46
function name:  value
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E > > RETURN                                                   null

End of function value

End of class LeafInterface.

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

End of function __construct

Function getkey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KHO46
function name:  getKey
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   FETCH_OBJ_R                                      ~0      'value'
          1        FETCH_OBJ_R                                      ~1      ~0, 'key'
          2      > RETURN                                                   ~1
   38     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/KHO46
function name:  key
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   FETCH_OBJ_R                                      ~0      'value'
          1        FETCH_OBJ_R                                      ~1      ~0, 'key'
          2      > RETURN                                                   ~1
   43     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/KHO46
function name:  setKey
number of ops:  7
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   45     0  E >   RECV                                             !0      
   47     1        FETCH_OBJ_W                                      $1      'value'
          2        ASSIGN_OBJ                                               $1, 'key'
          3        OP_DATA                                                  !0
   48     4        FETCH_THIS                                       ~3      
          5      > RETURN                                                   ~3
   49     6*     > RETURN                                                   null

End of function setkey

Function getuid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KHO46
function name:  getUid
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   53     0  E >   FETCH_OBJ_R                                      ~0      'uid'
          1      > RETURN                                                   ~0
   54     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/KHO46
function name:  uid
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   58     0  E >   FETCH_OBJ_R                                      ~0      'uid'
          1      > RETURN                                                   ~0
   59     2*     > RETURN                                                   null

End of function uid

End of class AbstractNode.

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

End of function addnode

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

End of function hasnodes

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

End of function getnodes

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

End of function nodes

End of class ArrNode.

Class ArrLeaf:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KHO46
function name:  __construct
number of ops:  8
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   90     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   92     2        INIT_STATIC_METHOD_CALL                                  
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
   93     5        ASSIGN_OBJ                                               'value'
          6        OP_DATA                                                  !1
   94     7      > 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/KHO46
function name:  addNode
number of ops:  3
compiled vars:  !0 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   96     0  E >   RECV                                             !0      
   98     1      > RETURN                                                   <false>
   99     2*     > RETURN                                                   null

End of function addnode

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

End of function hasnodes

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

End of function getnodes

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

End of function nodes

Function getvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KHO46
function name:  getValue
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  118     0  E >   FETCH_OBJ_R                                      ~0      'value'
          1      > RETURN                                                   ~0
  119     2*     > 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/KHO46
function name:  value
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  123     0  E >   FETCH_OBJ_R                                      ~0      'value'
          1      > RETURN                                                   ~0
  124     2*     > RETURN                                                   null

End of function value

End of class ArrLeaf.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.25 ms | 1408 KiB | 21 Q