3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Mini-cart * * Contains the markup for the mini-cart, used by the cart widget. * * This template can be overridden by copying it to yourtheme/woocommerce/cart/mini-cart.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://docs.woocommerce.com/document/template-structure/ * @author WooThemes * @package WooCommerce/Templates * @version 3.1.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; } do_action( 'woocommerce_before_mini_cart' ); ?> <?php if ( ! WC()->cart->is_empty() ) : ?> <ul class="woocommerce-mini-cart cart_list product_list_widget <?php echo esc_attr( $args['list_class'] ); ?>"> <?php do_action( 'woocommerce_before_mini_cart_contents' ); foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key ); $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key ); if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_widget_cart_item_visible', true, $cart_item, $cart_item_key ) ) { $product_name = apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ); $thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key ); $product_price = apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key ); $product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key ); ?> <li class="woocommerce-mini-cart-item <?php echo esc_attr( apply_filters( 'woocommerce_mini_cart_item_class', 'mini_cart_item', $cart_item, $cart_item_key ) ); ?>"> <?php echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf( '<a href="%s" class="remove" aria-label="%s" data-product_id="%s" data-product_sku="%s">&times;</a>', esc_url( WC()->cart->get_remove_url( $cart_item_key ) ), __( 'Remove this item', 'woocommerce' ), esc_attr( $product_id ), esc_attr( $_product->get_sku() ) ), $cart_item_key ); ?> <?php if ( ! $_product->is_visible() ) : ?> <?php echo str_replace( array( 'http:', 'https:' ), '', $thumbnail ) . $product_name . '&nbsp;'; ?> <?php else : ?> <a href="<?php echo esc_url( $product_permalink ); ?>"> <?php echo str_replace( array( 'http:', 'https:' ), '', $thumbnail ) . $product_name . '&nbsp;'; ?> </a> <?php endif; ?> <?php echo WC()->cart->get_item_data( $cart_item ); ?> <?php echo apply_filters( 'woocommerce_widget_cart_item_quantity', '<span class="quantity">' . sprintf( '%s &times; %s', $cart_item['quantity'], $product_price ) . '</span>', $cart_item, $cart_item_key ); ?> </li> <?php } } do_action( 'woocommerce_mini_cart_contents' ); ?> </ul> <p class="woocommerce-mini-cart__total total"><strong><?php _e( 'Subtotal', 'woocommerce' ); ?>:</strong> <?php echo WC()->cart->get_cart_subtotal(); ?></p> <?php do_action( 'woocommerce_widget_shopping_cart_before_buttons' ); ?> <p class="woocommerce-mini-cart__buttons buttons"><?php do_action( 'woocommerce_widget_shopping_cart_buttons' ); ?></p> <?php else : ?> <p class="woocommerce-mini-cart__empty-message"><?php _e( 'No products in the cart.', 'woocommerce' ); ?></p> <?php endif; ?> <?php do_action( 'woocommerce_after_mini_cart' ); ?>

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.0130.01017.00
8.3.50.0040.01116.30
8.3.40.0190.00318.89
8.3.30.0140.00418.67
8.3.20.0110.00420.28
8.3.10.0030.01221.76
8.3.00.0030.00717.66
8.2.180.0120.00618.41
8.2.170.0190.00322.96
8.2.160.0130.00022.25
8.2.150.0100.01024.18
8.2.140.0090.00624.66
8.2.130.0060.01020.93
8.2.120.0090.00626.35
8.2.110.0030.00619.52
8.2.100.0000.01118.34
8.2.90.0040.00419.30
8.2.80.0040.00418.04
8.2.70.0000.00817.61
8.2.60.0080.00017.80
8.2.50.0040.00418.10
8.2.40.0080.00022.30
8.2.30.0040.00421.09
8.2.20.0050.00218.04
8.2.10.0030.00618.16
8.2.00.0040.00418.20
8.1.280.0070.01125.92
8.1.270.0060.00323.91
8.1.260.0060.00326.35
8.1.250.0030.00528.09
8.1.240.0040.00423.84
8.1.230.0080.00317.52
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00617.48
8.1.190.0080.00017.36
8.1.180.0000.00818.10
8.1.170.0080.00018.71
8.1.160.0000.01119.06
8.1.150.0000.00718.80
8.1.140.0000.00719.61
8.1.130.0000.00718.90
8.1.120.0040.00417.58
8.1.110.0050.00217.54
8.1.100.0000.00817.35
8.1.90.0000.00817.51
8.1.80.0000.00817.44
8.1.70.0050.00217.46
8.1.60.0070.00017.62
8.1.50.0000.00817.57
8.1.40.0050.00217.46
8.1.30.0040.00417.72
8.1.20.0040.00417.75
8.1.10.0050.00317.47
8.1.00.0040.00417.44
8.0.300.0030.00518.77
8.0.290.0060.00316.75
8.0.280.0040.00418.60
8.0.270.0000.00717.29
8.0.260.0000.00616.84
8.0.250.0040.00416.97
8.0.240.0000.00817.08
8.0.230.0000.00717.13
8.0.220.0050.00217.04
8.0.210.0000.00716.97
8.0.200.0000.00616.95
8.0.190.0040.00417.11
8.0.180.0040.00417.04
8.0.170.0030.00617.05
8.0.160.0050.00316.95
8.0.150.0040.00416.89
8.0.140.0050.00316.85
8.0.130.0050.00013.44
8.0.120.0040.00416.98
8.0.110.0000.00716.87
8.0.100.0030.00617.00
8.0.90.0000.00816.89
8.0.80.0150.00316.99
8.0.70.0030.00516.95
8.0.60.0040.00416.85
8.0.50.0050.00217.02
8.0.30.0060.01017.12
8.0.20.0100.00917.42
8.0.10.0040.00417.16
8.0.00.0080.00916.95
7.4.330.0000.00515.55
7.4.320.0000.00616.57
7.4.300.0030.00316.65
7.4.290.0070.00016.49
7.4.280.0070.00016.66
7.4.270.0030.00316.67
7.4.260.0000.00513.28
7.4.250.0030.00616.46
7.4.240.0000.00716.50
7.4.230.0070.00016.45
7.4.220.0100.01716.64
7.4.210.0120.00316.60
7.4.200.0030.00516.37
7.4.160.0110.00516.51
7.4.150.0060.01217.40
7.4.140.0060.01317.86
7.4.130.0130.00316.40
7.4.120.0070.01416.69
7.4.110.0110.00816.76
7.4.100.0030.01416.62
7.4.90.0140.00516.60
7.4.80.0080.01219.39
7.4.70.0100.00716.61
7.4.60.0120.00316.59
7.4.50.0040.00616.25
7.4.40.0110.01316.50
7.4.30.0190.00816.77
7.4.10.0070.01115.26
7.4.00.0050.01115.20
7.3.330.0000.00813.16
7.3.320.0000.00513.18
7.3.310.0080.00016.36
7.3.300.0040.00416.14
7.3.290.0080.00816.36
7.3.280.0090.00816.32
7.3.270.0140.00317.40
7.3.260.0100.00816.35
7.3.250.0120.01016.39
7.3.240.0190.00516.41
7.3.230.0110.00716.55
7.3.210.0160.00616.39
7.3.200.0040.01316.55
7.3.190.0100.00716.59
7.3.180.0130.00316.26
7.3.170.0060.01316.53
7.3.160.0070.01016.50
7.3.130.0060.01314.93
7.3.120.0060.01214.93
7.3.110.0080.00814.87
7.3.100.0060.00814.98
7.3.90.0060.00715.01
7.3.80.0000.00914.80
7.3.70.0100.00314.83
7.3.60.0070.00714.63
7.3.50.0030.00714.68
7.3.40.0060.00814.86
7.3.30.0060.01014.69
7.3.20.0060.01116.64
7.3.10.0020.01116.59
7.3.00.0060.00816.53
7.2.330.0100.00716.73
7.2.320.0120.00616.43
7.2.310.0060.01216.75
7.2.300.0080.00816.70
7.2.290.0110.01116.63
7.2.260.0040.01514.83
7.2.250.0110.00714.95
7.2.240.0090.00715.05
7.2.230.0070.00814.93
7.2.220.0060.01015.08
7.2.210.0080.00814.96
7.2.200.0110.00514.79
7.2.190.0030.00914.94
7.2.180.0070.00514.98
7.2.170.0070.00814.82
7.2.160.0050.01114.85
7.2.150.0060.00816.62
7.2.140.0070.00816.73
7.2.130.0040.01316.95
7.2.120.0090.00716.66
7.2.110.0040.01016.80
7.2.100.0020.01216.75
7.2.90.0070.00716.79
7.2.80.0050.00916.75
7.2.70.0060.00616.78
7.2.60.0080.00516.67
7.2.50.0100.00516.94
7.2.40.0040.01116.74
7.2.30.0040.00916.89
7.2.20.0090.00516.78
7.2.10.0050.00916.70
7.2.00.0030.01217.46
7.1.330.0060.00715.67
7.1.320.0070.01015.67
7.1.310.0090.00615.74
7.1.300.0020.00915.77
7.1.290.0040.00915.68
7.1.280.0090.00715.56
7.1.270.0050.01115.67
7.1.260.0070.00615.59
7.1.250.0020.01115.74
7.1.240.0090.00615.63
7.1.230.0030.00615.67
7.1.220.0070.00715.36
7.1.210.0000.01315.64
7.1.200.0070.00515.67
7.1.190.0030.00715.80
7.1.180.0000.01315.63
7.1.170.0040.00715.67
7.1.160.0030.00615.85
7.1.150.0040.01215.69
7.1.140.0030.00715.76
7.1.130.0000.00815.56
7.1.120.0060.00615.87
7.1.110.0030.00915.95
7.1.100.0000.01317.00
7.1.90.0060.00615.91
7.1.80.0030.00615.73
7.1.70.0130.00815.52
7.1.60.0170.01024.56
7.1.50.0190.00824.24
7.1.40.0180.01324.11
7.1.30.0320.01124.01
7.1.20.0180.01624.04
7.1.10.0060.01114.98
7.1.00.0130.00515.25
7.0.330.0060.00915.30
7.0.320.0070.00715.55
7.0.310.0080.00615.25
7.0.300.0000.01615.05
7.0.290.0050.00315.11
7.0.280.0100.00615.20
7.0.270.0000.00815.33
7.0.260.0000.00815.35
7.0.250.0090.00615.13
7.0.240.0000.00815.39
7.0.230.0060.00615.52
7.0.220.0030.00515.19
7.0.210.0040.00715.34
7.0.200.0060.01415.01
7.0.190.0090.00815.04
7.0.180.0160.00914.87
7.0.170.0050.01114.95
7.0.160.0080.01014.91
7.0.150.0100.00614.95
7.0.140.0100.00915.04
7.0.130.0110.01114.97
7.0.120.0080.01214.98
7.0.110.0060.01115.01
7.0.100.0120.01014.99
7.0.90.0080.00914.92
7.0.80.0070.01014.98
7.0.70.0050.01214.83
7.0.60.0130.00714.79
7.0.50.0140.00515.05
7.0.40.0270.00814.04
7.0.30.0060.01314.06
7.0.20.0080.01013.99
7.0.10.0100.01013.98
7.0.00.0080.01014.02
5.6.400.0000.01214.39
5.6.390.0030.00714.11
5.6.380.0030.00913.84
5.6.370.0030.00714.46
5.6.360.0030.01014.25
5.6.350.0060.00314.41
5.6.340.0110.00414.37
5.6.330.0090.00314.54
5.6.320.0080.00314.59
5.6.310.0040.01114.52
5.6.300.0060.00914.70
5.6.290.0030.01314.64
5.6.280.0030.01013.96
5.6.270.0090.00614.65
5.6.260.0060.00314.60
5.6.250.0040.00814.45
5.6.240.0060.00614.34
5.6.230.0030.01014.08
5.6.220.0060.00614.45
5.6.210.0000.01514.14
5.6.200.0060.00914.04
5.6.190.0120.00314.63
5.6.180.0100.00614.31
5.6.170.0120.00314.28
5.6.160.0070.00414.17
5.6.150.0000.01214.56
5.6.140.0110.00414.29
5.6.130.0080.00414.57
5.6.120.0030.00714.35
5.6.110.0030.00614.55
5.6.100.0070.01014.29
5.6.90.0040.01114.24
5.6.80.0040.01414.30
5.6.70.0000.01814.09
5.6.60.0040.01114.16
5.6.50.0060.00914.19
5.6.40.0000.01414.15
5.6.30.0060.00614.07
5.6.20.0000.01414.09
5.6.10.0060.00614.16
5.6.00.0110.00314.22

preferences:
34.28 ms | 401 KiB | 5 Q