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)); print_r(get_object_vars($obj));
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, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.3 - 7.4.33, 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 ) Array ( [#method] => POST [refsaving] => Array ( [#type] => textfield [#title] => Ref. [#size] => 30 [#maxlength] => 128 [#required] => 1 [#attributes] => Array ( [placeholder] => Reference # [required] => ) [#input] => 1 [#autocomplete_path] => [#process] => Array ( [0] => ajax_process_form ) [#theme] => textfield [#theme_wrappers] => Array ( [0] => form_element ) [#pre_render] => Array ( [0] => ctools_dependent_pre_render ) [#defaults_loaded] => 1 [#tree] => [#parents] => Array ( [0] => refsaving ) [#array_parents] => Array ( [0] => refsaving ) [#weight] => 0 [#processed] => 1 [#title_display] => before [#id] => edit-refsaving [#name] => refsaving [#value] => REF123 [#needs_validation] => 1 [#ajax_processed] => [#sorted] => 1 [#validated] => 1 ) [initamount] => Array ( [#type] => textfield [#title] => Initial Amount [#size] => 10 [#maxlength] => 12 [#required] => 1 [#prefix] => <div class="chf"> [#suffix] => </div> [#attributes] => Array ( [placeholder] => Initial amount in CHF [required] => [type] => numeric ) [#input] => 1 [#autocomplete_path] => [#process] => Array ( [0] => ajax_process_form ) [#theme] => textfield [#theme_wrappers] => Array ( [0] => form_element ) [#pre_render] => Array ( [0] => ctools_dependent_pre_render ) [#defaults_loaded] => 1 [#tree] => [#parents] => Array ( [0] => initamount ) [#array_parents] => Array ( [0] => initamount ) [#weight] => 0.001 [#processed] => 1 [#title_display] => before [#id] => edit-initamount [#name] => initamount [#value] => 100 [#needs_validation] => 1 [#ajax_processed] => [#sorted] => 1 [#validated] => 1 ) [netsaving] => Array ( [#type] => textfield [#title] => Net Saving [#size] => 10 [#maxlength] => 12 [#required] => 1 [#prefix] => <div class="chf"> [#suffix] => </div> [#attributes] => Array ( [placeholder] => Net saving in CHF [required] => [type] => numeric ) [#input] => 1 [#autocomplete_path] => [#process] => Array ( [0] => ajax_process_form ) [#theme] => textfield [#theme_wrappers] => Array ( [0] => form_element ) [#pre_render] => Array ( [0] => ctools_dependent_pre_render ) [#defaults_loaded] => 1 [#tree] => [#parents] => Array ( [0] => netsaving ) [#array_parents] => Array ( [0] => netsaving ) [#weight] => 0.002 [#processed] => 1 [#title_display] => before [#id] => edit-netsaving [#name] => netsaving [#value] => 20 [#needs_validation] => 1 [#ajax_processed] => [#sorted] => 1 [#validated] => 1 ) [supplier] => Array ( [#type] => textfield [#title] => Supplier [#size] => 40 [#maxlength] => 128 [#required] => 1 [#attributes] => Array ( [placeholder] => Name of the supplier ) [#input] => 1 [#autocomplete_path] => [#process] => Array ( [0] => ajax_process_form ) [#theme] => textfield [#theme_wrappers] => Array ( [0] => form_element ) [#pre_render] => Array ( [0] => ctools_dependent_pre_render ) [#defaults_loaded] => 1 [#tree] => [#parents] => Array ( [0] => supplier ) [#array_parents] => Array ( [0] => supplier ) [#weight] => 0.003 [#processed] => 1 [#title_display] => before [#id] => edit-supplier [#name] => supplier [#value] => Le supplier [#needs_validation] => 1 [#ajax_processed] => [#sorted] => 1 [#validated] => 1 ) [comments] => Array ( [#type] => textarea [#title] => Comments [#rows] => 3 [#cols] => 86 [#default_value] => [#attributes] => Array ( [placeholder] => Comments about the saving ) [#maxlength] => 256 [#input] => 1 [#resizable] => 1 [#process] => Array ( [0] => ajax_process_form ) [#theme] => textarea [#theme_wrappers] => Array ( [0] => form_element ) [#pre_render] => Array ( [0] => ctools_dependent_pre_render ) [#defaults_loaded] => 1 [#tree] => [#parents] => Array ( [0] => comments ) [#array_parents] => Array ( [0] => comments ) [#weight] => 0.004 [#processed] => 1 [#required] => [#title_display] => before [#id] => edit-comments [#name] => comments [#value] => sgda [#needs_validation] => 1 [#ajax_processed] => [#sorted] => 1 [#validated] => 1 ) [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] => 1 [#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] => 1 [#tree] => [#parents] => Array ( [0] => estimated ) [#array_parents] => Array ( [0] => estimated ) [#weight] => 0.005 [#processed] => 1 [#required] => [#attributes] => Array ( ) [#title_display] => before [#id] => edit-estimated [#name] => estimated [#value] => Y [#needs_validation] => 1 [Y] => Array ( [#type] => radio [#title] => Yes [#return_value] => Y [#default_value] => N [#attributes] => Array ( ) [#parents] => Array ( [0] => estimated ) [#id] => edit-estimated-y [#ajax] => [#weight] => 0.001 [#input] => 1 [#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] => 1 [#tree] => [#array_parents] => Array ( [0] => estimated [1] => Y ) [#processed] => 1 [#required] => [#name] => estimated [#value] => Y [#needs_validation] => 1 [#ajax_processed] => [#sorted] => 1 [#validated] => 1 ) [N] => Array ( [#type] => radio [#title] => No [#return_value] => N [#default_value] => N [#attributes] => Array ( ) [#parents] => Array ( [0] => estimated ) [#id] => edit-estimated-n [#ajax] => [#weight] => 0.002 [#input] => 1 [#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] => 1 [#tree] => [#array_parents] => Array ( [0] => estimated [1] => N ) [#processed] => 1 [#required] => [#name] => estimated [#value] => Y [#needs_validation] => 1 [#ajax_processed] => [#sorted] => 1 [#validated] => 1 ) [#validated] => 1 ) [created] => Array ( [#type] => hidden [#value] => oscar [#input] => 1 [#process] => Array ( [0] => ajax_process_form ) [#theme] => hidden [#defaults_loaded] => 1 [#tree] => [#parents] => Array ( [0] => created ) [#array_parents] => Array ( [0] => created ) [#weight] => 0.006 [#processed] => 1 [#required] => [#attributes] => Array ( ) [#title_display] => before [#id] => edit-created [#name] => created [#ajax_processed] => [#sorted] => 1 [#validated] => 1 ) [actions] => Array ( [#type] => actions [submit] => Array ( [#type] => submit [#value] => Insert [#submit] => Array ( [0] => fp_savings_insert_saving_form_submit ) [#input] => 1 [#name] => op ) ) )

preferences:
421.83 ms | 433 KiB | 418 Q