3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <store name="adamos_rihardos"> <date>2017-12-16 13:47:59</date> <products> <product> <id>3</id> <name><![CDATA[ΜΙΚΡΟΦΩΝΟ SAMSON G-TRACK]]></name> <manufacturer><![CDATA[SAMSON]]></manufacturer> <sku><![CDATA[550.SAM.060]]></sku> <description_greek><![CDATA[Samson G-Track - large diaphragm USB studio condenser microphone (USB bus-powered), built-in audio interface and mixer, allows simultaneous input of vocals and guitar, bass, or keyboard while also providing monitoring through an on-board headphone output. Specifications: mic and instrument/line gain control with clip LED, stereo input jacks for (3.5mm stereo-jack) instrument or line level signal, stereo headphone jack for zero latency monitoring with level control, 3-position headphone switch for stereo, mono and computer monitoring. USB bus-powered. Includes desktop microphone stand, audio I/O cables, USB cables and Cakewalk Sonar LE software. Optional shockmount available.]]></description_greek> <short_description_greek><![CDATA[Samson G-Track - large diaphragm USB studio condenser microphone (USB bus-powered)]]></short_description_greek> <price>155.00</price> <msrp>185.00</msrp> <instock>no</instock> <images total="2"> <image_1>http://test.com/media/catalog/product/5/5/550.sam.060-mi- 01.jpg</image_1> <image_2>http://test.com/media/catalog/product/5/5/550.sam.060-mi- 02.jpg</image_2> </images> </product> <product> <id>3</id> <name><![CDATA[ΜΙΚΡΟΦΩΝΟ SAMSON G-TRACK]]></name> <manufacturer><![CDATA[SAMSON]]></manufacturer> <sku><![CDATA[550.SAM.060]]></sku> <description_greek><![CDATA[Samson G-Track - large diaphragm USB studio condenser microphone (USB bus-powered), built-in audio interface and mixer, allows simultaneous input of vocals and guitar, bass, or keyboard while also providing monitoring through an on-board headphone output. Specifications: mic and instrument/line gain control with clip LED, stereo input jacks for (3.5mm stereo-jack) instrument or line level signal, stereo headphone jack for zero latency monitoring with level control, 3-position headphone switch for stereo, mono and computer monitoring. USB bus-powered. Includes desktop microphone stand, audio I/O cables, USB cables and Cakewalk Sonar LE software. Optional shockmount available.]]></description_greek> <short_description_greek><![CDATA[Samson G-Track - large diaphragm USB studio condenser microphone (USB bus-powered)]]></short_description_greek> <price>155.00</price> <msrp>185.00</msrp> <instock>no</instock> <images total="2"> <image_1>http://test.com/media/catalog/product/5/5/550.sam.060-mi- 01.jpg</image_1> <image_2>http://test.com/media/catalog/product/5/5/550.sam.060-mi- 02.jpg</image_2> </images> </product> </products> </store>'; $products = simplexml_load_string($xml); foreach( $products->xpath("*/product") as $p ) { $p->addChild("newsku", "NEW".$p->sku); } echo $products->asXML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/U8EbE
function name:  (null)
number of ops:  22
compiled vars:  !0 = $xml, !1 = $products, !2 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3Cstore+name%3D%22adamos_rihardos%22%3E%0A++++%3Cdate%3E2017-12-16+13%3A47%3A59%3C%2Fdate%3E%0A++++%3Cproducts%3E%0A+++++++%3Cproduct%3E%0A++++++++++%3Cid%3E3%3C%2Fid%3E%0A++++++++++%3Cname%3E%3C%21%5BCDATA%5B%CE%9C%CE%99%CE%9A%CE%A1%CE%9F%CE%A6%CE%A9%CE%9D%CE%9F+SAMSON+G-TRACK%5D%5D%3E%3C%2Fname%3E%0A++++++++++%3Cmanufacturer%3E%3C%21%5BCDATA%5BSAMSON%5D%5D%3E%3C%2Fmanufacturer%3E%0A++++++++++%3Csku%3E%3C%21%5BCDATA%5B550.SAM.060%5D%5D%3E%3C%2Fsku%3E%0A++++++++++%3Cdescription_greek%3E%3C%21%5BCDATA%5BSamson+G-Track+-+large+diaphragm+USB+studio+%0A++++condenser+microphone+%28USB+bus-powered%29%2C+built-in+audio+interface+and+mixer%2C+%0A++++allows+simultaneous+input+of+vocals+and+guitar%2C+bass%2C+or+keyboard+while+also+%0A++++providing+monitoring+through+an+on-board+headphone+output.+Specifications%3A+mic+%0A++++and+instrument%2Fline+gain+control+with+clip+LED%2C+stereo+input+jacks+for+%283.5mm+%0A++++stereo-jack%29+instrument+or+line+level+signal%2C+stereo+headphone+jack+for+zero+%0A++++latency+monitoring+with+level+control%2C+3-position+headphone+switch+for+stereo%2C+%0A++++mono+and+computer+monitoring.+USB+bus-powered.+Includes+desktop+microphone+%0A++++stand%2C+audio+I%2FO+cables%2C+USB+cables+and+Cakewalk+Sonar+LE+software.+Optional+%0A++++shockmount+available.%5D%5D%3E%3C%2Fdescription_greek%3E%0A++++++++++%3Cshort_description_greek%3E%3C%21%5BCDATA%5BSamson+G-Track+-+large+diaphragm+USB+studio+%0A++++condenser+microphone+%28USB+bus-powered%29%5D%5D%3E%3C%2Fshort_description_greek%3E%0A++++++++++%3Cprice%3E155.00%3C%2Fprice%3E%0A++++++++++%3Cmsrp%3E185.00%3C%2Fmsrp%3E%0A++++++++++%3Cinstock%3Eno%3C%2Finstock%3E%0A++++++++++%3Cimages+total%3D%222%22%3E%0A+++++++++++++%3Cimage_1%3Ehttp%3A%2F%2Ftest.com%2Fmedia%2Fcatalog%2Fproduct%2F5%2F5%2F550.sam.060-mi-%0A++++01.jpg%3C%2Fimage_1%3E%0A+++++++++++++%3Cimage_2%3Ehttp%3A%2F%2Ftest.com%2Fmedia%2Fcatalog%2Fproduct%2F5%2F5%2F550.sam.060-mi-%0A++++02.jpg%3C%2Fimage_2%3E%0A++++++++++%3C%2Fimages%3E%0A+++++++%3C%2Fproduct%3E%0A++++++++++%3Cproduct%3E%0A++++++++++%3Cid%3E3%3C%2Fid%3E%0A++++++++++%3Cname%3E%3C%21%5BCDATA%5B%CE%9C%CE%99%CE%9A%CE%A1%CE%9F%CE%A6%CE%A9%CE%9D%CE%9F+SAMSON+G-TRACK%5D%5D%3E%3C%2Fname%3E%0A++++++++++%3Cmanufacturer%3E%3C%21%5BCDATA%5BSAMSON%5D%5D%3E%3C%2Fmanufacturer%3E%0A++++++++++%3Csku%3E%3C%21%5BCDATA%5B550.SAM.060%5D%5D%3E%3C%2Fsku%3E%0A++++++++++%3Cdescription_greek%3E%3C%21%5BCDATA%5BSamson+G-Track+-+large+diaphragm+USB+studio+%0A++++condenser+microphone+%28USB+bus-powered%29%2C+built-in+audio+interface+and+mixer%2C+%0A++++allows+simultaneous+input+of+vocals+and+guitar%2C+bass%2C+or+keyboard+while+also+%0A++++providing+monitoring+through+an+on-board+headphone+output.+Specifications%3A+mic+%0A++++and+instrument%2Fline+gain+control+with+clip+LED%2C+stereo+input+jacks+for+%283.5mm+%0A++++stereo-jack%29+instrument+or+line+level+signal%2C+stereo+headphone+jack+for+zero+%0A++++latency+monitoring+with+level+control%2C+3-position+headphone+switch+for+stereo%2C+%0A++++mono+and+computer+monitoring.+USB+bus-powered.+Includes+desktop+microphone+%0A++++stand%2C+audio+I%2FO+cables%2C+USB+cables+and+Cakewalk+Sonar+LE+software.+Optional+%0A++++shockmount+available.%5D%5D%3E%3C%2Fdescription_greek%3E%0A++++++++++%3Cshort_description_greek%3E%3C%21%5BCDATA%5BSamson+G-Track+-+large+diaphragm+USB+studio+%0A++++condenser+microphone+%28USB+bus-powered%29%5D%5D%3E%3C%2Fshort_description_greek%3E%0A++++++++++%3Cprice%3E155.00%3C%2Fprice%3E%0A++++++++++%3Cmsrp%3E185.00%3C%2Fmsrp%3E%0A++++++++++%3Cinstock%3Eno%3C%2Finstock%3E%0A++++++++++%3Cimages+total%3D%222%22%3E%0A+++++++++++++%3Cimage_1%3Ehttp%3A%2F%2Ftest.com%2Fmedia%2Fcatalog%2Fproduct%2F5%2F5%2F550.sam.060-mi-%0A++++01.jpg%3C%2Fimage_1%3E%0A+++++++++++++%3Cimage_2%3Ehttp%3A%2F%2Ftest.com%2Fmedia%2Fcatalog%2Fproduct%2F5%2F5%2F550.sam.060-mi-%0A++++02.jpg%3C%2Fimage_2%3E%0A++++++++++%3C%2Fimages%3E%0A+++++++%3C%2Fproduct%3E%0A++++%3C%2Fproducts%3E%0A%3C%2Fstore%3E'
   64     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
   66     5        INIT_METHOD_CALL                                         !1, 'xpath'
          6        SEND_VAL_EX                                              '%2A%2Fproduct'
          7        DO_FCALL                                      0  $6      
          8      > FE_RESET_R                                       $7      $6, ->17
          9    > > FE_FETCH_R                                               $7, !2, ->17
   67    10    >   INIT_METHOD_CALL                                         !2, 'addChild'
         11        SEND_VAL_EX                                              'newsku'
         12        FETCH_OBJ_R                                      ~8      !2, 'sku'
         13        CONCAT                                           ~9      'NEW', ~8
         14        SEND_VAL_EX                                              ~9
         15        DO_FCALL                                      0          
   66    16      > JMP                                                      ->9
         17    >   FE_FREE                                                  $7
   70    18        INIT_METHOD_CALL                                         !1, 'asXML'
         19        DO_FCALL                                      0  $11     
         20        ECHO                                                     $11
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.09 ms | 1003 KiB | 14 Q