3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 'db' => array( 'name' => 'T50KCHF_0', 'filter' => array( 'columns' => array( 'SUPPLIER_NAME' => NULL, 'ORD' => NULL, 'REFER' => NULL, 'LIB' => NULL, 'COUNTRY' => NULL, 'PRC' => "concat(to_char(round(cast(### as number), 2), '990.00'),'%')", 'COM' => "to_char(to_number(###), '999G999G999', 'NLS_NUMERIC_CHARACTERS = '', ''')" ), 'where' => array( 'COUNTRY' => 'CH' ) ), 'graph_query' => "select country, to_char(to_number(sum(com)), '999G999G999', 'NLS_NUMERIC_CHARACTERS = '', ''') from t50kchf_0 group by country order by country;" ), 'dynamic' => TRUE, 'number' => 13, 'title' => "List of orders / contracts for supplies for a total value exceeding 50 000 CHF<br><small>placed in 2013</small>", 'subtitle' => FALSE, 'num_columns' => 7, 'headers' => array( array( 'from_db' => TRUE, 'layout' => NULL, 'data' => array( 'SUPPLIER_NAME' => "Supplier Name", 'ORD' => "Order/contract", 'REFER' => "Reference", 'LIB' => "Description", 'COUNTRY' => "Country", 'PRC' => "Percentage", 'COM' => "Commitment (CHF)" ) ) ), 'body' => array( 'layout' => array( 'SUPPLIER_NAME' => array(), 'ORD' => array( 'class' => "text-right" ), 'REFER' => array( 'class' => "text-right" ), 'LIB' => array(), 'COUNTRY' => array( 'class' => "text-center" ), 'PRC' => array( 'class' => "text-right", 'data-format' => 'percentage' ), 'COM' => array( 'class' => "text-right", 'data-format' => 'currency' ) ) ), 'footers' => array( array( 'from_db' => TRUE, 'exclude' => NULL, 'layout' => NULL, 'data' => array( 'SUPPLIER_NAME' => "Supplier Name", 'ORD' => "Order/contract", 'REFER' => "Reference", 'LIB' => "Description", 'COUNTRY' => "Country", 'PRC' => "Percentage", 'COM' => "Commitment" ) ) ) ); echo json_encode($arr, JSON_FORCE_OBJECT);
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
{"db":{"name":"T50KCHF_0","filter":{"columns":{"SUPPLIER_NAME":null,"ORD":null,"REFER":null,"LIB":null,"COUNTRY":null,"PRC":"concat(to_char(round(cast(### as number), 2), '990.00'),'%')","COM":"to_char(to_number(###), '999G999G999', 'NLS_NUMERIC_CHARACTERS = '', ''')"},"where":{"COUNTRY":"CH"}},"graph_query":"select country, to_char(to_number(sum(com)), '999G999G999', 'NLS_NUMERIC_CHARACTERS = '', ''') from t50kchf_0 group by country order by country;"},"dynamic":true,"number":13,"title":"List of orders \/ contracts for supplies for a total value exceeding 50 000 CHF<br><small>placed in 2013<\/small>","subtitle":false,"num_columns":7,"headers":{"0":{"from_db":true,"layout":null,"data":{"SUPPLIER_NAME":"Supplier Name","ORD":"Order\/contract","REFER":"Reference","LIB":"Description","COUNTRY":"Country","PRC":"Percentage","COM":"Commitment (CHF)"}}},"body":{"layout":{"SUPPLIER_NAME":{},"ORD":{"class":"text-right"},"REFER":{"class":"text-right"},"LIB":{},"COUNTRY":{"class":"text-center"},"PRC":{"class":"text-right","data-format":"percentage"},"COM":{"class":"text-right","data-format":"currency"}}},"footers":{"0":{"from_db":true,"exclude":null,"layout":null,"data":{"SUPPLIER_NAME":"Supplier Name","ORD":"Order\/contract","REFER":"Reference","LIB":"Description","COUNTRY":"Country","PRC":"Percentage","COM":"Commitment"}}}}
Output for 5.2.0 - 5.2.17
Notice: Use of undefined constant JSON_FORCE_OBJECT - assumed 'JSON_FORCE_OBJECT' in /in/B1pqG on line 70 Warning: json_encode() expects exactly 1 parameter, 2 given in /in/B1pqG on line 70
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Call to undefined function json_encode() in /in/B1pqG on line 70
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_encode() in /in/B1pqG on line 70
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: json_encode() in /in/B1pqG on line 70
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_encode() in /in/B1pqG on line 70

preferences:
322.19 ms | 401 KiB | 459 Q