3v4l.org

run code in 300+ PHP versions simultaneously
<?php $form = array ( '#method' => 'POST', 'refsaving' => array ( '#type' => 'textfield', '#title' => 'Ref.', '#size' => 30, '#maxlength' => 128, '#required' => true, '#attributes' => array ( 'placeholder' => 'Reference #', 'required' => '', ), '#input' => true, '#autocomplete_path' => false, '#process' => array ( 0 => 'ajax_process_form', ), '#theme' => 'textfield', '#theme_wrappers' => array ( 0 => 'form_element', ), '#pre_render' => array ( 0 => 'ctools_dependent_pre_render', ), '#defaults_loaded' => true, '#tree' => false, '#parents' => array ( 0 => 'refsaving', ), '#array_parents' => array ( 0 => 'refsaving', ), '#weight' => 0, '#processed' => true, '#title_display' => 'before', '#id' => 'edit-refsaving', '#name' => 'refsaving', '#value' => 'REF123', '#needs_validation' => true, '#ajax_processed' => false, '#sorted' => true, '#validated' => true, ), 'initamount' => array ( '#type' => 'textfield', '#title' => 'Initial Amount', '#size' => 10, '#maxlength' => 12, '#required' => true, '#prefix' => '<div class="chf">', '#suffix' => '</div>', '#attributes' => array ( 'placeholder' => 'Initial amount in CHF', 'required' => '', 'type' => 'numeric', ), '#input' => true, '#autocomplete_path' => false, '#process' => array ( 0 => 'ajax_process_form', ), '#theme' => 'textfield', '#theme_wrappers' => array ( 0 => 'form_element', ), '#pre_render' => array ( 0 => 'ctools_dependent_pre_render', ), '#defaults_loaded' => true, '#tree' => false, '#parents' => array ( 0 => 'initamount', ), '#array_parents' => array ( 0 => 'initamount', ), '#weight' => 0.001000000000000000020816681711721685132943093776702880859375, '#processed' => true, '#title_display' => 'before', '#id' => 'edit-initamount', '#name' => 'initamount', '#value' => '100', '#needs_validation' => true, '#ajax_processed' => false, '#sorted' => true, '#validated' => true, ), 'netsaving' => array ( '#type' => 'textfield', '#title' => 'Net Saving', '#size' => 10, '#maxlength' => 12, '#required' => true, '#prefix' => '<div class="chf">', '#suffix' => '</div>', '#attributes' => array ( 'placeholder' => 'Net saving in CHF', 'required' => '', 'type' => 'numeric', ), '#input' => true, '#autocomplete_path' => false, '#process' => array ( 0 => 'ajax_process_form', ), '#theme' => 'textfield', '#theme_wrappers' => array ( 0 => 'form_element', ), '#pre_render' => array ( 0 => 'ctools_dependent_pre_render', ), '#defaults_loaded' => true, '#tree' => false, '#parents' => array ( 0 => 'netsaving', ), '#array_parents' => array ( 0 => 'netsaving', ), '#weight' => 0.00200000000000000004163336342344337026588618755340576171875, '#processed' => true, '#title_display' => 'before', '#id' => 'edit-netsaving', '#name' => 'netsaving', '#value' => '20', '#needs_validation' => true, '#ajax_processed' => false, '#sorted' => true, '#validated' => true, ), 'supplier' => array ( '#type' => 'textfield', '#title' => 'Supplier', '#size' => 40, '#maxlength' => 128, '#required' => true, '#attributes' => array ( 'placeholder' => 'Name of the supplier', ), '#input' => true, '#autocomplete_path' => false, '#process' => array ( 0 => 'ajax_process_form', ), '#theme' => 'textfield', '#theme_wrappers' => array ( 0 => 'form_element', ), '#pre_render' => array ( 0 => 'ctools_dependent_pre_render', ), '#defaults_loaded' => true, '#tree' => false, '#parents' => array ( 0 => 'supplier', ), '#array_parents' => array ( 0 => 'supplier', ), '#weight' => 0.003000000000000000062450045135165055398829281330108642578125, '#processed' => true, '#title_display' => 'before', '#id' => 'edit-supplier', '#name' => 'supplier', '#value' => 'Le supplier', '#needs_validation' => true, '#ajax_processed' => false, '#sorted' => true, '#validated' => true, ), 'comments' => array ( '#type' => 'textarea', '#title' => 'Comments', '#rows' => 3, '#cols' => 86, '#default_value' => '', '#attributes' => array ( 'placeholder' => 'Comments about the saving', ), '#maxlength' => 256, '#input' => true, '#resizable' => true, '#process' => array ( 0 => 'ajax_process_form', ), '#theme' => 'textarea', '#theme_wrappers' => array ( 0 => 'form_element', ), '#pre_render' => array ( 0 => 'ctools_dependent_pre_render', ), '#defaults_loaded' => true, '#tree' => false, '#parents' => array ( 0 => 'comments', ), '#array_parents' => array ( 0 => 'comments', ), '#weight' => 0.0040000000000000000832667268468867405317723751068115234375, '#processed' => true, '#required' => false, '#title_display' => 'before', '#id' => 'edit-comments', '#name' => 'comments', '#value' => 'sgda', '#needs_validation' => true, '#ajax_processed' => false, '#sorted' => true, '#validated' => true, ), 'estimated' => array ( '#type' => 'radios', '#title' => 'Estimated?', '#default_value' => 'N', '#options' => array ( 'Y' => 'Yes', 'N' => 'No', ), '#description' => 'Choose \'Yes\' if the amount introduced is an estimated amount.', '#input' => true, '#process' => array ( 0 => 'form_process_radios', ), '#theme_wrappers' => array ( 0 => 'radios', ), '#pre_render' => array ( 0 => 'form_pre_render_conditional_form_element', 1 => 'ctools_dependent_pre_render', ), '#defaults_loaded' => true, '#tree' => false, '#parents' => array ( 0 => 'estimated', ), '#array_parents' => array ( 0 => 'estimated', ), '#weight' => 0.005000000000000000104083408558608425664715468883514404296875, '#processed' => true, '#required' => false, '#attributes' => array ( ), '#title_display' => 'before', '#id' => 'edit-estimated', '#name' => 'estimated', '#value' => 'Y', '#needs_validation' => true, 'Y' => array ( '#type' => 'radio', '#title' => 'Yes', '#return_value' => 'Y', '#default_value' => 'N', '#attributes' => array ( ), '#parents' => array ( 0 => 'estimated', ), '#id' => 'edit-estimated-y', '#ajax' => NULL, '#weight' => 0.001000000000000000020816681711721685132943093776702880859375, '#input' => true, '#process' => array ( 0 => 'ajax_process_form', ), '#theme' => 'radio', '#theme_wrappers' => array ( 0 => 'form_element', ), '#title_display' => 'after', '#pre_render' => array ( 0 => 'ctools_dependent_pre_render', ), '#defaults_loaded' => true, '#tree' => false, '#array_parents' => array ( 0 => 'estimated', 1 => 'Y', ), '#processed' => true, '#required' => false, '#name' => 'estimated', '#value' => 'Y', '#needs_validation' => true, '#ajax_processed' => false, '#sorted' => true, '#validated' => true, ), 'N' => array ( '#type' => 'radio', '#title' => 'No', '#return_value' => 'N', '#default_value' => 'N', '#attributes' => array ( ), '#parents' => array ( 0 => 'estimated', ), '#id' => 'edit-estimated-n', '#ajax' => NULL, '#weight' => 0.00200000000000000004163336342344337026588618755340576171875, '#input' => true, '#process' => array ( 0 => 'ajax_process_form', ), '#theme' => 'radio', '#theme_wrappers' => array ( 0 => 'form_element', ), '#title_display' => 'after', '#pre_render' => array ( 0 => 'ctools_dependent_pre_render', ), '#defaults_loaded' => true, '#tree' => false, '#array_parents' => array ( 0 => 'estimated', 1 => 'N', ), '#processed' => true, '#required' => false, '#name' => 'estimated', '#value' => 'Y', '#needs_validation' => true, '#ajax_processed' => false, '#sorted' => true, '#validated' => true, ), '#validated' => true, ), 'created' => array ( '#type' => 'hidden', '#value' => 'oscar', '#input' => true, '#process' => array ( 0 => 'ajax_process_form', ), '#theme' => 'hidden', '#defaults_loaded' => true, '#tree' => false, '#parents' => array ( 0 => 'created', ), '#array_parents' => array ( 0 => 'created', ), '#weight' => 0.00600000000000000012490009027033011079765856266021728515625, '#processed' => true, '#required' => false, '#attributes' => array ( ), '#title_display' => 'before', '#id' => 'edit-created', '#name' => 'created', '#ajax_processed' => false, '#sorted' => true, '#validated' => true, ), 'actions' => array ( '#type' => 'actions', 'submit' => array ( '#type' => 'submit', '#value' => 'Insert', '#submit' => array ( 0 => 'fp_savings_insert_saving_form_submit', ), '#input' => true, '#name' => 'op', ))); $obj = (object) $form; print_r(array_keys($form)); echo get_object_vars($obj);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Array ( [0] => #method [1] => refsaving [2] => initamount [3] => netsaving [4] => supplier [5] => comments [6] => estimated [7] => created [8] => actions ) Warning: Array to string conversion in /in/W3Geo on line 441 Array
Output for 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.31, 7.4.0 - 7.4.33
Array ( [0] => #method [1] => refsaving [2] => initamount [3] => netsaving [4] => supplier [5] => comments [6] => estimated [7] => created [8] => actions ) Notice: Array to string conversion in /in/W3Geo on line 441 Array
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 7.3.32 - 7.3.33
Array ( [0] => #method [1] => refsaving [2] => initamount [3] => netsaving [4] => supplier [5] => comments [6] => estimated [7] => created [8] => actions ) Array

preferences:
280.55 ms | 403 KiB | 455 Q