3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting (E_ALL ^ E_NOTICE); ini_set('display_errors',true); $xml = <<<XML <?xml version="1.0" encoding="UTF-8"?> <Whirlpool xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <PricingInfoResults> <RequestResults> <RequestDate>1/5/2017</RequestDate> <RequestTime>8:35 AM</RequestTime> <ReturnInfo> <ReturnInfoCode>1000</ReturnInfoCode> <ReturnInfoDesc>Promo code found</ReturnInfoDesc> </ReturnInfo> </RequestResults> <PricingInfo> <ProductDesc>Icemaker</ProductDesc> <CampaignCode>WRLPIO1612</CampaignCode> <CMICode>WR1612WEB</CMICode> <MCMCode>WHIRLPOOLWBOX</MCMCode> <RowId>1309467.00</RowId> <Term> <TermDesc>1 Year</TermDesc> <PaymentOption> <OptionDesc>Full Pay</OptionDesc> <Price>94.95</Price> <ProductIndicator>WD</ProductIndicator> </PaymentOption> </Term> <Term> <TermDesc>3 Year</TermDesc> <PaymentOption> <OptionDesc>Full Pay</OptionDesc> <Price>244.95</Price> <ProductIndicator>WE</ProductIndicator> </PaymentOption> </Term> </PricingInfo> </PricingInfoResults> </Whirlpool> XML; $simpleXML = simplexml_load_string($xml); $xpathText = '/Term/TermDesc'; $parent = (string)$simpleXML->PricingInfoResults->PricingInfo->Term->xpath($xpathText)[0]; echo '<pre>Parent';$parent;echo '</pre>'; ;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RKKbI
function name:  (null)
number of ops:  25
compiled vars:  !0 = $xml, !1 = $simpleXML, !2 = $xpathText, !3 = $parent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32759
          2        DO_ICALL                                                 
    3     3        INIT_FCALL                                               'ini_set'
          4        SEND_VAL                                                 'display_errors'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                                 
    4     7        ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3CWhirlpool+xmlns%3Axsd%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%22+xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance%22%3E%0A+++%3CPricingInfoResults%3E%0A++++++%3CRequestResults%3E%0A+++++++++%3CRequestDate%3E1%2F5%2F2017%3C%2FRequestDate%3E%0A+++++++++%3CRequestTime%3E8%3A35+AM%3C%2FRequestTime%3E%0A+++++++++%3CReturnInfo%3E%0A++++++++++++%3CReturnInfoCode%3E1000%3C%2FReturnInfoCode%3E%0A++++++++++++%3CReturnInfoDesc%3EPromo+code+found%3C%2FReturnInfoDesc%3E%0A+++++++++%3C%2FReturnInfo%3E%0A++++++%3C%2FRequestResults%3E%0A++++++%3CPricingInfo%3E%0A+++++++++%3CProductDesc%3EIcemaker%3C%2FProductDesc%3E%0A+++++++++%3CCampaignCode%3EWRLPIO1612%3C%2FCampaignCode%3E%0A+++++++++%3CCMICode%3EWR1612WEB%3C%2FCMICode%3E%0A+++++++++%3CMCMCode%3EWHIRLPOOLWBOX%3C%2FMCMCode%3E%0A+++++++++%3CRowId%3E1309467.00%3C%2FRowId%3E%0A+++++++++%3CTerm%3E%0A++++++++++++%3CTermDesc%3E1+Year%3C%2FTermDesc%3E%0A++++++++++++%3CPaymentOption%3E%0A+++++++++++++++%3COptionDesc%3EFull+Pay%3C%2FOptionDesc%3E%0A+++++++++++++++%3CPrice%3E94.95%3C%2FPrice%3E%0A+++++++++++++++%3CProductIndicator%3EWD%3C%2FProductIndicator%3E%0A++++++++++++%3C%2FPaymentOption%3E%0A+++++++++%3C%2FTerm%3E%0A+++++++++%3CTerm%3E%0A++++++++++++%3CTermDesc%3E3+Year%3C%2FTermDesc%3E%0A++++++++++++%3CPaymentOption%3E%0A+++++++++++++++%3COptionDesc%3EFull+Pay%3C%2FOptionDesc%3E%0A+++++++++++++++%3CPrice%3E244.95%3C%2FPrice%3E%0A+++++++++++++++%3CProductIndicator%3EWE%3C%2FProductIndicator%3E%0A++++++++++++%3C%2FPaymentOption%3E%0A+++++++++%3C%2FTerm%3E%0A++++++%3C%2FPricingInfo%3E%0A+++%3C%2FPricingInfoResults%3E%0A%3C%2FWhirlpool%3E'
   43     8        INIT_FCALL                                               'simplexml_load_string'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !1, $7
   45    12        ASSIGN                                                   !2, '%2FTerm%2FTermDesc'
   47    13        FETCH_OBJ_R                                      ~10     !1, 'PricingInfoResults'
         14        FETCH_OBJ_R                                      ~11     ~10, 'PricingInfo'
         15        FETCH_OBJ_R                                      ~12     ~11, 'Term'
         16        INIT_METHOD_CALL                                         ~12, 'xpath'
         17        SEND_VAR_EX                                              !2
         18        DO_FCALL                                      0  $13     
         19        FETCH_DIM_R                                      ~14     $13, 0
         20        CAST                                          6  ~15     ~14
         21        ASSIGN                                                   !3, ~15
   48    22        ECHO                                                     '%3Cpre%3EParent'
         23        ECHO                                                     '%3C%2Fpre%3E'
   49    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
223.62 ms | 1400 KiB | 19 Q