3v4l.org

run code in 500+ PHP versions simultaneously
<?php $mediaArray ='Facebook,Twitter,Twitch,'; $otherMedia = 'House'; //convert string to array $socialArray = explode(',', $mediaArray); //declare some variables to be used later $andwhere = ''; $bp = ''; $socialmarray = ''; //get every value from array of social media foreach($socialArray as $socialmedia){ $socialmarray .=$socialmedia.','; $andwhere .= " AND socialmedianame=?"; $bp .='s'; } //test strings $wheres = $andwhere;//AND socialmedianame=? AND socialmedianame=? AND socialmedianame=? $bip = $bp.'s';//ssss $validarayy = rtrim($socialmarray,','); //Facebook,Twitter,Twitch $socialmarray2 = explode(',', $validarayy); var_dump($socialmarray2);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/8SAEs
function name:  (null)
number of ops:  35
compiled vars:  !0 = $mediaArray, !1 = $otherMedia, !2 = $socialArray, !3 = $andwhere, !4 = $bp, !5 = $socialmarray, !6 = $socialmedia, !7 = $wheres, !8 = $bip, !9 = $validarayy, !10 = $socialmarray2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Facebook%2CTwitter%2CTwitch%2C'
    4     1        ASSIGN                                                       !1, 'House'
    7     2        INIT_FCALL                                                   'explode'
          3        SEND_VAL                                                     '%2C'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $13     
          6        ASSIGN                                                       !2, $13
   10     7        ASSIGN                                                       !3, ''
   11     8        ASSIGN                                                       !4, ''
   12     9        ASSIGN                                                       !5, ''
   15    10      > FE_RESET_R                                           $18     !2, ->17
         11    > > FE_FETCH_R                                                   $18, !6, ->17
   17    12    >   CONCAT                                               ~19     !6, '%2C'
         13        ASSIGN_OP                                         8          !5, ~19
   18    14        ASSIGN_OP                                         8          !3, '+AND+socialmedianame%3D%3F'
   19    15        ASSIGN_OP                                         8          !4, 's'
   15    16      > JMP                                                          ->11
         17    >   FE_FREE                                                      $18
   23    18        ASSIGN                                                       !7, !3
   24    19        CONCAT                                               ~24     !4, 's'
         20        ASSIGN                                                       !8, ~24
   25    21        INIT_FCALL                                                   'rtrim'
         22        SEND_VAR                                                     !5
         23        SEND_VAL                                                     '%2C'
         24        DO_ICALL                                             $26     
         25        ASSIGN                                                       !9, $26
   26    26        INIT_FCALL                                                   'explode'
         27        SEND_VAL                                                     '%2C'
         28        SEND_VAR                                                     !9
         29        DO_ICALL                                             $28     
         30        ASSIGN                                                       !10, $28
   27    31        INIT_FCALL                                                   'var_dump'
         32        SEND_VAR                                                     !10
         33        DO_ICALL                                                     
         34      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
233.82 ms | 2231 KiB | 16 Q