3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml=simplexml_load_string(<<<XML <?xml version="1.0"?> <products><product><product_code>0084064919005</product_code><name>Spy Men's Hielo Sunglasses</name><stock>1</stock><regular_price>94.95</regular_price><sale_price>44.93</sale_price><brand>Spy Optic Inc </brand><gender/><category>Sunglasses</category><product_description>The Spy Men's Hielo Sunglasses are a classic hit maker. The frames are custom built out of high quality propionate, a lightweight durable material. An 8 base curve ARC lens gives you perfect clarity without distortion and gives you 100% UV protection.</product_description><buy_url>http://www.sunandski.com/ProductDetails.asp?ProductCode=0084064919005</buy_url><large_image_url>imgs/products/lrg/0084064919005.jpg</large_image_url><remote_image_url>http://www.sunandski.com/v/vspfiles/photos/0084064919005-2T.jpg</remote_image_url><small_image_url>http://www.sunandski.com/v/vspfiles/photos/0084064919005-1.jpg</small_image_url><size/><savings>53</savings></product><product><product_code>0084064919010</product_code><name>Spy Men's Hsx Sunglasses</name><stock>10</stock><regular_price>104.95</regular_price><sale_price>49.93</sale_price><brand>Spy Optic Inc </brand><gender/><category>Sunglasses</category><product_description>The Spy Men's Hsx Sunglasses is packed with all the features and style you expect from the Spy line of sunglasses. The frames are made out of ultra-lightweight and durable Grilamid. An 8x4-base toric arc lenses give you vision without distortion. These glasses are scratch and impact resistant so that they will be your favorite for a long time to come.</product_description><buy_url>http://www.sunandski.com/ProductDetails.asp?ProductCode=0084064919010</buy_url><large_image_url>imgs/products/lrg/0084064919010.jpg</large_image_url><remote_image_url>http://www.sunandski.com/v/vspfiles/photos/0084064919010-2T.jpg</remote_image_url><small_image_url>http://www.sunandski.com/v/vspfiles/photos/0084064919010-1.jpg</small_image_url><size/><savings>53</savings></product><product><product_code>0084064919011</product_code><name>Spy Men's Hsx Sunglasses</name><stock>6</stock><regular_price>149.95</regular_price><sale_price>69.93</sale_price><brand>Spy Optic Inc </brand><gender/><category>Sunglasses</category><product_description>The Spy Men's Hsx Sunglasses are made from lightweight durable Grilamid. It has 8x4 base Toric Arc Lenses give you superior vision without distortion. It offers 100% UV Protection to spare your eyes from the sun s harmful rays. Metal detailing give these glasses extra style.</product_description><buy_url>http://www.sunandski.com/ProductDetails.asp?ProductCode=0084064919011</buy_url><large_image_url>imgs/products/lrg/0084064919011.jpg</large_image_url><remote_image_url>http://www.sunandski.com/v/vspfiles/photos/0084064919011-2T.jpg</remote_image_url><small_image_url>http://www.sunandski.com/v/vspfiles/photos/0084064919011-1.jpg</small_image_url><size/><savings>54</savings></product> </products> XML ); $arr=array(); foreach($xml->product as $aTask) { $arr[]=$aTask; } //print_r($arr); usort($arr,function($a,$b){ return usort($a,$aTask->name); }); //print_r($arr); $xml=simplexml_load_string(<<<XML <?xml version="1.0"?> <products> </products> XML ); foreach($arr as $aTask) { $tTask=$xml->addChild($aTask->getName()); $tTask->addChild($aTask->date->getName(),(string)$aTask->name); $tTask->addChild($aTask->title->getName(),(string)$aTask->category); $tTask->addChild($aTask->description->getName(),(string)$aTask->product_description); } echo $xml->asXML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 57
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 57
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 57
Branch analysis from position: 11
filename:       /in/EvlJO
function name:  (null)
number of ops:  62
compiled vars:  !0 = $xml, !1 = $arr, !2 = $aTask, !3 = $tTask
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'simplexml_load_string'
    3     1        SEND_VAL                                                 '%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3Cproducts%3E%3Cproduct%3E%3Cproduct_code%3E0084064919005%3C%2Fproduct_code%3E%3Cname%3ESpy+Men%27s+Hielo+Sunglasses%3C%2Fname%3E%3Cstock%3E1%3C%2Fstock%3E%3Cregular_price%3E94.95%3C%2Fregular_price%3E%3Csale_price%3E44.93%3C%2Fsale_price%3E%3Cbrand%3ESpy+Optic+Inc++++%3C%2Fbrand%3E%3Cgender%2F%3E%3Ccategory%3ESunglasses%3C%2Fcategory%3E%3Cproduct_description%3EThe+Spy+Men%27s+Hielo+Sunglasses+are+a+classic+hit+maker.+The+frames+are+custom+built+out+of+high+quality+propionate%2C+a+lightweight+durable+material.+An+8+base+curve+ARC+lens+gives+you+perfect+clarity+without+distortion+and+gives+you+100%25+UV+protection.%3C%2Fproduct_description%3E%3Cbuy_url%3Ehttp%3A%2F%2Fwww.sunandski.com%2FProductDetails.asp%3FProductCode%3D0084064919005%3C%2Fbuy_url%3E%3Clarge_image_url%3Eimgs%2Fproducts%2Flrg%2F0084064919005.jpg%3C%2Flarge_image_url%3E%3Cremote_image_url%3Ehttp%3A%2F%2Fwww.sunandski.com%2Fv%2Fvspfiles%2Fphotos%2F0084064919005-2T.jpg%3C%2Fremote_image_url%3E%3Csmall_image_url%3Ehttp%3A%2F%2Fwww.sunandski.com%2Fv%2Fvspfiles%2Fphotos%2F0084064919005-1.jpg%3C%2Fsmall_image_url%3E%3Csize%2F%3E%3Csavings%3E53%3C%2Fsavings%3E%3C%2Fproduct%3E%3Cproduct%3E%3Cproduct_code%3E0084064919010%3C%2Fproduct_code%3E%3Cname%3ESpy+Men%27s+Hsx+Sunglasses%3C%2Fname%3E%3Cstock%3E10%3C%2Fstock%3E%3Cregular_price%3E104.95%3C%2Fregular_price%3E%3Csale_price%3E49.93%3C%2Fsale_price%3E%3Cbrand%3ESpy+Optic+Inc++++%3C%2Fbrand%3E%3Cgender%2F%3E%3Ccategory%3ESunglasses%3C%2Fcategory%3E%3Cproduct_description%3EThe+Spy+Men%27s+Hsx+Sunglasses+is+packed+with+all+the+features+and+style+you+expect+from+the+Spy+line+of+sunglasses.+The+frames+are+made+out+of+ultra-lightweight+and+durable+Grilamid.+An+8x4-base+toric+arc+++lenses+give+you+vision+without+distortion.+These+glasses+are+scratch+and+impact+resistant+so+that+they+will+be+your+favorite+for+a+long+time+to+come.%3C%2Fproduct_description%3E%3Cbuy_url%3Ehttp%3A%2F%2Fwww.sunandski.com%2FProductDetails.asp%3FProductCode%3D0084064919010%3C%2Fbuy_url%3E%3Clarge_image_url%3Eimgs%2Fproducts%2Flrg%2F0084064919010.jpg%3C%2Flarge_image_url%3E%3Cremote_image_url%3Ehttp%3A%2F%2Fwww.sunandski.com%2Fv%2Fvspfiles%2Fphotos%2F0084064919010-2T.jpg%3C%2Fremote_image_url%3E%3Csmall_image_url%3Ehttp%3A%2F%2Fwww.sunandski.com%2Fv%2Fvspfiles%2Fphotos%2F0084064919010-1.jpg%3C%2Fsmall_image_url%3E%3Csize%2F%3E%3Csavings%3E53%3C%2Fsavings%3E%3C%2Fproduct%3E%3Cproduct%3E%3Cproduct_code%3E0084064919011%3C%2Fproduct_code%3E%3Cname%3ESpy+Men%27s+Hsx+Sunglasses%3C%2Fname%3E%3Cstock%3E6%3C%2Fstock%3E%3Cregular_price%3E149.95%3C%2Fregular_price%3E%3Csale_price%3E69.93%3C%2Fsale_price%3E%3Cbrand%3ESpy+Optic+Inc++++%3C%2Fbrand%3E%3Cgender%2F%3E%3Ccategory%3ESunglasses%3C%2Fcategory%3E%3Cproduct_description%3EThe+Spy+Men%27s+Hsx+Sunglasses+are+made+from+lightweight+durable+Grilamid.+It+has+8x4+base+Toric+Arc+Lenses+give+you+superior+vision+without+distortion.+It+offers+100%25+UV+Protection+to+spare+your+eyes++from+the+sun+++s+harmful+rays.+Metal+detailing+give+these+glasses+extra+style.%3C%2Fproduct_description%3E%3Cbuy_url%3Ehttp%3A%2F%2Fwww.sunandski.com%2FProductDetails.asp%3FProductCode%3D0084064919011%3C%2Fbuy_url%3E%3Clarge_image_url%3Eimgs%2Fproducts%2Flrg%2F0084064919011.jpg%3C%2Flarge_image_url%3E%3Cremote_image_url%3Ehttp%3A%2F%2Fwww.sunandski.com%2Fv%2Fvspfiles%2Fphotos%2F0084064919011-2T.jpg%3C%2Fremote_image_url%3E%3Csmall_image_url%3Ehttp%3A%2F%2Fwww.sunandski.com%2Fv%2Fvspfiles%2Fphotos%2F0084064919011-1.jpg%3C%2Fsmall_image_url%3E%3Csize%2F%3E%3Csavings%3E54%3C%2Fsavings%3E%3C%2Fproduct%3E%0A%3C%2Fproducts%3E'
          2        DO_ICALL                                         $4      
    2     3        ASSIGN                                                   !0, $4
    8     4        ASSIGN                                                   !1, <array>
    9     5        FETCH_OBJ_R                                      ~7      !0, 'product'
          6      > FE_RESET_R                                       $8      ~7, ->11
          7    > > FE_FETCH_R                                               $8, !2, ->11
   11     8    >   ASSIGN_DIM                                               !1
          9        OP_DATA                                                  !2
    9    10      > JMP                                                      ->7
         11    >   FE_FREE                                                  $8
   14    12        INIT_FCALL                                               'usort'
         13        SEND_REF                                                 !1
         14        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FEvlJO%3A14%240'
   16    15        SEND_VAL                                                 ~10
         16        DO_ICALL                                                 
   18    17        INIT_FCALL                                               'simplexml_load_string'
   19    18        SEND_VAL                                                 '%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3Cproducts%3E%0A%3C%2Fproducts%3E'
         19        DO_ICALL                                         $12     
   18    20        ASSIGN                                                   !0, $12
   24    21      > FE_RESET_R                                       $14     !1, ->57
         22    > > FE_FETCH_R                                               $14, !2, ->57
   26    23    >   INIT_METHOD_CALL                                         !0, 'addChild'
         24        INIT_METHOD_CALL                                         !2, 'getName'
         25        DO_FCALL                                      0  $15     
         26        SEND_VAR_NO_REF_EX                                       $15
         27        DO_FCALL                                      0  $16     
         28        ASSIGN                                                   !3, $16
   27    29        INIT_METHOD_CALL                                         !3, 'addChild'
         30        FETCH_OBJ_R                                      ~18     !2, 'date'
         31        INIT_METHOD_CALL                                         ~18, 'getName'
         32        DO_FCALL                                      0  $19     
         33        SEND_VAR_NO_REF_EX                                       $19
         34        FETCH_OBJ_R                                      ~20     !2, 'name'
         35        CAST                                          6  ~21     ~20
         36        SEND_VAL_EX                                              ~21
         37        DO_FCALL                                      0          
   28    38        INIT_METHOD_CALL                                         !3, 'addChild'
         39        FETCH_OBJ_R                                      ~23     !2, 'title'
         40        INIT_METHOD_CALL                                         ~23, 'getName'
         41        DO_FCALL                                      0  $24     
         42        SEND_VAR_NO_REF_EX                                       $24
         43        FETCH_OBJ_R                                      ~25     !2, 'category'
         44        CAST                                          6  ~26     ~25
         45        SEND_VAL_EX                                              ~26
         46        DO_FCALL                                      0          
   29    47        INIT_METHOD_CALL                                         !3, 'addChild'
         48        FETCH_OBJ_R                                      ~28     !2, 'description'
         49        INIT_METHOD_CALL                                         ~28, 'getName'
         50        DO_FCALL                                      0  $29     
         51        SEND_VAR_NO_REF_EX                                       $29
         52        FETCH_OBJ_R                                      ~30     !2, 'product_description'
         53        CAST                                          6  ~31     ~30
         54        SEND_VAL_EX                                              ~31
         55        DO_FCALL                                      0          
   24    56      > JMP                                                      ->22
         57    >   FE_FREE                                                  $14
   31    58        INIT_METHOD_CALL                                         !0, 'asXML'
         59        DO_FCALL                                      0  $33     
         60        ECHO                                                     $33
         61      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FEvlJO%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EvlJO
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $a, !1 = $b, !2 = $aTask
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        INIT_FCALL                                               'usort'
          3        SEND_REF                                                 !0
          4        FETCH_OBJ_R                                      ~3      !2, 'name'
          5        SEND_VAL                                                 ~3
          6        DO_ICALL                                         $4      
          7      > RETURN                                                   $4
   16     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FEvlJO%3A14%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.03 ms | 1404 KiB | 17 Q