3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function getUsersData( \PDO $pdo) { $query = $pdo->query( "SELECT name,mail FROM users" ); return $query->fetchAll( PDO::FETCH_OBJ ) ; } function calculateDate( $date ) { $currentDate = new DateTime(); $diff = $currentDate->diff( new DateTime($date) ) ; return $diff; } $dateEnd = calculateDate( "20-12-2015" ); echo $dateEnd->format("%d days");
based on 6fo5j
Output for 5.3.20 - 5.4.45, 5.6.10, 5.6.28, 7.0.20 - 7.2.0
5 days
Output for 5.5.28, 5.5.31, 7.0.6
1 days
Output for 7.0.5
14 days
Output for 5.6.20, 7.0.4
21 days
Output for 7.0.3
29 days
Output for 5.5.35, 7.0.2
3 days
Output for 5.5.24, 5.6.11, 7.0.1
4 days
Output for 5.6.9, 7.0.0
7 days
Output for 5.6.21
13 days
Output for 5.6.19
19 days
Output for 5.6.13, 5.6.18
26 days
Output for 5.6.12, 5.6.17
0 days
Output for 5.6.16
8 days
Output for 5.5.25, 5.6.15
9 days
Output for 5.6.14
25 days
Output for 5.6.8
10 days
Output for 5.5.34
22 days
Output for 5.5.33
20 days
Output for 5.5.29, 5.5.32
28 days
Output for 5.5.30
12 days
Output for 5.5.27
2 days
Output for 5.5.26
6 days