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'"); // if you are only going to use `pa_menu_endpoint`, then don't select everything via * foreach ($result as $row) $row->pa_menu_endpoint; // there is no assignment or usage in this line; this line is doing nothing. if (!$result) { // "if (!$result) {" will never be true here; maybe you intend for this to be: "if (!$row->pa_menu_endpoint) {" $wpdb->query(" INSERT INTO `$phantom_menu` (`pa_menu_endpoint`, `pa_menu_from`) VALUES ('$wcendpoint', 'wc')"); } } }
Output for git.master, git.master_jit
Parse error: Unmatched '}' in /in/gRnt3 on line 22
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
45.83 ms | 695 KiB | 3 Q