3v4l.org

run code in 300+ PHP versions simultaneously
<?php $y = '<extData> <Airpoints> <APCurrency>NZD</APCurrency> </Airpoints> <orderData> <order><orderId>3</orderId><orderTime>2014-10-23T02:51:48</orderTime><item><sku>130</sku><title>Chicken Sandwich</title><quantity>1</quantity><price>10.00</price><amount>10.00</amount></item><subtotal>10.00</subtotal><fee>0.00</fee><total>10.00</total><orderStatus>COMP</orderStatus></order><schema_version>2</schema_version> </orderData> </extData>>2014-A'; $x = '<extData> <orderData> <order><orderId>6</orderId><orderTime>2014-10-23T02:53:38</orderTime><item><sku>138</sku><title>Beef Pie</title><quantity>1</quantity><price>8.00</price><amount>8.00</amount></item><item><sku>138</sku><title>Beef Pie</title><quantity>-1</quantity><price>8.00</price><amount>-8.00</amount></item><subtotal>0.00</subtotal><fee>0.00</fee><total>0.00</total><orderStatus>COMP</orderStatus></order><schema_version>2</schema_version> </orderData> </extData><price>±'; if(preg_match('/<extData>(.*)<\/extData>/s',$y, $matches)) { $xml = simplexml_load_string($matches[0]); $code = $xml->xpath('//APCurrency'); var_dump($code); } //var_dump($matches);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 20
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/6KUDS
function name:  (null)
number of ops:  21
compiled vars:  !0 = $y, !1 = $x, !2 = $matches, !3 = $xml, !4 = $code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3CextData%3E%0A+++++%3CAirpoints%3E%0A+++++++%3CAPCurrency%3ENZD%3C%2FAPCurrency%3E%0A+++++%3C%2FAirpoints%3E%0A+++++%3CorderData%3E%0A+++++++%3Corder%3E%3CorderId%3E3%3C%2ForderId%3E%3CorderTime%3E2014-10-23T02%3A51%3A48%3C%2ForderTime%3E%3Citem%3E%3Csku%3E130%3C%2Fsku%3E%3Ctitle%3EChicken+Sandwich%3C%2Ftitle%3E%3Cquantity%3E1%3C%2Fquantity%3E%3Cprice%3E10.00%3C%2Fprice%3E%3Camount%3E10.00%3C%2Famount%3E%3C%2Fitem%3E%3Csubtotal%3E10.00%3C%2Fsubtotal%3E%3Cfee%3E0.00%3C%2Ffee%3E%3Ctotal%3E10.00%3C%2Ftotal%3E%3CorderStatus%3ECOMP%3C%2ForderStatus%3E%3C%2Forder%3E%3Cschema_version%3E2%3C%2Fschema_version%3E%0A+++++%3C%2ForderData%3E%0A+++%3C%2FextData%3E%3E2014-A'
   10     1        ASSIGN                                                   !1, '%3CextData%3E%0A+++++%3CorderData%3E%0A+++++++%3Corder%3E%3CorderId%3E6%3C%2ForderId%3E%3CorderTime%3E2014-10-23T02%3A53%3A38%3C%2ForderTime%3E%3Citem%3E%3Csku%3E138%3C%2Fsku%3E%3Ctitle%3EBeef+Pie%3C%2Ftitle%3E%3Cquantity%3E1%3C%2Fquantity%3E%3Cprice%3E8.00%3C%2Fprice%3E%3Camount%3E8.00%3C%2Famount%3E%3C%2Fitem%3E%3Citem%3E%3Csku%3E138%3C%2Fsku%3E%3Ctitle%3EBeef+Pie%3C%2Ftitle%3E%3Cquantity%3E-1%3C%2Fquantity%3E%3Cprice%3E8.00%3C%2Fprice%3E%3Camount%3E-8.00%3C%2Famount%3E%3C%2Fitem%3E%3Csubtotal%3E0.00%3C%2Fsubtotal%3E%3Cfee%3E0.00%3C%2Ffee%3E%3Ctotal%3E0.00%3C%2Ftotal%3E%3CorderStatus%3ECOMP%3C%2ForderStatus%3E%3C%2Forder%3E%3Cschema_version%3E2%3C%2Fschema_version%3E%0A+++++%3C%2ForderData%3E%0A+++%3C%2FextData%3E%3Cprice%3E%C2%B1'
   16     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAL                                                 '%2F%3CextData%3E%28.%2A%29%3C%5C%2FextData%3E%2Fs'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                         $7      
          7      > JMPZ                                                     $7, ->20
   17     8    >   INIT_FCALL                                               'simplexml_load_string'
          9        FETCH_DIM_R                                      ~8      !2, 0
         10        SEND_VAL                                                 ~8
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !3, $9
   18    13        INIT_METHOD_CALL                                         !3, 'xpath'
         14        SEND_VAL_EX                                              '%2F%2FAPCurrency'
         15        DO_FCALL                                      0  $11     
         16        ASSIGN                                                   !4, $11
   19    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !4
         19        DO_ICALL                                                 
   21    20    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.97 ms | 1396 KiB | 19 Q