3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getthistime($type, $modify = null){ $now = new DateTime(null, new DateTimeZone('Asia/Baghdad')); if($modify){ $now->modify($modify); } if(!isset($type) || $type == 'datetime'){ return $now->format('Y-m-d H:i:s'); } if($type == 'time'){ return $now->format('H:i:s'); } if($type == 'timestamp'){ return $now->getTimestamp(); } } function timestampfromdate($date){ return DateTime::createFromFormat('Y-m-d H:i:s', $date, new DateTimeZone('Asia/Baghdad'))->getTimestamp(); } echo getthistime('timestamp')."--".timestampfromdate(getthistime('datetime'))."--".strtotime(getthistime('datetime'));
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/BRlmV on line 3 Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/BRlmV on line 3 Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/BRlmV on line 3 1512452905--1512452905--1512460105

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