3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Plugin Name: Smart WP Directory Plugin URI: Description: TODO Description Version: 0.1 Author: hodak Author URI: http://hodak.pl License: TODO */ /* *********** prefix used for pretty much everything: swd_ *********** */ // Cron hook for pending_payment add_action( 'swd_pending_payment_cron_hook', 'swd_cron_for_pending_payment' ); // Cron hook for regular daily checking add_action( 'swd_regular_cron_hook', 'swd_regular_cron' ); register_activation_hook( __FILE__, 'swd_activate' ); register_deactivation_hook( __FILE__, 'swd_deactivate' ); // custom post type and taxonomies // I also add here regular cron add_action( 'init', 'swd_custom_post_types_and_tax' ); // styles and scripts add_action( 'wp_enqueue_scripts', 'swd_add_stylesheets_and_scripts' ); // cleaning needed for google maps api, it's better not to ask add_filter( 'clean_url', 'so_handle_038', 99, 3 ); add_action( 'init', 'app_output_buffer' ); add_filter( 'login_redirect', 'swd_redirect_after_login', 10, 3 ); // pages needed for plugin - user-panel, paypal etc. add_action( 'init', 'swd_include_pages' ); add_action( 'init', 'swd_hide_admin_bar' ); // dev todo add_action( 'init', 'swd_todo_dev_init' ); // Hooks when publishing swd_record: adding start and end date. add_action('new_to_publish', 'swd_run_when_published'); add_action('draft_to_publish', 'swd_run_when_published'); add_action('pending_to_publish', 'swd_run_when_published'); // Hook before deleting post - we also need to delete media add_action( 'before_delete_post', 'swd_before_delete_post' ); // Redirecting certain templates to plugin templates add_filter( 'page_template', 'swd_page_templates' ); add_filter( 'template_include', 'swd_templates' ); // Fix pagination add_filter( 'pre_get_posts', 'swd_modify_archive_query' ); function swd_activate() { // Company role with some capabilities for swd_record /* *** VERY IMPORTANT SECURITY NOTE *** We also give capability 'upload_files'. This is potentially very serious security issue - be extra cautious. This capability is unfortunately necessary for uploading photos. *** END OF VERY IMPORTANT SECURITY NOTE *** */ swd_add_company_role(); // Create User Panel Page on first activation if( false == get_option( 'swd_general_options' ) ) { $user_panel_id = wp_insert_post( array( 'post_type' => 'page', 'post_title' => 'User Panel', 'post_status' => 'publish', ) ); // Create main directory page for viewing $swd_directory_page = wp_insert_post( array( 'post_type' => 'page', 'post_title' => 'Companies', 'post_status' => 'publish', ) ); // Add default settings $default_general_options = array( 'user_panel' => $user_panel_id, 'directory_page' => $swd_directory_page, 'posts_per_page' => 10, 'excerpt_length' => 100, 'description_length' => 500, 'gmaps_api' => '', 'currency_code' => 'USD', // PayPal ); add_option( 'swd_general_options', $default_general_options ); } if( false == get_option( 'swd_payment_options' ) ) { $default_payment_options = array( 'paypal_username' => '', 'paypal_password' => '', 'paypal_signature' => '', 'paypal_mode' => false, ); add_option( 'swd_payment_options', $default_payment_options ); }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.130.0030.08016.45
5.4.120.0100.06716.46
5.4.110.0130.06716.39
5.4.100.0100.05316.50
5.4.90.0000.07716.43
5.4.80.0000.06016.37
5.4.70.0100.07316.45
5.4.60.0070.05016.46
5.4.50.0030.07316.38
5.4.40.0070.05316.43
5.4.30.0100.07016.45
5.4.20.0100.04716.36
5.4.10.0100.07016.64
5.4.00.0030.05315.71
5.3.230.0130.06714.64
5.3.220.0000.05314.61
5.3.210.0100.06014.59
5.3.200.0030.08014.63
5.3.190.0030.07714.60
5.3.180.0130.06314.59
5.3.170.0030.07714.61
5.3.160.0070.04714.65
5.3.150.0000.05314.59
5.3.140.0100.07714.60
5.3.130.0000.05314.59
5.3.120.0000.05714.57
5.3.110.0000.08014.58
5.3.100.0100.05014.20
5.3.90.0070.07714.06
5.3.80.0030.06013.98
5.3.70.0130.04714.07
5.3.60.0030.04014.09
5.3.50.0070.07013.96
5.3.40.0070.04014.01
5.3.30.0070.04013.93
5.3.20.0070.03313.73
5.3.10.0070.07013.61
5.3.00.0070.04313.65

preferences:
141.43 ms | 1386 KiB | 7 Q