3v4l.org

run code in 300+ PHP versions simultaneously
<?php get_header(); ?> <?php $tag = get_queried_object(); ?> <?php if($tag) : ?> <!-- Page Title --> <section id="home" class="xl-py t-center white fullwidth"> <!-- Background image - you can choose parallax ratio and offset --> <div class="bg-parallax" data-stellar-ratio="0.76" data-stellar-vertical-offset="0" data-background="<?php echo get_theme_file_uri('/assets/images/backgrounds/background_1.jpg'); ?>"></div> <!-- Container --> <div class="container relative"> <div class="white skrollr" data-0="opacity:1; transform:translateY(0px);" data-700="opacity:0; transform:translateY(220px);"> <h5 class="gray4">Продукты по категорию</h5> <h1 class="firasans lh-sm"><?php echo mb_strtoupper($tag->name); ?></h1> </div> </div> <!-- End Container --> </section> <!-- End Page Title --> <?php endif; ?> <!-- BLOG --> <section id="blog" class="bb-blog post-radius gray6 post-shadow lh-lg py bg-gray2"> <!-- Container for top elements --> <div class="container blog-utilities sm-pb t-center"> <div class="row clearfix"> <!-- Search Form --> <div class="col-md-8 col-md-offset-1 col-sm-9 col-xs-12"> <div class="cbp-search fullwidth no-mb"> <input id="search-post" type="text" placeholder="Поиск по название" autocomplete="off" data-search="h4" class="cbp-search-input bg-gray3 classic_form big radius-lg slow dark"> <div class="cbp-search-nothing">Нет результатов для <i>{{query}}</i></div> </div> </div> <!-- End Search Form --> <!-- Utilities --> <div class="col-md-3 col-sm-3 col-xs-12 t-left t-center-xs xxs-pt-mobile"> <div class="row clearfix"> <?php $args = array( 'taxonomy' => 'product_category', 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => true, ); $the_query = new WP_Term_Query($args); ?> <!-- Filters Category --> <div id="tags" class="dropdown drop-effect drop-icon"> <button class="dropdown-toggle extrabold font-10 circle bg-gray3 uppercase gray8 border-gray3 bg-colored-hover border-colored-hover white-hover slow" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Фильтр </button> <ul class="dropdown-menu font-12 normal black" aria-labelledby="dropdownMenu2"> <li data-filter="*" class="cbp-filter-item-active cbp-filter-item" ><div class="link">Все</div></li> <?php foreach($the_query->get_terms() as $term) : ?> <li data-filter=".<?php echo mb_strtolower($term->name); ?>" class="cbp-filter-item" ><div class="link"><?php echo $term->name; ?></div></li> <?php endforeach; ?> </ul> </div> </div> </div> <!-- End Utilities --> </div> </div> <!-- End Container for top elements --> <?php $searchProductsByCategory = [ 'posts_per_page' => 1, 'post_type' => 'product', 'ignore_sticky_posts' => 1, 'orderby' => 'id', 'tax_query' => [ [ 'taxonomy' => 'product_category', 'terms' => get_queried_object_id() ] ] ]; $foundProducts = new WP_Query($searchProductsByCategory); ?> <?php if($foundProducts->have_posts()) : ?> <!-- Container for posts --> <div class="container"> <!-- Blog Posts --> <div id="babolo-posts" class="cbp"> <?php while($foundProducts->have_posts()) : $foundProducts->the_post(); ?> <?php $productCategories = wp_get_object_terms(get_the_ID(), 'product_category'); $categories = []; $implodedCategoriesArray = []; $implodedSearchCategoriesArray = []; if(!empty($productCategories)) { if(!is_wp_error($productCategories)) { foreach($productCategories as $category) { $categories[] = $category; $implodedCategoriesArray[] = mb_strtoupper($category->name); $implodedSearchCategoriesArray[] = mb_strtolower($category->name); } $implodedCategories = implode(", ", $implodedCategoriesArray); $implodeForSearch = implode(" ", $implodedSearchCategoriesArray); } } $image = get_field('image')['sizes']['product'] ?? "no-image"; ?> <!-- Post --> <a href="<?php the_permalink(); ?>" class="cbp-item <?php echo $implodeForSearch ?? null; ?> radius"> <div> <img src="<?php echo $image; ?>" alt=""> </div> <!-- Post Texts --> <div class="xs-px xs-py xs-px-mobile bg-white bs-sm"> <!-- Title --> <h4 class="bold-subtitle dark"><?php the_title(); ?></h4> <!-- Sender, Tag, comments --> <p class="font-11"> Автор: <span class="underline-hover"><?php the_author(); ?></span> | <?php echo $implodedCategories ?? null; ?> </p> <!-- Post Message --> <p class="xxs-mt"> <?php the_excerpt(); ?> </p> </div> </a> <!-- End Post --> <?php endwhile; ?> </div> <!-- End Blog Posts --> </div> <!-- End Container for posts --> <?php endif; ?> <div class="t-center pt"> <!-- Here Your pagination code --> <?php //babolo_full_pagination($foundProducts->max_num_pages); ?> <?php echo paginate_links(array( 'total' => $foundProducts->max_num_pages )); ?> </div> </section> <!-- END BLOG --> <?php // $posts_array = get_posts( // array( // 'posts_per_page' => 1, // 'post_type' => 'product', // 'tax_query' => array( // array( // 'taxonomy' => 'product_category', // 'field' => 'term_id', // 'terms' => get_queried_object_id(), // ) // ) // ) // ); ?> <?php // $paged = get_query_var('paged') ? get_query_var('paged') : 1; // $the_query = new WP_Query( array( // 'post_type' => 'product', // 'posts_per_page' => 1, // 'paged' => $paged, // 'tax_query' => array( // array ( // 'taxonomy' => 'product_category', // 'terms' => get_queried_object_id() // ) // ), // ) ); // while ( $the_query->have_posts() ) : // $the_query->the_post(); // echo "<p>".the_title()."</p>"; // endwhile; /* Restore original Post Data * NB: Because we are using new WP_Query we aren't stomping on the * original $wp_query and it does not need to be reset. */ // wp_reset_postdata(); // babolo_full_pagination($the_query->max_num_pages); ?> <?php get_footer(); ?>

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.4.120.0120.00822.30
8.4.110.0120.01219.00
8.4.100.0140.00717.71
8.4.90.0100.00620.86
8.4.80.0150.00517.95
8.4.70.0110.01118.37
8.4.60.0100.00918.93
8.4.50.0080.00119.05
8.4.40.0060.00617.79
8.4.30.0060.01317.63
8.4.20.0140.00720.50
8.4.10.0170.00318.16
8.3.250.0140.00519.00
8.3.240.0110.00916.93
8.3.230.0120.00816.90
8.3.220.0120.00618.87
8.3.210.0090.00816.81
8.3.200.0090.00316.91
8.3.190.0100.01017.10
8.3.180.0110.00816.76
8.3.170.0120.00616.81
8.3.160.0120.00616.73
8.3.150.0130.00617.42
8.3.140.0060.00319.15
8.3.130.0070.01117.01
8.3.120.0090.00020.50
8.3.110.0040.00416.75
8.3.100.0060.00324.06
8.3.90.0040.00426.77
8.3.80.0000.01017.97
8.3.70.0060.01018.46
8.3.60.0150.00018.39
8.3.50.0100.01017.47
8.3.40.0150.00318.98
8.3.30.0110.00418.90
8.3.20.0040.00418.76
8.3.10.0080.00021.73
8.3.00.0000.00823.71
8.2.290.0130.00716.93
8.2.280.0080.00218.68
8.2.270.0060.01316.70
8.2.260.0080.00019.05
8.2.250.0110.01116.63
8.2.240.0030.00619.09
8.2.230.0090.00020.94
8.2.220.0040.00437.54
8.2.210.0130.00626.77
8.2.200.0030.00616.63
8.2.190.0110.00418.62
8.2.180.0120.00318.41
8.2.170.0180.00322.96
8.2.160.0110.00322.13
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00821.07
8.2.120.0000.00826.35
8.2.110.0000.00919.44
8.2.100.0080.00417.84
8.2.90.0040.00419.51
8.2.80.0050.00317.97
8.2.70.0040.00417.63
8.2.60.0080.00017.63
8.2.50.0050.00317.63
8.2.40.0080.00020.93
8.2.30.0040.00420.70
8.2.20.0040.00418.20
8.2.10.0050.00317.98
8.2.00.0000.00818.14
8.1.330.0090.00920.38
8.1.320.0080.00216.41
8.1.310.0120.00616.93
8.1.300.0120.00618.57
8.1.290.0090.00030.84
8.1.280.0150.00025.92
8.1.270.0000.00820.35
8.1.260.0090.00026.35
8.1.250.0030.00528.09
8.1.240.0060.00320.81
8.1.230.0000.01220.97
8.1.220.0060.00317.74
8.1.210.0070.00419.02
8.1.200.0060.00317.47
8.1.190.0050.00317.35
8.1.180.0000.00818.10
8.1.170.0060.00318.70
8.1.160.0040.00418.93
8.1.150.0040.00418.83
8.1.140.0040.00420.59
8.1.130.0030.00320.35
8.1.120.0050.00217.34
8.1.110.0000.00717.39
8.1.100.0040.00417.33
8.1.90.0000.00717.35
8.1.80.0040.00417.36
8.1.70.0000.00717.31
8.1.60.0050.00317.45
8.1.50.0080.00017.57
8.1.40.0080.00017.56
8.1.30.0000.00917.59
8.1.20.0040.00417.71
8.1.10.0050.00217.68
8.1.00.0040.00817.41
8.0.300.0000.00719.98
8.0.290.0000.00816.88
8.0.280.0000.00818.43
8.0.270.0040.00417.21
8.0.260.0030.00320.18
8.0.250.0030.00317.03
8.0.240.0000.00817.00
8.0.230.0030.00317.03
8.0.220.0000.00716.89
8.0.210.0070.00017.03
8.0.200.0000.00617.08
8.0.190.0040.00417.10
8.0.180.0060.00317.03
8.0.170.0080.00017.04
8.0.160.0060.00316.97
8.0.150.0040.00316.89
8.0.140.0040.00417.00
8.0.130.0000.00613.42
8.0.120.0040.00417.02
8.0.110.0000.00816.93
8.0.100.0020.00517.04
8.0.90.0050.00316.98
8.0.80.0090.01316.98
8.0.70.0000.00716.93
8.0.60.0040.00417.02
8.0.50.0000.00816.95
8.0.30.0100.00717.27
8.0.20.0060.01217.40
8.0.10.0040.00417.02
8.0.00.0060.01216.90
7.4.330.0000.00515.55
7.4.320.0060.00016.58
7.4.300.0060.00016.67
7.4.290.0040.00416.55
7.4.280.0000.00816.63
7.4.270.0000.00816.69
7.4.260.0040.00416.43
7.4.250.0070.00016.47
7.4.240.0040.00416.66
7.4.230.0000.00716.58
7.4.220.0050.00316.34
7.4.210.0080.00716.58
7.4.200.0030.00316.52
7.4.160.0070.01016.60
7.4.140.0100.00817.86
7.4.130.0090.00916.63
7.4.120.0110.01016.58
7.4.110.0040.01816.73
7.4.100.0030.01816.61
7.4.90.0090.00916.57
7.4.80.0130.00319.39
7.4.70.0170.01116.66
7.4.60.0100.00716.60
7.4.50.0070.01116.56
7.4.40.0160.00616.40
7.4.00.0000.01215.02
7.3.330.0060.00013.11
7.3.320.0000.00613.25
7.3.310.0040.00416.43
7.3.300.0030.00316.36
7.3.290.0000.00716.27
7.3.280.0090.00916.31
7.3.260.0080.01216.41
7.3.240.0070.01416.40
7.3.230.0100.00716.49
7.3.210.0130.00616.65
7.3.200.0060.01316.43
7.3.190.0100.00716.26
7.3.180.0100.00716.54
7.3.170.0070.01416.39
7.3.160.0150.00616.66
7.3.120.0130.00614.79
7.3.110.0100.01014.89
7.3.100.0030.01014.71
7.3.90.0000.01314.76
7.3.80.0070.00714.75
7.3.70.0030.01414.63
7.3.60.0040.00814.88
7.3.50.0130.00014.79
7.3.40.0080.00314.32
7.3.30.0030.01014.74
7.3.20.0040.00916.39
7.3.10.0120.00316.49
7.3.00.0000.01316.36
7.2.330.0160.00316.70
7.2.320.0090.01016.59
7.2.310.0030.01316.44
7.2.300.0070.01116.76
7.2.290.0080.00816.32
7.2.240.0000.01515.18
7.2.230.0030.01315.17
7.2.220.0030.01315.17
7.2.210.0040.01114.70
7.2.200.0040.01115.01
7.2.190.0140.00014.90
7.2.180.0040.01115.01
7.2.170.0030.01215.07
7.2.160.0000.01114.67
7.2.150.0070.00716.69
7.2.140.0060.00916.86
7.2.130.0070.00716.45
7.2.120.0110.00416.74
7.2.110.0030.01216.69
7.2.100.2370.00815.74
7.2.90.2570.00515.73
7.2.80.2150.01215.81
7.2.70.2720.01015.79
7.2.60.1600.01215.66
7.2.50.1620.01115.93
7.2.40.1910.00915.69
7.2.30.1980.00815.98
7.2.20.1890.01415.84
7.2.10.2370.00815.67
7.2.00.2420.00815.76
7.1.330.0070.01015.42
7.1.320.0150.00015.74
7.1.310.0100.00315.71
7.1.300.0040.01115.71
7.1.290.0060.00915.60
7.1.280.0040.00715.58
7.1.270.0100.00315.67
7.1.260.0090.00615.65
7.1.250.0000.01015.64
7.1.220.3750.00013.80
7.1.210.4350.01013.81
7.1.200.4640.00013.88
7.1.190.3320.01013.48
7.1.180.2110.00713.85
7.1.170.5190.00713.45
7.1.160.1640.01013.65
7.1.150.3620.00713.76
7.1.140.3670.00313.50
7.1.130.4340.01313.58
7.1.120.4250.01013.46
7.1.110.6050.00613.26
7.1.100.4920.00313.81
7.1.90.4570.00713.76
7.1.80.4680.00713.57
7.1.70.4290.01013.40
7.1.60.4060.01331.52
7.1.50.4560.01331.89
7.1.40.5180.00931.71
7.1.30.6100.00731.61
7.1.20.6610.01631.17
7.1.10.6290.00713.38
7.1.00.4130.00713.73
5.6.380.0130.00913.84

preferences:
29.11 ms | 403 KiB | 5 Q