3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testclass{ public $xmlRequestDom = NULL; function __construct($xmlrequest) { if (gettype($xmlrequest)=='object') { $this->xmlRequestDom = $xmlrequest; } else { $this->xmlRequestDom = new DomDocument(); $this->xmlRequestDom->loadXML($xmlrequest); } $this->setParamsFromXMLRequest(); } function setParamsFromXMLRequest() { $children = $this->xmlRequestDom->documentElement->childNodes; foreach($children as $child) { if($child->nodeType != XML_ELEMENT_NODE) continue; echo $child->nodeName; } } } $newxml = "<tridas:object> <tridas:title>ppp</tridas:title> <tridas:type normalStd=\"Tellervo\" normalId=\"1\" normal=\"Site\" /> <tridas:genericField name=\"tellervo.objectLabCode\">ppp</tridas:genericField> </tridas:object>"; $myParamObj = new testclass($newxml);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iXKkb
function name:  (null)
number of ops:  6
compiled vars:  !0 = $newxml, !1 = $myParamObj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   ASSIGN                                                   !0, '%3Ctridas%3Aobject%3E%0A++++++%3Ctridas%3Atitle%3Eppp%3C%2Ftridas%3Atitle%3E%0A++++++%3Ctridas%3Atype+normalStd%3D%22Tellervo%22+normalId%3D%221%22+normal%3D%22Site%22+%2F%3E%0A++++++%3Ctridas%3AgenericField+name%3D%22tellervo.objectLabCode%22%3Eppp%3C%2Ftridas%3AgenericField%3E%0A++++%3C%2Ftridas%3Aobject%3E'
   44     1        NEW                                              $3      'testclass'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
          5      > RETURN                                                   1

Class testclass:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iXKkb
function name:  __construct
number of ops:  18
compiled vars:  !0 = $xmlrequest
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        GET_TYPE                                         ~1      !0
          2        IS_EQUAL                                                 ~1, 'object'
          3      > JMPZ                                                     ~2, ->7
   10     4    >   ASSIGN_OBJ                                               'xmlRequestDom'
          5        OP_DATA                                                  !0
          6      > JMP                                                      ->15
   14     7    >   NEW                                              $5      'DomDocument'
          8        DO_FCALL                                      0          
          9        ASSIGN_OBJ                                               'xmlRequestDom'
         10        OP_DATA                                                  $5
   15    11        FETCH_OBJ_R                                      ~7      'xmlRequestDom'
         12        INIT_METHOD_CALL                                         ~7, 'loadXML'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0          
   18    15    >   INIT_METHOD_CALL                                         'setParamsFromXMLRequest'
         16        DO_FCALL                                      0          
   20    17      > RETURN                                                   null

End of function __construct

Function setparamsfromxmlrequest:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/iXKkb
function name:  setParamsFromXMLRequest
number of ops:  15
compiled vars:  !0 = $children, !1 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~2      'xmlRequestDom'
          1        FETCH_OBJ_R                                      ~3      ~2, 'documentElement'
          2        FETCH_OBJ_R                                      ~4      ~3, 'childNodes'
          3        ASSIGN                                                   !0, ~4
   27     4      > FE_RESET_R                                       $6      !0, ->13
          5    > > FE_FETCH_R                                               $6, !1, ->13
   29     6    >   FETCH_OBJ_R                                      ~7      !1, 'nodeType'
          7        IS_NOT_EQUAL                                             ~7, 1
          8      > JMPZ                                                     ~8, ->10
          9    > > JMP                                                      ->5
   31    10    >   FETCH_OBJ_R                                      ~9      !1, 'nodeName'
         11        ECHO                                                     ~9
   27    12      > JMP                                                      ->5
         13    >   FE_FREE                                                  $6
   34    14      > RETURN                                                   null

End of function setparamsfromxmlrequest

End of class testclass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.86 ms | 1399 KiB | 13 Q