3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 1- connect to db require("DatabaseConfigegb1.php"); // define quesry //StartFrom $decrypted_txt = decrypt(str_replace(" ", "+",$_GET['number'])); // $decrypted_txt = str_replace(" ", "+",$_GET['number']); if( empty($decrypted_txt) ) { die("Error in number");} if( mb_substr($decrypted_txt, 0, 2)== "20"){ $decrypted_txtnew= substr_replace($decrypted_txt, "", 0, 2); }elseif (mb_substr($decrypted_txt, 0, 4)== "0020"){ $decrypted_txtnew= substr_replace($decrypted_txt, "", 0, 4); }elseif (mb_substr($decrypted_txt, 0, 3)== "020"){ $decrypted_txtnew= substr_replace($decrypted_txt, "", 0, 3); }elseif (mb_substr($decrypted_txt, 0, 1)== "0"){ $decrypted_txtnew= substr_replace($decrypted_txt, "", 0, 1); }else{ $decrypted_txtnew= $decrypted_txt; } $query="SELECT id as 'id' ,name as 'name', number as 'number', ' ' as 'addrass' FROM list_numbers WHERE MATCH(number,name) AGAINST('%" . $decrypted_txtnew. "') GROUP BY name UNION SELECT id as 'id' ,name as 'name', number as 'number', ' ' as 'addrass' FROM list_numbers WHERE MATCH(number,name) AGAINST('0" . $decrypted_txtnew . "') GROUP BY name UNION SELECT id as 'id' ,name as 'name', number as 'number', ' ' as 'addrass' FROM list_numbers WHERE MATCH(number,name) AGAINST('20" . $decrypted_txtnew . "') GROUP BY name UNION SELECT id as 'id' ,name as 'name', number as 'number', ' ' as 'addrass' FROM list_numbers WHERE MATCH(number,name) AGAINST('0020" . $decrypted_txtnew . "') GROUP BY name "; $query1="SELECT numberphone as 'id' ,name as 'name', numberphone as 'number', addrass as 'addrass' FROM list_numbers WHERE MATCH(numberphone,name) AGAINST('20" . $decrypted_txtnew . "') GROUP BY name "; $query2="SELECT id as 'id' ,name as 'name', number as 'number', ' ' as 'addrass' FROM list_numbers WHERE MATCH(number,name) AGAINST('0020" . $decrypted_txtnew . "') AND codecoutnry='EG' GROUP BY name "; $startTime = time(); $result= mysqli_query($connecteg1, $query); $result1= mysqli_query($connecteg2, $query1); $result2= mysqli_query($connect2, $query2); if(! $result && ! $result1 && ! $result2 ) { die("Error in query");} //get data from database $output=array(); while($row= mysqli_fetch_assoc($result)) { $output[]=escapeJsonString($row); //$row['id'] } while($row2= mysqli_fetch_assoc($result2)) { $output[]=escapeJsonString($row2); } while($row1= mysqli_fetch_assoc($result1)) { $output[]=escapeJsonString($row1); } $endTime = time(); if ($output) { print( "{". "'info':'". json_encode($output) ."'}");// this will print the output in json } else{ print("error"); } function encrypt($wordEnc) { $key16 = substr("egbti23456122313", 0, 16); $key16Hex = unpack('H*', $key16); return openssl_encrypt($word, 'AES-128-CBC', $key16, 0, hex2bin($key16Hex[1])); } function decrypt($wordDec) { $key16 = substr("egbti23456122313", 0, 16); $key16Hex = unpack('H*', $key16); return openssl_decrypt($wordDec, "AES-128-CBC", $key16, 0, hex2bin($key16Hex[1])); } function escapeJsonString($value) { $escapers = array( "\"", '\'',"+"); $replacements = array(" ", " ",""); $result = str_replace($escapers, $replacements, $value); return $result; } // 4 clear mysqli_free_result($result); //5- close connection mysqli_close($connecteg1); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 30
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
2 jumps found. (Code = 46) Position 1 = 111, Position 2 = 113
Branch analysis from position: 111
2 jumps found. (Code = 46) Position 1 = 114, Position 2 = 116
Branch analysis from position: 114
2 jumps found. (Code = 43) Position 1 = 117, Position 2 = 118
Branch analysis from position: 117
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 118
1 jumps found. (Code = 42) Position 1 = 125
Branch analysis from position: 125
2 jumps found. (Code = 44) Position 1 = 130, Position 2 = 120
Branch analysis from position: 130
1 jumps found. (Code = 42) Position 1 = 136
Branch analysis from position: 136
2 jumps found. (Code = 44) Position 1 = 141, Position 2 = 131
Branch analysis from position: 141
1 jumps found. (Code = 42) Position 1 = 147
Branch analysis from position: 147
2 jumps found. (Code = 44) Position 1 = 152, Position 2 = 142
Branch analysis from position: 152
2 jumps found. (Code = 43) Position 1 = 156, Position 2 = 163
Branch analysis from position: 156
1 jumps found. (Code = 42) Position 1 = 164
Branch analysis from position: 164
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 163
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 142
2 jumps found. (Code = 44) Position 1 = 152, Position 2 = 142
Branch analysis from position: 152
Branch analysis from position: 142
Branch analysis from position: 131
2 jumps found. (Code = 44) Position 1 = 141, Position 2 = 131
Branch analysis from position: 141
Branch analysis from position: 131
Branch analysis from position: 120
2 jumps found. (Code = 44) Position 1 = 130, Position 2 = 120
Branch analysis from position: 130
Branch analysis from position: 120
Branch analysis from position: 116
Branch analysis from position: 113
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 45
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 60
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 75
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
Branch analysis from position: 75
2 jumps found. (Code = 46) Position 1 = 111, Position 2 = 113
Branch analysis from position: 111
Branch analysis from position: 113
filename:       /in/KRVFT
function name:  (null)
number of ops:  171
compiled vars:  !0 = $decrypted_txt, !1 = $decrypted_txtnew, !2 = $query, !3 = $query1, !4 = $query2, !5 = $startTime, !6 = $result, !7 = $connecteg1, !8 = $result1, !9 = $connecteg2, !10 = $result2, !11 = $connect2, !12 = $output, !13 = $row, !14 = $row2, !15 = $row1, !16 = $endTime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INCLUDE_OR_EVAL                                          'DatabaseConfigegb1.php', REQUIRE
    5     1        INIT_FCALL_BY_NAME                                       'decrypt'
          2        INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 '+'
          4        SEND_VAL                                                 '%2B'
          5        FETCH_R                      global              ~18     '_GET'
          6        FETCH_DIM_R                                      ~19     ~18, 'number'
          7        SEND_VAL                                                 ~19
          8        DO_ICALL                                         $20     
          9        SEND_VAR_NO_REF_EX                                       $20
         10        DO_FCALL                                      0  $21     
         11        ASSIGN                                                   !0, $21
    7    12        ISSET_ISEMPTY_CV                                         !0
         13      > JMPZ                                                     ~23, ->15
    8    14    > > EXIT                                                     'Error+in+number'
    9    15    >   INIT_FCALL                                               'mb_substr'
         16        SEND_VAR                                                 !0
         17        SEND_VAL                                                 0
         18        SEND_VAL                                                 2
         19        DO_ICALL                                         $24     
         20        IS_EQUAL                                                 $24, '20'
         21      > JMPZ                                                     ~25, ->30
   10    22    >   INIT_FCALL                                               'substr_replace'
         23        SEND_VAR                                                 !0
         24        SEND_VAL                                                 ''
         25        SEND_VAL                                                 0
         26        SEND_VAL                                                 2
         27        DO_ICALL                                         $26     
         28        ASSIGN                                                   !1, $26
    9    29      > JMP                                                      ->76
   12    30    >   INIT_FCALL                                               'mb_substr'
         31        SEND_VAR                                                 !0
         32        SEND_VAL                                                 0
         33        SEND_VAL                                                 4
         34        DO_ICALL                                         $28     
         35        IS_EQUAL                                                 $28, '0020'
         36      > JMPZ                                                     ~29, ->45
   13    37    >   INIT_FCALL                                               'substr_replace'
         38        SEND_VAR                                                 !0
         39        SEND_VAL                                                 ''
         40        SEND_VAL                                                 0
         41        SEND_VAL                                                 4
         42        DO_ICALL                                         $30     
         43        ASSIGN                                                   !1, $30
   12    44      > JMP                                                      ->76
   15    45    >   INIT_FCALL                                               'mb_substr'
         46        SEND_VAR                                                 !0
         47        SEND_VAL                                                 0
         48        SEND_VAL                                                 3
         49        DO_ICALL                                         $32     
         50        IS_EQUAL                                                 $32, '020'
         51      > JMPZ                                                     ~33, ->60
   16    52    >   INIT_FCALL                                               'substr_replace'
         53        SEND_VAR                                                 !0
         54        SEND_VAL                                                 ''
         55        SEND_VAL                                                 0
         56        SEND_VAL                                                 3
         57        DO_ICALL                                         $34     
         58        ASSIGN                                                   !1, $34
   15    59      > JMP                                                      ->76
   18    60    >   INIT_FCALL                                               'mb_substr'
         61        SEND_VAR                                                 !0
         62        SEND_VAL                                                 0
         63        SEND_VAL                                                 1
         64        DO_ICALL                                         $36     
         65        IS_EQUAL                                                 $36, '0'
         66      > JMPZ                                                     ~37, ->75
   19    67    >   INIT_FCALL                                               'substr_replace'
         68        SEND_VAR                                                 !0
         69        SEND_VAL                                                 ''
         70        SEND_VAL                                                 0
         71        SEND_VAL                                                 1
         72        DO_ICALL                                         $38     
         73        ASSIGN                                                   !1, $38
   18    74      > JMP                                                      ->76
   22    75    >   ASSIGN                                                   !1, !0
   25    76    >   CONCAT                                           ~41     'SELECT+id+as+%27id%27+%2Cname+as+%27name%27%2C+number++as+%27number%27%2C+%27+%27+as+%27addrass%27+++FROM+list_numbers+WHERE+MATCH%28number%2Cname%29+AGAINST%28%27%25', !1
         77        CONCAT                                           ~42     ~41, '%27%29+GROUP+BY+name%0A+UNION+SELECT+id+as+%27id%27+%2Cname+as+%27name%27%2C+number++as+%27number%27%2C+%27+%27+as+%27addrass%27+++FROM+list_numbers+WHERE+MATCH%28number%2Cname%29+AGAINST%28%270'
   26    78        CONCAT                                           ~43     ~42, !1
         79        CONCAT                                           ~44     ~43, '%27%29+GROUP+BY+name%0A+UNION+SELECT+id+as+%27id%27+%2Cname+as+%27name%27%2C+number++as+%27number%27%2C+%27+%27+as+%27addrass%27+++FROM+list_numbers+WHERE+MATCH%28number%2Cname%29+AGAINST%28%2720'
   27    80        CONCAT                                           ~45     ~44, !1
         81        CONCAT                                           ~46     ~45, '%27%29+GROUP+BY+name%0A++UNION+SELECT+id+as+%27id%27+%2Cname+as+%27name%27%2C+number++as+%27number%27%2C+%27+%27+as+%27addrass%27+++FROM+list_numbers+WHERE+MATCH%28number%2Cname%29+AGAINST%28%270020'
   28    82        CONCAT                                           ~47     ~46, !1
         83        CONCAT                                           ~48     ~47, '%27%29+GROUP+BY+name%0A'
   25    84        ASSIGN                                                   !2, ~48
   30    85        CONCAT                                           ~50     'SELECT+numberphone+as+%27id%27+%2Cname+as+%27name%27%2C+numberphone+as+%27number%27%2C+addrass+as+%27addrass%27+FROM+list_numbers+WHERE+MATCH%28numberphone%2Cname%29+AGAINST%28%2720', !1
         86        CONCAT                                           ~51     ~50, '%27%29+GROUP+BY+name%0A'
         87        ASSIGN                                                   !3, ~51
   32    88        CONCAT                                           ~53     'SELECT+id+as+%27id%27+%2Cname+as+%27name%27%2C+number++as+%27number%27%2C+%27+%27+as+%27addrass%27++FROM+list_numbers+WHERE+MATCH%28number%2Cname%29+AGAINST%28%270020', !1
         89        CONCAT                                           ~54     ~53, '%27%29++AND+codecoutnry%3D%27EG%27+GROUP+BY+name%0A'
         90        ASSIGN                                                   !4, ~54
   34    91        INIT_FCALL                                               'time'
         92        DO_ICALL                                         $56     
         93        ASSIGN                                                   !5, $56
   35    94        INIT_FCALL_BY_NAME                                       'mysqli_query'
         95        SEND_VAR_EX                                              !7
         96        SEND_VAR_EX                                              !2
         97        DO_FCALL                                      0  $58     
         98        ASSIGN                                                   !6, $58
   36    99        INIT_FCALL_BY_NAME                                       'mysqli_query'
        100        SEND_VAR_EX                                              !9
        101        SEND_VAR_EX                                              !3
        102        DO_FCALL                                      0  $60     
        103        ASSIGN                                                   !8, $60
   37   104        INIT_FCALL_BY_NAME                                       'mysqli_query'
        105        SEND_VAR_EX                                              !11
        106        SEND_VAR_EX                                              !4
        107        DO_FCALL                                      0  $62     
        108        ASSIGN                                                   !10, $62
   38   109        BOOL_NOT                                         ~64     !6
        110      > JMPZ_EX                                          ~64     ~64, ->113
        111    >   BOOL_NOT                                         ~65     !8
        112        BOOL                                             ~64     ~65
        113    > > JMPZ_EX                                          ~64     ~64, ->116
        114    >   BOOL_NOT                                         ~66     !10
        115        BOOL                                             ~64     ~66
        116    > > JMPZ                                                     ~64, ->118
   39   117    > > EXIT                                                     'Error+in+query'
   41   118    >   ASSIGN                                                   !12, <array>
   42   119      > JMP                                                      ->125
   44   120    >   INIT_FCALL_BY_NAME                                       'escapeJsonString'
        121        SEND_VAR_EX                                              !13
        122        DO_FCALL                                      0  $69     
        123        ASSIGN_DIM                                               !12
        124        OP_DATA                                                  $69
   42   125    >   INIT_FCALL_BY_NAME                                       'mysqli_fetch_assoc'
        126        SEND_VAR_EX                                              !6
        127        DO_FCALL                                      0  $70     
        128        ASSIGN                                           ~71     !13, $70
        129      > JMPNZ                                                    ~71, ->120
   46   130    > > JMP                                                      ->136
   48   131    >   INIT_FCALL_BY_NAME                                       'escapeJsonString'
        132        SEND_VAR_EX                                              !14
        133        DO_FCALL                                      0  $73     
        134        ASSIGN_DIM                                               !12
        135        OP_DATA                                                  $73
   46   136    >   INIT_FCALL_BY_NAME                                       'mysqli_fetch_assoc'
        137        SEND_VAR_EX                                              !10
        138        DO_FCALL                                      0  $74     
        139        ASSIGN                                           ~75     !14, $74
        140      > JMPNZ                                                    ~75, ->131
   50   141    > > JMP                                                      ->147
   52   142    >   INIT_FCALL_BY_NAME                                       'escapeJsonString'
        143        SEND_VAR_EX                                              !15
        144        DO_FCALL                                      0  $77     
        145        ASSIGN_DIM                                               !12
        146        OP_DATA                                                  $77
   50   147    >   INIT_FCALL_BY_NAME                                       'mysqli_fetch_assoc'
        148        SEND_VAR_EX                                              !8
        149        DO_FCALL                                      0  $78     
        150        ASSIGN                                           ~79     !15, $78
        151      > JMPNZ                                                    ~79, ->142
   54   152    >   INIT_FCALL                                               'time'
        153        DO_ICALL                                         $80     
        154        ASSIGN                                                   !16, $80
   55   155      > JMPZ                                                     !12, ->163
   56   156    >   INIT_FCALL                                               'json_encode'
        157        SEND_VAR                                                 !12
        158        DO_ICALL                                         $82     
        159        CONCAT                                           ~83     '%7B%27info%27%3A%27', $82
        160        CONCAT                                           ~84     ~83, '%27%7D'
        161        ECHO                                                     ~84
   55   162      > JMP                                                      ->164
   59   163    >   ECHO                                                     'error'
   83   164    >   INIT_FCALL_BY_NAME                                       'mysqli_free_result'
        165        SEND_VAR_EX                                              !6
        166        DO_FCALL                                      0          
   85   167        INIT_FCALL_BY_NAME                                       'mysqli_close'
        168        SEND_VAR_EX                                              !7
        169        DO_FCALL                                      0          
   86   170      > RETURN                                                   1

