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 = new SimpleXMLElement($matches[0]); $code = $xml->xpath('//APCurrency'); echo (string)$code[0]; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 21
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/8GQQB
function name:  (null)
number of ops:  22
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, ->21
   17     8    >   NEW                                              $8      'SimpleXMLElement'
          9        CHECK_FUNC_ARG                                           
         10        FETCH_DIM_FUNC_ARG                               $9      !2, 0
         11        SEND_FUNC_ARG                                            $9
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !3, $8
   18    14        INIT_METHOD_CALL                                         !3, 'xpath'
         15        SEND_VAL_EX                                              '%2F%2FAPCurrency'
         16        DO_FCALL                                      0  $12     
         17        ASSIGN                                                   !4, $12
   19    18        FETCH_DIM_R                                      ~14     !4, 0
         19        CAST                                          6  ~15     ~14
         20        ECHO                                                     ~15
   21    21    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.46 ms | 1396 KiB | 15 Q