3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Implements hook_menu */ function myownform_menu() { $items = array(); $items['myownform'] = array( 'title' => 'My Own Form', 'type' => MENU_NORMAL_ITEM, 'access arguments' => array('submit myownform'), 'page callback' => 'drupal_get_form', 'page arguments' => array('myownform_form'), ); return $items; } /** * Implements hook_form */ function myownform_form($form, &$form_state) { $form['myowntext'] = array( '#type' => 'textfield', '#title' => t('My own Text'), '#size' => 50, '#maxlength' => 50, '#required' => TRUE, '#description' => t('Please enter a small text'), ); $form['submit'] = array( '#type' => 'submit', '#value' => t('Submit') ); return $form; } /** * Validation handler for the myownform_form */ function myownform_form_validate($form, &$form_state) { if (!isset($form_state['values']['myowntext'])) { form_set_error('myowntext', t('You must enter a value.')); return FALSE; } return TRUE; } /** * Submission handler for the myownform_form */ function myownform_form_submit($form, &$form_state) { $form_state['rebuild'] = TRUE; print($_POST['myowntext']); } ?>
Output for git.master, git.master_jit, rfc.property-hooks

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:
45.57 ms | 401 KiB | 8 Q