3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /** * Get meta values * * @return array */ public static function get_meta_values( $key = '', $type = 'resume', $status = 'publish' ) { global $wpdb; if( empty( $key ) ) return; $r = $wpdb->get_results( $wpdb->prepare( " SELECT p.ID, pm.meta_value FROM {$wpdb->postmeta} pm LEFT JOIN {$wpdb->posts} p ON p.ID = pm.post_id WHERE pm.meta_key = '%s' AND p.post_status = '%s' AND p.post_type = '%s' ", $key, $status, $type )); $metas = []; foreach ($r as $my_r) { $metas[$my_r->ID] = is_serialized($my_r->meta_value) ? unserialize($my_r->meta_value) : $my_r->meta_value; } return $metas; } /** * Get active languages for filter * * @return array */ public static function get_active_languages() { $language_metas = self::get_meta_values('resume_other_langs'); $languages = []; foreach ($language_metas as $active_languages) { if (count($active_languages) > 0) { foreach ($active_languages as $active_language) { $languages[] = $active_language['resume_other_lang_name'].' : '.$active_language['resume_other_lang_know']; } } } $languages = array_unique($languages); return $languages; }
based on BQ793
Output for 7.0.0 - 7.1.7
Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting end of file in /in/Xl4aq on line 8
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Invalid modifier on function get_meta_values. in /in/Xl4aq:28 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /in/Xl4aq on line 8
Process exited with code 255.