Function encrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KRVFT
function name:  encrypt
number of ops:  25
compiled vars:  !0 = $wordEnc, !1 = $key16, !2 = $key16Hex, !3 = $word
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   61     0  E >   RECV                                             !0      
   63     1        INIT_FCALL                                               'substr'
          2        SEND_VAL                                                 'egbti23456122313'
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 16
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
   64     7        INIT_FCALL                                               'unpack'
          8        SEND_VAL                                                 'H%2A'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !2, $6
   65    12        INIT_FCALL_BY_NAME                                       'openssl_encrypt'
         13        SEND_VAR_EX                                              !3
         14        SEND_VAL_EX                                              'AES-128-CBC'
         15        SEND_VAR_EX                                              !1
         16        SEND_VAL_EX                                              0
         17        INIT_FCALL                                               'hex2bin'
         18        FETCH_DIM_R                                      ~8      !2, 1
         19        SEND_VAL                                                 ~8
         20        DO_ICALL                                         $9      
         21        SEND_VAR_NO_REF_EX                                       $9
         22        DO_FCALL                                      0  $10     
         23      > RETURN                                                   $10
   66    24*     > RETURN                                                   null

End of function encrypt

Function decrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KRVFT
function name:  decrypt
number of ops:  25
compiled vars:  !0 = $wordDec, !1 = $key16, !2 = $key16Hex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   68     0  E >   RECV                                             !0      
   70     1        INIT_FCALL                                               'substr'
          2        SEND_VAL                                                 'egbti23456122313'
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 16
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
   71     7        INIT_FCALL                                               'unpack'
          8        SEND_VAL                                                 'H%2A'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $5      
         11        ASSIGN                                                   !2, $5
   72    12        INIT_FCALL_BY_NAME                                       'openssl_decrypt'
         13        SEND_VAR_EX                                              !0
         14        SEND_VAL_EX                                              'AES-128-CBC'
         15        SEND_VAR_EX                                              !1
         16        SEND_VAL_EX                                              0
         17        INIT_FCALL                                               'hex2bin'
         18        FETCH_DIM_R                                      ~7      !2, 1
         19        SEND_VAL                                                 ~7
         20        DO_ICALL                                         $8      
         21        SEND_VAR_NO_REF_EX                                       $8
         22        DO_FCALL                                      0  $9      
         23      > RETURN                                                   $9
   73    24*     > RETURN                                                   null

End of function decrypt

Function escapejsonstring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KRVFT
function name:  escapeJsonString
number of ops:  11
compiled vars:  !0 = $value, !1 = $escapers, !2 = $replacements, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   75     0  E >   RECV                                             !0      
   77     1        ASSIGN                                                   !1, <array>
   78     2        ASSIGN                                                   !2, <array>
   79     3        INIT_FCALL                                               'str_replace'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !3, $6
   80     9      > RETURN                                                   !3
   81    10*     > RETURN                                                   null

End of function escapejsonstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.77 ms | 1459 KiB | 21 Q