3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* ============== ListingPro create pages ============ */ add_action('admin_init','check_pages_live'); if (!function_exists('check_pages_live')) { function check_pages_live(){ if ( class_exists( 'Redux' ) ) { global $listingpro_options; global $opt_name; $opt_name = 'listingpro_options'; $pricing_plan = $listingpro_options['pricing-plan']; $submit_listing = $listingpro_options['submit-listing']; $listing_author = $listingpro_options['listing-author']; if(empty($pricing_plan) && empty($submit_listing) && empty($listing_author) && empty($payment_checkout) && empty($payment_fail)){ create_page_if_null('Dashboard', '', 'listing-author'); create_page_if_null('Submit Your Listing', '[vc_row row_type="row_full_center_content" bg_color="#eff3f6" bg_repeat="no-repeat" bg_attatch="scroll"][vc_column][listingpro_submit title="Add your Listing" subtitle="Add details about your listing"][/vc_column][/vc_row]', 'submit-listing'); create_page_if_null('Edit Your Listing', '[vc_row row_type="row_full_center_content" bg_color="#eff3f6" bg_repeat="no-repeat" bg_attatch="scroll"][vc_column][listingpro_edit title="Edit your Listing" subtitle="Edit details about your listing"][/vc_column][/vc_row]', 'edit-listing'); create_page_if_null('Select Your Plan', '[vc_row row_type="row_full_center_content" bg_color="#eff3f6" bg_repeat="no-repeat" bg_attatch="scroll"][vc_column][listingpro_pricing title="Add your Listing" subtitle="Add details about your listing"][/vc_column][/vc_row]', 'pricing-plan'); create_page_if_null('Select Payment Gateway', '[vc_row row_type="row_full_center_content" bg_color="#eff3f6" bg_repeat="no-repeat" bg_attatch="scroll"][vc_column][listingpro_p_gateways][/vc_column][/vc_row]', 'payment-gateway'); create_page_if_null('Payment Success', '', 'payment-success'); create_page_if_null('Payment Fail', '', 'payment-fail'); create_page_if_null('Payment Checkout', '[vc_row row_type="row_full_center_content" bg_color="#eff3f6" bg_repeat="no-repeat" bg_attatch="scroll"][vc_column][listingpro_checkout title="See listings and pay" subtitle="Select your listings and payment method to proceed"][/vc_column][/vc_row]', 'payment-checkout'); } } } } add_action('admin_init','check_set_options'); if (!function_exists('check_set_options')) { function check_set_options(){ $counter = 0; if ( class_exists( 'Redux' ) ) { global $listingpro_options; global $opt_name; $opt_name = 'listingpro_options'; $pricing_plan = $opt_name['pricing-plan']; $submit_listing = $opt_name['submit-listing']; $edit_listing = $opt_name['edit-listing']; $listing_author = $opt_name['listing-author']; $payment_checkout = $opt_name['payment-checkout']; if(empty($listing_author)){ if( get_page_by_title('Dashboard') != NULL ) { $page = get_page_by_title('Dashboard'); $permalink = get_permalink($page->ID); $status = get_post_status( $page->ID ); if($status == 'publish'){ Redux::setOption( $opt_name, 'listing-author', $permalink); } } } if(empty($submit_listing)){ if( get_page_by_title('Submit Your Listing') != NULL ) { $page = get_page_by_title('Submit Your Listing'); $permalink = get_permalink($page->ID); $status = get_post_status( $page->ID ); if($status == 'publish'){ Redux::setOption( $opt_name, 'submit-listing', $permalink); } } } if(empty($edit_listing)){ if( get_page_by_title('Edit Your Listing') != NULL ) { $page = get_page_by_title('Edit Your Listing'); $permalink = get_permalink($page->ID); $status = get_post_status( $page->ID ); if($status == 'publish'){ Redux::setOption( $opt_name, 'edit-listing', $permalink); } } } if(empty($pricing_plan)){ if( get_page_by_title('Select Your Plan') != NULL ) { $page = get_page_by_title('Select Your Plan'); $permalink = get_permalink($page->ID); $status = get_post_status( $page->ID ); if($status == 'publish'){ Redux::setOption( $opt_name, 'pricing-plan', $permalink); } } } if(empty($payment_checkout)){ if( get_page_by_title('Payment Checkout') != NULL ) { $page = get_page_by_title('Payment Checkout'); $permalink = $page->ID; $status = get_post_status( $page->ID ); if($status == 'publish'){ Redux::setOption( $opt_name, 'payment-checkout', $permalink); } } } } } } if (!function_exists('create_page_if_null')) { function create_page_if_null($target,$content,$slug) { if( get_page_by_title($target) == NULL ) { listingpro_create_pages($target,$content,$slug); } } } if (!function_exists('listingpro_create_pages')) { function listingpro_create_pages($pageName,$content,$slug) { $createPage = array( 'post_title' => $pageName, 'post_content' => $content, 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'page', 'post_name' => $slug ); if($slug == 'listing-author'){ $createPage = array( 'post_title' => $pageName, 'post_content' => $content, 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'page', 'post_name' => $slug, 'page_template' => 'template-dashboard.php' ); } if($slug == 'payment-success'){ $createPage = array( 'post_title' => $pageName, 'post_content' => $content, 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'page', 'post_name' => $slug, 'page_template' => 'templates/template-payment-thankyou.php' ); } if($slug == 'payment-fail'){ $createPage = array( 'post_title' => $pageName, 'post_content' => $content, 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'page', 'post_name' => $slug, 'page_template' => 'templates/template-payment-cancel.php' ); } // Insert the post into the database wp_insert_post( $createPage ); } }

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)
8.3.60.0120.00618.48
8.3.50.0150.00616.61
8.3.40.0090.00618.78
8.3.30.0110.00418.72
8.3.20.0040.00420.43
8.3.10.0000.00721.72
8.3.00.0040.00418.05
8.2.180.0000.01518.54
8.2.170.0090.00922.96
8.2.160.0140.00721.05
8.2.150.0090.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00322.14
8.2.120.0030.00626.35
8.2.110.0060.00320.65
8.2.100.0000.01118.03
8.2.90.0030.00517.75
8.2.80.0000.00818.77
8.2.70.0030.00617.75
8.2.60.0100.00317.47
8.2.50.0040.00418.16
8.2.40.0060.00319.35
8.2.30.0040.00419.23
8.2.20.0030.00518.15
8.2.10.0040.00418.34
8.2.00.0050.00218.28
8.1.280.0110.00725.92
8.1.270.0040.00423.91
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0070.00418.88
8.1.230.0040.00820.84
8.1.220.0000.00818.61
8.1.210.0040.00418.77
8.1.200.0040.00417.22
8.1.190.0060.00317.35
8.1.180.0000.00818.10
8.1.170.0000.00817.62
8.1.160.0040.00418.92
8.1.150.0060.00321.82
8.1.140.0040.00419.59
8.1.130.0000.00718.95
8.1.120.0000.00817.46
8.1.110.0030.00617.32
8.1.100.0040.00417.47
8.1.90.0040.00417.46
8.1.80.0000.00717.32
8.1.70.0030.00317.47
8.1.60.0000.00817.51
8.1.50.0080.00017.53
8.1.40.0060.00317.45
8.1.30.0000.00817.73
8.1.20.0050.00317.72
8.1.10.0040.00417.61
8.1.00.0040.00417.59
8.0.300.0000.00718.77
8.0.290.0030.00716.88
8.0.280.0040.00418.54
8.0.270.0070.00016.79
8.0.260.0040.00419.10
8.0.250.0070.00016.97
8.0.240.0070.00016.93
8.0.230.0040.00417.08
8.0.220.0040.00416.97
8.0.210.0070.00017.01
8.0.200.0040.00417.08
8.0.190.0000.01117.05
8.0.180.0040.00416.91
8.0.170.0000.00716.91
8.0.160.0050.00217.00
8.0.150.0070.00016.84
8.0.140.0000.00716.95
8.0.130.0000.00813.34
8.0.120.0000.00716.87
8.0.110.0000.00716.97
8.0.100.0080.00017.05
8.0.90.0000.00716.97
8.0.80.0090.01317.00
8.0.70.0030.00617.02
8.0.60.0040.00417.05
8.0.50.0000.00816.94
8.0.30.0140.00617.15
8.0.20.0140.00517.40
8.0.10.0040.00417.07
8.0.00.0090.00916.73
7.4.330.0000.00515.55
7.4.320.0000.01016.52
7.4.300.0040.00416.55
7.4.290.0100.00016.41
7.4.280.0050.00316.57
7.4.270.0070.00016.68
7.4.260.0060.00616.62
7.4.250.0040.00416.52
7.4.240.0040.00416.54
7.4.230.0040.00416.45
7.4.220.0170.00916.67
7.4.210.0120.00316.57
7.4.200.0040.00416.65
7.4.160.0070.01016.49
7.4.150.0070.01017.40
7.4.140.0150.00817.86
7.4.130.0120.00816.53
7.4.120.0090.01116.46
7.4.110.0070.01416.74
7.4.100.0070.01116.78
7.4.90.0100.01016.51
7.4.80.0090.01419.39
7.4.70.0090.00916.61
7.4.60.0170.00316.51
7.4.50.0000.01616.57
7.4.40.0080.00916.63
7.4.30.0130.00316.53
7.4.00.0030.01314.98
7.3.330.0000.00513.18
7.3.320.0000.00513.27
7.3.310.0050.00216.36
7.3.300.0030.00316.46
7.3.290.0080.00616.35
7.3.280.0100.00716.39
7.3.270.0070.01017.40
7.3.260.0160.00516.59
7.3.250.0110.01016.44
7.3.240.0100.00916.61
7.3.230.0070.01316.73
7.3.210.0080.00916.42
7.3.200.0070.01016.41
7.3.190.0130.00316.56
7.3.180.0040.01216.50
7.3.170.0090.00916.70
7.3.160.0160.00716.43
7.3.10.0000.01216.64
7.3.00.0070.00716.59
7.2.330.0120.00616.56
7.2.320.0030.01916.66
7.2.310.0080.00916.72
7.2.300.0120.00416.56
7.2.290.0100.00716.36
7.2.130.0100.00716.81
7.2.120.0040.01116.52
7.2.110.0040.00716.92
7.2.100.0000.01316.78
7.2.90.0000.01516.73
7.2.80.0070.01016.49
7.2.70.0070.01016.41
7.2.60.0050.00916.52
7.2.50.0100.00316.56
7.2.40.0030.00916.71
7.2.30.0060.00616.88
7.2.20.0060.00616.56
7.2.10.0060.00916.69
7.2.00.0040.01018.14
7.1.250.0070.00715.75
7.1.200.0040.00715.59
7.1.70.0000.01016.98
7.1.60.0000.01217.19
7.1.50.0150.01016.57
7.1.40.0200.01034.11
7.1.30.0130.01734.16
7.1.20.0270.00734.46
7.1.10.0030.01016.18
7.1.00.0070.00716.55
7.0.200.0100.00716.51
7.0.180.0070.00715.96
7.0.170.0030.01015.98
7.0.160.0070.00715.95
7.0.150.0030.01016.05
7.0.140.0070.01016.02
7.0.130.0030.00716.29
7.0.120.0000.01716.39
7.0.110.0000.01316.03
7.0.100.0070.00715.90
7.0.90.0000.01316.21
7.0.80.0070.01015.93
7.0.70.0070.00716.03
7.0.60.0070.00716.09
7.0.50.0030.01016.32
7.0.40.0000.01316.29
7.0.30.0030.00716.20
7.0.20.0000.01316.36
7.0.10.0100.00316.24
7.0.00.0070.00716.11

preferences:
63.12 ms | 401 KiB | 5 Q