3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $change = 1453404531; $then = new DateTime("@$change"); $now = date(); $interval = date_diff($then, $now); echo $interval->format("%H:%I");
based on 2081X

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
Warning: date() expects at least 1 parameter, 0 given in /in/cZMeV on line 4 Warning: date_diff() expects parameter 2 to be DateTimeInterface, boolean given in /in/cZMeV on line 5 Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/cZMeV:7 Stack trace: #0 {main} thrown in /in/cZMeV on line 7
Output for Array change keys
Warning: date() expects at least 1 parameter, 0 given in /in/cZMeV on line 4 Warning: date_diff() expects parameter 2 to be DateTimeInterface, boolean given in /in/cZMeV on line 5 Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/cZMeV:7 Stack trace: #0 {main} thrown in /in/cZMeV on line 7
Output for Lexical anon
Warning: date() expects at least 1 parameter, 0 given in /in/cZMeV on line 4 Warning: date_diff() expects parameter 2 to be DateTimeInterface, boolean given in /in/cZMeV on line 5 Catchable fatal error: Call to a member function format() on boolean in /in/cZMeV on line 7

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