3v4l.org

run code in 500+ PHP versions simultaneously
<?php global $wpdb; $charset_collate = $wpdb->get_charset_collate(); $phantom_option = $wpdb->prefix . 'phantom_option'; $phantom_menu = $wpdb->prefix . 'phantom_menu'; $wc_all_defult_and_undefult_array = array_keys(wc_get_account_menu_items()); $pa_custom_tab_endpoints = $wpdb->get_results("SELECT pa_menu_endpoint FROM $phantom_menu WHERE pa_menu_from='pa_custom_tab'"); // Extract the values from $pa_custom_tab_endpoints $pa_custom_tab_endpoints_list = array_map(function($item) { return $item->pa_menu_endpoint; }, $pa_custom_tab_endpoints); // Remove the values in $pa_custom_tab_endpoints from $wc_all_defult_and_undefult_array $wc_all_defult_endpoints_array = array_diff($wc_all_defult_and_undefult_array, $pa_custom_tab_endpoints_list); foreach($wc_all_defult_endpoints_array as $wcendpoint){ $result=$wpdb->get_results("select * from $phantom_menu WHERE pa_menu_endpoint='$wcendpoint'"); foreach ($result as $row) $row->pa_menu_endpoint; if(!$result){ $wpdb->query(" INSERT INTO `$phantom_menu` (`pa_menu_endpoint`, `pa_menu_from`) VALUES ('$wcendpoint', 'wc')"); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 35, Position 2 = 62
Branch analysis from position: 35
2 jumps found. (Code = 78) Position 1 = 36, Position 2 = 62
Branch analysis from position: 36
2 jumps found. (Code = 77) Position 1 = 46, Position 2 = 50
Branch analysis from position: 46
2 jumps found. (Code = 78) Position 1 = 47, Position 2 = 50
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 61
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
Branch analysis from position: 61
Branch analysis from position: 50
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
filename:       /in/aXWeg
function name:  (null)
number of ops:  64
compiled vars:  !0 = $wpdb, !1 = $charset_collate, !2 = $phantom_option, !3 = $phantom_menu, !4 = $wc_all_defult_and_undefult_array, !5 = $pa_custom_tab_endpoints, !6 = $pa_custom_tab_endpoints_list, !7 = $wc_all_defult_endpoints_array, !8 = $wcendpoint, !9 = $result, !10 = $row
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   BIND_GLOBAL                                                  !0, 'wpdb'
    3     1        INIT_METHOD_CALL                                             !0, 'get_charset_collate'
          2        DO_FCALL                                          0  $11     
          3        ASSIGN                                                       !1, $11
    4     4        FETCH_OBJ_R                                          ~13     !0, 'prefix'
          5        CONCAT                                               ~14     ~13, 'phantom_option'
          6        ASSIGN                                                       !2, ~14
    5     7        FETCH_OBJ_R                                          ~16     !0, 'prefix'
          8        CONCAT                                               ~17     ~16, 'phantom_menu'
          9        ASSIGN                                                       !3, ~17
    6    10        INIT_FCALL                                                   'array_keys'
         11        INIT_FCALL_BY_NAME                                           'wc_get_account_menu_items'
         12        DO_FCALL                                          0  $19     
         13        SEND_VAR                                                     $19
         14        DO_ICALL                                             $20     
         15        ASSIGN                                                       !4, $20
    7    16        INIT_METHOD_CALL                                             !0, 'get_results'
         17        ROPE_INIT                                         3  ~23     'SELECT+pa_menu_endpoint+FROM+'
         18        ROPE_ADD                                          1  ~23     ~23, !3
         19        ROPE_END                                          2  ~22     ~23, '+WHERE+pa_menu_from%3D%27pa_custom_tab%27'
         20        SEND_VAL_EX                                                  ~22
         21        DO_FCALL                                          0  $25     
         22        ASSIGN                                                       !5, $25
    9    23        INIT_FCALL                                                   'array_map'
         24        DECLARE_LAMBDA_FUNCTION                              ~27     [0]
   11    25        SEND_VAL                                                     ~27
         26        SEND_VAR                                                     !5
    9    27        DO_ICALL                                             $28     
         28        ASSIGN                                                       !6, $28
   13    29        INIT_FCALL                                                   'array_diff'
         30        SEND_VAR                                                     !4
         31        SEND_VAR                                                     !6
         32        DO_ICALL                                             $30     
         33        ASSIGN                                                       !7, $30
   14    34      > FE_RESET_R                                           $32     !7, ->62
         35    > > FE_FETCH_R                                                   $32, !8, ->62
   15    36    >   INIT_METHOD_CALL                                             !0, 'get_results'
         37        ROPE_INIT                                         5  ~34     'select+%2A+from+'
         38        ROPE_ADD                                          1  ~34     ~34, !3
         39        ROPE_ADD                                          2  ~34     ~34, '+WHERE+pa_menu_endpoint%3D%27'
         40        ROPE_ADD                                          3  ~34     ~34, !8
         41        ROPE_END                                          4  ~33     ~34, '%27'
         42        SEND_VAL_EX                                                  ~33
         43        DO_FCALL                                          0  $37     
         44        ASSIGN                                                       !9, $37
   16    45      > FE_RESET_R                                           $39     !9, ->50
         46    > > FE_FETCH_R                                                   $39, !10, ->50
   17    47    >   FETCH_OBJ_R                                          ~40     !10, 'pa_menu_endpoint'
         48        FREE                                                         ~40
   16    49      > JMP                                                          ->46
         50    >   FE_FREE                                                      $39
   18    51        BOOL_NOT                                             ~41     !9
         52      > JMPZ                                                         ~41, ->61
   19    53    >   INIT_METHOD_CALL                                             !0, 'query'
         54        ROPE_INIT                                         5  ~43     '+INSERT+INTO+%60'
         55        ROPE_ADD                                          1  ~43     ~43, !3
         56        ROPE_ADD                                          2  ~43     ~43, '%60+%28%60pa_menu_endpoint%60%2C+%60pa_menu_from%60%29+VALUES+%28%27'
         57        ROPE_ADD                                          3  ~43     ~43, !8
         58        ROPE_END                                          4  ~42     ~43, '%27%2C+%27wc%27%29'
         59        SEND_VAL_EX                                                  ~42
         60        DO_FCALL                                          0          
   14    61    > > JMP                                                          ->35
         62    >   FE_FREE                                                      $32
   21    63      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aXWeg
function name:  {closure:/in/aXWeg:9}
number of ops:  4
compiled vars:  !0 = $item
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV                                                 !0      
   10     1        FETCH_OBJ_R                                          ~1      !0, 'pa_menu_endpoint'
          2      > RETURN                                                       ~1
   11     3*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
153.59 ms | 1744 KiB | 16 Q