3v4l.org

run code in 300+ PHP versions simultaneously
<?php function format_date_input($value) { if (strpos($value, '/') != false) { // Delimiter is '/' - jQuery datepicker in use list($day, $month, $year) = explode('/', $value); } else if (strpos($value, '-') != false) { // Delimiter is '-' - HTML5 datepicker in use list($year, $month, $day) = explode('-', $value); } else return ''; $usdate = $month.'/'.$day.'/'.$year; $timestamp = strtotime($usdate); if ($timestamp == false) return ''; else return date($format, $timestamp); } format_date_input('2014-01-10'); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $format in /in/jsPX6 on line 12 Deprecated: date(): Passing null to parameter #1 ($format) of type string is deprecated in /in/jsPX6 on line 12

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