3v4l.org

run code in 300+ PHP versions simultaneously
<?php $format = 'Y-m-d'; $value = '14-09-13'; $hasTimeInfo = (strpbrk($format, 'HhGgis') !== false); $date = DateTime::createFromFormat($format, $value, new DateTimeZone($hasTimeInfo ? 'Asia/Jakarta' : 'UTC')); $errors = DateTime::getLastErrors(); if ($date === false || $errors['error_count'] || $errors['warning_count']) { echo 'return false'; print_r($error); return; } if (!$hasTimeInfo) { $date->setTime(0, 0, 0); } echo $date->getTimestamp();
Output for git.master, git.master_jit
Warning: Trying to access array offset on value of type bool in /in/qLMTg on line 8 Warning: Trying to access array offset on value of type bool in /in/qLMTg on line 8 -61703337600
Output for rfc.property-hooks
Warning: Trying to access array offset on false in /in/qLMTg on line 8 Warning: Trying to access array offset on false in /in/qLMTg on line 8 -61703337600

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:
26.79 ms | 406 KiB | 5 Q