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/*"); //$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 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 11
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 11
Branch analysis from position: 34
Branch analysis from position: 11
filename:       /in/JWqbi
function name:  (null)
number of ops:  35
compiled vars:  !0 = $xmlstr, !1 = $xml, !2 = $x, !3 = $i, !4 = $nb_lever
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
   41     9        ASSIGN                                                   !3, 0
         10      > JMP                                                      ->32
   42    11    >   FETCH_DIM_R                                      ~11     !2, !3
         12        FETCH_DIM_R                                      ~12     ~11, 0
         13        INIT_METHOD_CALL                                         ~12, 'attributes'
         14        DO_FCALL                                      0  $13     
         15        CONCAT                                           ~14     'array%28%22', $13
         16        CONCAT                                           ~15     ~14, '%22%2C+%22'
         17        FETCH_DIM_R                                      ~16     !2, !3
         18        FETCH_DIM_R                                      ~17     ~16, 1
         19        INIT_METHOD_CALL                                         ~17, 'attributes'
         20        DO_FCALL                                      0  $18     
         21        CONCAT                                           ~19     ~15, $18
         22        CONCAT                                           ~20     ~19, '%22%2C+%22'
         23        FETCH_DIM_R                                      ~21     !2, !3
         24        FETCH_DIM_R                                      ~22     ~21, 2
         25        INIT_METHOD_CALL                                         ~22, 'attributes'
         26        DO_FCALL                                      0  $23     
         27        CONCAT                                           ~24     ~20, $23
         28        CONCAT                                           ~25     ~24, '%22%29%2C'
         29        CONCAT                                           ~26     ~25, '%0A'
         30        ECHO                                                     ~26
   41    31        PRE_INC                                                  !3
         32    >   IS_SMALLER_OR_EQUAL                                      !3, !4
         33      > JMPNZ                                                    ~28, ->11
   59    34    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.48 ms | 1400 KiB | 15 Q