3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testclass{ var $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 = $doc->documentElement->childNodes; foreach($children as $child) { if($child->nodeType != XML_ELEMENT_NODE) continue; echo $child->nodeName; } } } $newxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <c:tellervo xmlns:c=\"http://www.tellervo.org/schema/1.0\" xmlns:gml=\"http://www.opengis.net/gml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:tridas=\"http://www.tridas.org/1.2.2\"> <c:request type=\"create\"> <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> </c:request> </c:tellervo>"; $myParamObj = new testclass($newxml);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SJiLC
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, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3Cc%3Atellervo+xmlns%3Ac%3D%22http%3A%2F%2Fwww.tellervo.org%2Fschema%2F1.0%22+xmlns%3Agml%3D%22http%3A%2F%2Fwww.opengis.net%2Fgml%22+xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22+xmlns%3Atridas%3D%22http%3A%2F%2Fwww.tridas.org%2F1.2.2%22%3E%0A++%3Cc%3Arequest+type%3D%22create%22%3E%0A++++%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%0A++%3C%2Fc%3Arequest%3E%0A%3C%2Fc%3Atellervo%3E'
   49     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/SJiLC
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 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/SJiLC
function name:  setParamsFromXMLRequest
number of ops:  14
compiled vars:  !0 = $children, !1 = $doc, !2 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~3      !1, 'documentElement'
          1        FETCH_OBJ_R                                      ~4      ~3, 'childNodes'
          2        ASSIGN                                                   !0, ~4
   27     3      > FE_RESET_R                                       $6      !0, ->12
          4    > > FE_FETCH_R                                               $6, !2, ->12
   29     5    >   FETCH_OBJ_R                                      ~7      !2, 'nodeType'
          6        IS_NOT_EQUAL                                             ~7, 1
          7      > JMPZ                                                     ~8, ->9
          8    > > JMP                                                      ->4
   31     9    >   FETCH_OBJ_R                                      ~9      !2, 'nodeName'
         10        ECHO                                                     ~9
   27    11      > JMP                                                      ->4
         12    >   FE_FREE                                                  $6
   34    13      > RETURN                                                   null

End of function setparamsfromxmlrequest

End of class testclass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.7 ms | 1399 KiB | 13 Q