3v4l.org

run code in 300+ PHP versions simultaneously
<?php $table_template = array( 'db' => array( 'from' => 'CASE_ALIGMENT_0', 'select' => array( 'YR' => FALSE, 'REFERENCE' => "upper(###)", 'DESCRIPTION' => "initcap(###)", 'SUPPLIER_LOWER' => "initcap(###)", 'COUNTRY_LOWER' => "upper(###)", 'AMOUNT_LOWER' => '###', 'SUPPLIER_ALIG' => "initcap(###)", 'COUNTRY_ALIG' => "upper(###)", 'AMOUNT_ALIG' => '###', 'DIFF_PERC' => '###', 'DIFF' => '###', ), 'where' => array( 'YR' => array('LIKE', "%" ) ), ), 'filters' => array( 'year_min' => array( 'type' => 'year', 'description' => 'From year', 'where' => array( 'YR' => array( '>=', '2013' ) ), ), 'year_max' => array( 'type' => 'year', 'description' => 'To year', 'where' => array( 'YR' => array( '<=', '2013' ) ), ), ), 'dynamic' => TRUE, 'editable' => FALSE, 'number' => 6, 'title' => "Cases of alignment for contracts and orders<br><small>since 1994</small>", 'subtitle' => NULL, // TODO: Build graph queries and use them 'graph' => NULL, // array('query' => "select YR, to_char(to_number(sum(AMOUNT_ALIG)), '999G999G999', 'NLS_NUMERIC_CHARACTERS = '', ''') from CASE_ALIGMENT_0 group by YR order by YR;"), 'headers' => array( array( 'from_db' => FALSE, 'layout' => array( array( 'colspan' => 2, 'class' => "text-center" ), array( 'colspan' => 3, 'class' => "text-center border-left" ), array( 'colspan' => 3, 'class' => "text-center border-left" ), array( 'colspan' => 2, 'class' => "text-center border-left" ), ), 'data' => array( "<h3>Enquiry</h3>", "<h3>Lowest bid</h3>", "<h3>Alignment</h3>", "<h3>Difference</h3>", ), ), array( 'from_db' => TRUE, 'layout' => array( 'REFERENCE' => array( 'class' => "text-center" ), 'DESCRIPTION' => array( 'class' => "text-center" ), 'SUPPLIER_LOWER' => array( 'class' => "text-center border-left" ), 'COUNTRY_LOWER' => array( 'class' => "text-center" ), 'AMOUNT_LOWER' => array( 'class' => "text-center" ), 'SUPPLIER_ALIG' => array( 'class' => "text-center border-left" ), 'COUNTRY_ALIG' => array( 'class' => "text-center" ), 'AMOUNT_ALIG' => array( 'class' => "text-center" ), 'DIFF_PERC' => array( 'class' => "text-center border-left" ), 'DIFF' => array( 'class' => "text-center" ), ), 'data' => array( 'REFERENCE' => "Reference", 'DESCRIPTION' => "Description", 'SUPPLIER_LOWER' => "Supplier", 'COUNTRY_LOWER' => "Country", 'AMOUNT_LOWER' => "Bid (CHF)", 'SUPPLIER_ALIG' => "Supplier", 'COUNTRY_ALIG' => "Country", 'AMOUNT_ALIG' => "Initial bid (CHF)", 'DIFF_PERC' => "%", 'DIFF' => "CHF", ), ), ), 'body' => array( 'layout' => array( 'REFERENCE' => array( 'class' => "no-wrap" ), 'DESCRIPTION' => array( 'class' => "text-min-width" ), 'SUPPLIER_LOWER' => array( 'class' => "border-left" ), 'COUNTRY_LOWER' => array( 'class' => 'no-wrap' ), 'AMOUNT_LOWER' => array( 'class' => "text-right no-wrap", 'data-format' => 'currency' ), 'SUPPLIER_ALIG' => array( 'class' => "border-left" ), 'COUNTRY_ALIG' => array( 'class' => 'no-wrap' ), 'AMOUNT_ALIG' => array( 'class' => "text-right no-wrap", 'data-format' => 'currency' ), 'DIFF_PERC' => array( 'class' => "text-right no-wrap border-left", 'data-format' => 'percentage' ), 'DIFF' => array( 'class' => "text-right no-wrap", 'data-format' => 'currency' ), ), 'format' => array( 'AMOUNT_LOWER' => array( 'format_french_number', 'format_no_decimals' ), 'AMOUNT_ALIG' => array( 'format_french_number', 'format_no_decimals' ), 'COUNTRY_LOWER' => 'format_line_break', 'COUNTRY_ALIG' => 'format_line_break', 'DIFF_PERC' => 'format_percent', 'DIFF' => array( 'format_french_number', 'format_no_decimals' ), ), ), 'footers' => array( array( 'from_db' => TRUE, 'layout' => NULL, 'data' => array( 'REFERENCE' => "Reference", 'DESCRIPTION' => "Description", 'SUPPLIER_LOWER' => "Supplier", 'COUNTRY_LOWER' => "Country", 'AMOUNT_LOWER' => "Bid (CHF)", 'SUPPLIER_ALIG' => "Supplier", 'COUNTRY_ALIG' => "Country", 'AMOUNT_ALIG' => "Initial bid (CHF)", 'DIFF_PERC' => "%", 'DIFF' => "CHF", ), ), ), ); echo json_encode($table_template);
Output for git.master, git.master_jit, rfc.property-hooks
{"db":{"from":"CASE_ALIGMENT_0","select":{"YR":false,"REFERENCE":"upper(###)","DESCRIPTION":"initcap(###)","SUPPLIER_LOWER":"initcap(###)","COUNTRY_LOWER":"upper(###)","AMOUNT_LOWER":"###","SUPPLIER_ALIG":"initcap(###)","COUNTRY_ALIG":"upper(###)","AMOUNT_ALIG":"###","DIFF_PERC":"###","DIFF":"###"},"where":{"YR":["LIKE","%"]}},"filters":{"year_min":{"type":"year","description":"From year","where":{"YR":[">=","2013"]}},"year_max":{"type":"year","description":"To year","where":{"YR":["<=","2013"]}}},"dynamic":true,"editable":false,"number":6,"title":"Cases of alignment for contracts and orders<br><small>since 1994<\/small>","subtitle":null,"graph":null,"headers":[{"from_db":false,"layout":[{"colspan":2,"class":"text-center"},{"colspan":3,"class":"text-center border-left"},{"colspan":3,"class":"text-center border-left"},{"colspan":2,"class":"text-center border-left"}],"data":["<h3>Enquiry<\/h3>","<h3>Lowest bid<\/h3>","<h3>Alignment<\/h3>","<h3>Difference<\/h3>"]},{"from_db":true,"layout":{"REFERENCE":{"class":"text-center"},"DESCRIPTION":{"class":"text-center"},"SUPPLIER_LOWER":{"class":"text-center border-left"},"COUNTRY_LOWER":{"class":"text-center"},"AMOUNT_LOWER":{"class":"text-center"},"SUPPLIER_ALIG":{"class":"text-center border-left"},"COUNTRY_ALIG":{"class":"text-center"},"AMOUNT_ALIG":{"class":"text-center"},"DIFF_PERC":{"class":"text-center border-left"},"DIFF":{"class":"text-center"}},"data":{"REFERENCE":"Reference","DESCRIPTION":"Description","SUPPLIER_LOWER":"Supplier","COUNTRY_LOWER":"Country","AMOUNT_LOWER":"Bid (CHF)","SUPPLIER_ALIG":"Supplier","COUNTRY_ALIG":"Country","AMOUNT_ALIG":"Initial bid (CHF)","DIFF_PERC":"%","DIFF":"CHF"}}],"body":{"layout":{"REFERENCE":{"class":"no-wrap"},"DESCRIPTION":{"class":"text-min-width"},"SUPPLIER_LOWER":{"class":"border-left"},"COUNTRY_LOWER":{"class":"no-wrap"},"AMOUNT_LOWER":{"class":"text-right no-wrap","data-format":"currency"},"SUPPLIER_ALIG":{"class":"border-left"},"COUNTRY_ALIG":{"class":"no-wrap"},"AMOUNT_ALIG":{"class":"text-right no-wrap","data-format":"currency"},"DIFF_PERC":{"class":"text-right no-wrap border-left","data-format":"percentage"},"DIFF":{"class":"text-right no-wrap","data-format":"currency"}},"format":{"AMOUNT_LOWER":["format_french_number","format_no_decimals"],"AMOUNT_ALIG":["format_french_number","format_no_decimals"],"COUNTRY_LOWER":"format_line_break","COUNTRY_ALIG":"format_line_break","DIFF_PERC":"format_percent","DIFF":["format_french_number","format_no_decimals"]}},"footers":[{"from_db":true,"layout":null,"data":{"REFERENCE":"Reference","DESCRIPTION":"Description","SUPPLIER_LOWER":"Supplier","COUNTRY_LOWER":"Country","AMOUNT_LOWER":"Bid (CHF)","SUPPLIER_ALIG":"Supplier","COUNTRY_ALIG":"Country","AMOUNT_ALIG":"Initial bid (CHF)","DIFF_PERC":"%","DIFF":"CHF"}}]}

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
44.16 ms | 409 KiB | 8 Q