3v4l.org

run code in 300+ PHP versions simultaneously
<?php function cs_theme_cost_calculator_input_box_shortcode($atts) { extract(shortcode_atts(array( "id" => "input-box", "name" => "input-box", "label" => "", "default_value" => "", "type" => "text", "checked" => "1", "placeholder" => "1", "top_margin" => "none", "el_class" => "" ), $atts)); $output = '<div class="cost-calculator-box clearfix' . ($type=="checkbox" ? ' float' : '') . ($top_margin!="none" ? ' ' . esc_attr($top_margin) : '') . ($el_class!="" ? ' ' . esc_attr($el_class) : '') . '">'; if($type!="checkbox") $output .= '<label>' . $label . '</label>'; $output .= '<input type="hidden" name="' . esc_attr($name) . '-label" value="' . esc_attr($label) . '">'; if($type=="date") $output .= '<div class="datepicker-container"><span class="ui-icon template-arrow-dropdown"></span>'; $output .= '<input id="' . esc_attr($id) . '" class="cost-slider-input big type-' . esc_attr($type) . '" name="' . esc_attr($name) . '" type="' . esc_attr($type) . '"' . ($type=="checkbox" && (int)$checked ? ' checked="checked"' : '') . ' value="' . ($type=="checkbox" && !(int)$checked ? 0 : esc_attr($default_value)) . '" data-value="' . esc_attr($default_value) . '" placeholder="' . esc_attr($placeholder) . '"> ' . ($type=="checkbox" ? '<label class="checkbox-label template-bullet" for="' . esc_attr($id) . '"><span class="checkbox-box"></span>' . $label . '</label>' : ''); if($type=="date") $output .= '</div>'; $output .= '</div>'; return $output; } add_shortcode("cost_calculator_input_box", "cs_theme_cost_calculator_input_box_shortcode"); //visual composer wpb_map( array( "name" => __("Cost calculator input box", 'carservice'), "base" => "cost_calculator_input_box", "class" => "", "controls" => "full", "show_settings_on_create" => true, "icon" => "icon-wpb-layer-cost-calculator-input-box", "category" => __('Carservice', 'carservice'), "params" => array( array( "type" => "textfield", "holder" => "div", "class" => "", "heading" => __("Id", 'carservice'), "param_name" => "id", "value" => "input-box", "description" => __("Please provide unique id for each 'Cost calculator input box' on your page.", 'carservice') ), array( "type" => "textfield", "class" => "", "heading" => __("Input name", 'carservice'), "param_name" => "name", "value" => "input-box" ), array( "type" => "textfield", "class" => "", "heading" => __("Label", 'carservice'), "param_name" => "label", "value" => "" ), array( "type" => "textfield", "class" => "", "heading" => __("Default value", 'carservice'), "param_name" => "default_value", "value" => "" ), array( "type" => "dropdown", "class" => "", "heading" => __("Type", 'carservice'), "param_name" => "type", "value" => array(__("text", 'carservice') => "text", __("number", 'carservice') => "number", __("date", 'carservice') => "date", __("email", 'carservice') => "email", __("checkbox", 'carservice') => "checkbox") ), array( "type" => "dropdown", "class" => "", "heading" => __("Is checked", 'carservice'), "param_name" => "checked", "value" => array(__("yes", 'carservice') => "1", __("no", 'carservice') => "0"), "dependency" => Array('element' => "type", 'value' => "checkbox") ), array( "type" => "textfield", "class" => "", "heading" => __("Placeholder", 'carservice'), "param_name" => "placeholder", "value" => "" ), array( "type" => "dropdown", "class" => "", "heading" => __("Top margin", 'carservice'), "param_name" => "top_margin", "value" => array(__("None", 'carservice') => "none", __("Page (small)", 'carservice') => "page-margin-top", __("Section (large)", 'carservice') => "page-margin-top-section") ), array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( 'If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'js_composer' ) ) ) )); ?>

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.0160.00616.87
8.3.50.0250.00521.20
8.3.40.0070.01119.15
8.3.30.0070.01318.98
8.3.20.0000.00820.09
8.3.10.0000.00821.99
8.3.00.0080.00023.48
8.2.180.0090.00918.54
8.2.170.0170.00022.96
8.2.160.0100.00720.50
8.2.150.0050.00324.18
8.2.140.0070.00724.66
8.2.130.0040.00420.89
8.2.120.0000.00826.35
8.2.110.0070.00319.39
8.2.100.0060.00618.16
8.2.90.0060.00319.21
8.2.80.0040.00417.97
8.2.70.0070.00317.63
8.2.60.0050.00317.91
8.2.50.0030.00618.07
8.2.40.0060.00322.23
8.2.30.0040.00419.42
8.2.20.0040.00417.75
8.2.10.0040.00418.05
8.2.00.0050.00218.04
8.1.280.0070.01425.92
8.1.270.0040.01122.22
8.1.260.0060.00328.09
8.1.250.0000.00728.09
8.1.240.0060.00321.32
8.1.230.0090.00317.52
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0030.00717.35
8.1.190.0060.00317.22
8.1.180.0040.00418.10
8.1.170.0040.00418.63
8.1.160.0030.00620.71
8.1.150.0050.00220.46
8.1.140.0040.00419.64
8.1.130.0000.00717.66
8.1.120.0040.00417.50
8.1.110.0040.00417.41
8.1.100.0000.00717.51
8.1.90.0000.00717.43
8.1.80.0000.00817.46
8.1.70.0000.00817.48
8.1.60.0030.00617.61
8.1.50.0080.00017.58
8.1.40.0030.00517.48
8.1.30.0050.00317.67
8.1.20.0050.00317.76
8.1.10.0040.00417.57
8.1.00.0030.00617.49
8.0.300.0080.00018.77
8.0.290.0070.00016.75
8.0.280.0030.00318.55
8.0.270.0040.00417.33
8.0.260.0000.00717.24
8.0.250.0000.00717.12
8.0.240.0030.00317.05
8.0.230.0070.00017.06
8.0.220.0040.00416.92
8.0.210.0070.00017.01
8.0.200.0030.00317.15
8.0.190.0000.00717.05
8.0.180.0050.00317.06
8.0.170.0050.00317.09
8.0.160.0000.00717.11
8.0.150.0040.00416.87
8.0.140.0040.00416.99
8.0.130.0000.00613.41
8.0.120.0030.00617.04
8.0.110.0040.00417.02
8.0.100.0030.00517.03
8.0.90.0050.00316.83
8.0.80.0030.01116.96
8.0.70.0030.00517.05
8.0.60.0040.00417.03
8.0.50.0000.00717.09
8.0.30.0110.00717.16
8.0.20.0120.00717.40
8.0.10.0040.00417.09
8.0.00.0110.01016.81
7.4.330.0000.00516.83
7.4.320.0000.00616.61
7.4.300.0050.00516.59
7.4.290.0000.00616.59
7.4.280.0080.00316.46
7.4.270.0000.00716.61
7.4.260.0050.00316.59
7.4.250.0030.00516.44
7.4.240.0020.00616.58
7.4.230.0000.00716.37
7.4.220.0090.00916.68
7.4.210.0090.00616.70
7.4.200.0000.00716.75
7.4.160.0000.01516.62
7.4.150.0120.00617.40
7.4.140.0070.01317.86
7.4.130.0120.00616.78
7.4.120.0110.00616.59
7.4.110.0070.01516.68
7.4.100.0110.00516.77
7.4.90.0090.00916.46
7.4.80.0120.00919.39
7.4.70.0040.01516.60
7.4.60.0130.00716.45
7.4.50.0070.00716.52
7.4.40.0080.00816.73
7.4.30.0170.00816.58
7.4.00.0060.00914.95
7.3.330.0070.00013.45
7.3.320.0000.00513.43
7.3.310.0040.00416.44
7.3.300.0070.00016.30
7.3.290.0070.01116.45
7.3.280.0060.01116.44
7.3.270.0070.01117.40
7.3.260.0160.00416.63
7.3.250.0080.01016.59
7.3.240.0110.00816.45
7.3.230.0100.00716.69
7.3.210.0100.01316.56
7.3.200.0130.01019.39
7.3.190.0120.00616.42
7.3.180.0060.01216.66
7.3.170.0100.01016.44
7.3.160.0090.00916.43
7.2.330.0100.00716.71
7.2.320.0090.01216.38
7.2.310.0100.01016.41
7.2.300.0130.00316.62
7.2.290.0170.00316.75
7.2.60.0000.01516.66
7.2.00.0040.01219.30
7.1.200.0030.00915.43
7.1.100.0090.00917.70
7.1.70.0060.01016.82
7.1.60.0140.01119.28
7.1.50.0120.00616.68
7.1.00.0030.07722.57
7.0.200.0030.00616.76
7.0.60.0070.08321.80
7.0.50.0230.04318.00
7.0.40.0070.08320.27
7.0.30.0230.04720.30
7.0.20.0330.07720.33
7.0.10.0130.08020.23
7.0.00.0070.08020.05
5.6.280.0030.05021.03
5.6.210.0130.07020.66
5.6.200.0130.05718.18
5.6.190.0030.05720.61
5.6.180.0500.06020.55
5.6.170.0130.04320.50
5.6.160.0170.07020.55
5.6.150.0200.07318.32
5.6.140.0100.06318.25
5.6.130.0170.06018.22
5.6.120.0200.07320.94
5.6.110.0030.08721.01
5.6.100.0030.07321.05
5.6.90.0070.05721.14
5.6.80.0130.07320.41
5.5.350.4230.03720.43
5.5.340.0070.03718.02
5.5.330.0130.07320.27
5.5.320.0630.06720.27
5.5.310.0230.03720.30
5.5.300.0000.06318.01
5.5.290.0100.07718.11
5.5.280.0100.03320.93
5.5.270.0030.04021.00
5.5.260.0000.07020.68
5.5.250.0100.06320.74
5.5.240.0330.06020.32

preferences:
48.75 ms | 401 KiB | 5 Q