3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlstr = <<<XML <xml> <medium val="cpa"> <source val="affilinet"> <campaign val=""> <lever3 val="affiliation" /> <lever2 val="affiliation" /> <lever1 val="trafic_payant" /> </campaign> </source> </medium> <medium val="organic"> <source val=""> <campaign val=""> <lever3 val="seo" /> <lever2 val="seo" /> <lever1 val="trafic_gratuit" /> </campaign> </source> </medium> <medium val="display"> <source val=""> <campaign val=""> <lever3 val="display" /> <lever2 val="display" /> <lever1 val="trafic_payant" /> </campaign> </source> </medium> </xml> XML; $xml = simplexml_load_string($xmlstr); $x = $xml->xpath("//campaign/*"); print_r($x); $nb_lever = count($x) / 3; for ($i = 0; $i <= $nb_lever; ++$i) { echo "array(\"" . $x[$i][0]->attributes() . "\", \"" . $x[$i][1]->attributes() . "\", \"" . $x[$i][2]->attributes() . "\")," . "\n"; } //$levers = array(array("comparateur-google_shopping", "comparateur", "trafic_payant"), // array("display", "display", "trafic_payant"), // array("email-auchanfr", "email_auchanfr", "email_auchanfr") // ); //$begin = 41; //$end = 50; //for ($i = $begin; $i <= $end; ++$i){ // $index = rand(0,2); // $query = "UPDATE IGNORE piwik_log_visit SET lever3='" . $levers[$index][0] . "', lever2='" . $levers[$index][1] . "', lever1='" . //$levers[$index][2] . "' WHERE idvisit=" . $i . ";"; // echo $query . "\n"; //} //print_r($levers[rand(0,2)]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 17
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 17
Branch analysis from position: 40
Branch analysis from position: 17
filename:       /in/dQ0kn
function name:  (null)
number of ops:  41
compiled vars:  !0 = $xmlstr, !1 = $xml, !2 = $x, !3 = $nb_lever, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cxml%3E%0A%3Cmedium+val%3D%22cpa%22%3E%0A++++++%3Csource+val%3D%22affilinet%22%3E%0A+++++++++++%3Ccampaign+val%3D%22%22%3E%0A++++++++++++++++%3Clever3+val%3D%22affiliation%22+%2F%3E%0A++++++++++++++++%3Clever2+val%3D%22affiliation%22+%2F%3E%0A++++++++++++++++%3Clever1+val%3D%22trafic_payant%22+%2F%3E%0A++++++++++++%3C%2Fcampaign%3E%0A++++++++%3C%2Fsource%3E%0A%3C%2Fmedium%3E%0A%3Cmedium+val%3D%22organic%22%3E%0A++++++++%3Csource+val%3D%22%22%3E%0A++++++++++++%3Ccampaign+val%3D%22%22%3E%0A++++++++++++++++%3Clever3+val%3D%22seo%22+%2F%3E%0A++++++++++++++++%3Clever2+val%3D%22seo%22+%2F%3E%0A++++++++++++++++%3Clever1+val%3D%22trafic_gratuit%22+%2F%3E%0A++++++++++++%3C%2Fcampaign%3E%0A++++++++%3C%2Fsource%3E%0A%3C%2Fmedium%3E%0A%3Cmedium+val%3D%22display%22%3E%0A++++++++%3Csource+val%3D%22%22%3E%0A++++++++++++%3Ccampaign+val%3D%22%22%3E%0A++++++++++++++++%3Clever3+val%3D%22display%22+%2F%3E%0A++++++++++++++++%3Clever2+val%3D%22display%22+%2F%3E%0A++++++++++++++++%3Clever1+val%3D%22trafic_payant%22+%2F%3E%0A++++++++++++%3C%2Fcampaign%3E%0A++++++++%3C%2Fsource%3E%0A%3C%2Fmedium%3E%0A%3C%2Fxml%3E'
   35     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
   37     5        INIT_METHOD_CALL                                         !1, 'xpath'
          6        SEND_VAL_EX                                              '%2F%2Fcampaign%2F%2A'
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !2, $8
   39     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
   42    12        COUNT                                            ~11     !2
         13        DIV                                              ~12     ~11, 3
         14        ASSIGN                                                   !3, ~12
   44    15        ASSIGN                                                   !4, 0
         16      > JMP                                                      ->38
   45    17    >   FETCH_DIM_R                                      ~15     !2, !4
         18        FETCH_DIM_R                                      ~16     ~15, 0
         19        INIT_METHOD_CALL                                         ~16, 'attributes'
         20        DO_FCALL                                      0  $17     
         21        CONCAT                                           ~18     'array%28%22', $17
         22        CONCAT                                           ~19     ~18, '%22%2C+%22'
         23        FETCH_DIM_R                                      ~20     !2, !4
         24        FETCH_DIM_R                                      ~21     ~20, 1
         25        INIT_METHOD_CALL                                         ~21, 'attributes'
         26        DO_FCALL                                      0  $22     
         27        CONCAT                                           ~23     ~19, $22
         28        CONCAT                                           ~24     ~23, '%22%2C+%22'
         29        FETCH_DIM_R                                      ~25     !2, !4
         30        FETCH_DIM_R                                      ~26     ~25, 2
         31        INIT_METHOD_CALL                                         ~26, 'attributes'
         32        DO_FCALL                                      0  $27     
         33        CONCAT                                           ~28     ~24, $27
         34        CONCAT                                           ~29     ~28, '%22%29%2C'
         35        CONCAT                                           ~30     ~29, '%0A'
         36        ECHO                                                     ~30
   44    37        PRE_INC                                                  !4
         38    >   IS_SMALLER_OR_EQUAL                                      !4, !3
         39      > JMPNZ                                                    ~32, ->17
   62    40    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.99 ms | 1400 KiB | 17 Q