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" ); print_r($dateEnd);
based on iAUWZ
Output for 7.2.0
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 42 [f] => -0.002885 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 5 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.10
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 42 [f] => -0.00382 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 5 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.7
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 42 [f] => -0.002564 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 5 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.6
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 42 [f] => -0.011928 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 5 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.5
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 42 [f] => -0.010029 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 5 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.1.0
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 42 [f] => -0.004063 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 5 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.28, 7.0.20
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 42 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 5 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.0.6
DateInterval Object ( [y] => 0 [m] => 5 [d] => 1 [h] => 12 [i] => 34 [s] => 18 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 153 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.0.5
DateInterval Object ( [y] => 0 [m] => 3 [d] => 14 [h] => 8 [i] => 43 [s] => 36 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 105 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.0.4
DateInterval Object ( [y] => 0 [m] => 2 [d] => 21 [h] => 20 [i] => 44 [s] => 54 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 81 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.0.3
DateInterval Object ( [y] => 0 [m] => 2 [d] => 29 [h] => 22 [i] => 6 [s] => 5 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 89 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.0.2
DateInterval Object ( [y] => 0 [m] => 3 [d] => 3 [h] => 4 [i] => 20 [s] => 8 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 94 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.0.1
DateInterval Object ( [y] => 0 [m] => 3 [d] => 4 [h] => 7 [i] => 32 [s] => 20 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 95 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 7.0.0
DateInterval Object ( [y] => 0 [m] => 3 [d] => 7 [h] => 9 [i] => 26 [s] => 17 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 98 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.21
DateInterval Object ( [y] => 0 [m] => 4 [d] => 13 [h] => 15 [i] => 34 [s] => 31 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 134 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.20
DateInterval Object ( [y] => 0 [m] => 3 [d] => 21 [h] => 7 [i] => 45 [s] => 11 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 112 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.19
DateInterval Object ( [y] => 0 [m] => 2 [d] => 19 [h] => 4 [i] => 54 [s] => 23 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 79 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.18
DateInterval Object ( [y] => 0 [m] => 2 [d] => 26 [h] => 13 [i] => 46 [s] => 34 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 86 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.17
DateInterval Object ( [y] => 0 [m] => 3 [d] => 0 [h] => 1 [i] => 21 [s] => 1 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 91 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.16
DateInterval Object ( [y] => 0 [m] => 3 [d] => 8 [h] => 10 [i] => 15 [s] => 13 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 99 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.15
DateInterval Object ( [y] => 0 [m] => 3 [d] => 9 [h] => 11 [i] => 4 [s] => 46 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 100 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.14
DateInterval Object ( [y] => 0 [m] => 3 [d] => 25 [h] => 16 [i] => 45 [s] => 49 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 116 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.13
DateInterval Object ( [y] => 0 [m] => 3 [d] => 26 [h] => 17 [i] => 26 [s] => 5 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 117 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.12
DateInterval Object ( [y] => 0 [m] => 4 [d] => 0 [h] => 7 [i] => 53 [s] => 33 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 122 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.11
DateInterval Object ( [y] => 0 [m] => 4 [d] => 4 [h] => 14 [i] => 19 [s] => 6 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 126 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.10
DateInterval Object ( [y] => 0 [m] => 4 [d] => 5 [h] => 16 [i] => 23 [s] => 56 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 127 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.9
DateInterval Object ( [y] => 0 [m] => 4 [d] => 7 [h] => 21 [i] => 31 [s] => 53 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 129 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.6.8
DateInterval Object ( [y] => 0 [m] => 4 [d] => 10 [h] => 6 [i] => 21 [s] => 26 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 132 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.35
DateInterval Object ( [y] => 0 [m] => 5 [d] => 3 [h] => 0 [i] => 58 [s] => 7 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 155 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.34
DateInterval Object ( [y] => 0 [m] => 3 [d] => 22 [h] => 9 [i] => 57 [s] => 9 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 113 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.33
DateInterval Object ( [y] => 0 [m] => 2 [d] => 20 [h] => 7 [i] => 50 [s] => 52 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 80 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.32
DateInterval Object ( [y] => 0 [m] => 2 [d] => 28 [h] => 17 [i] => 41 [s] => 55 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 88 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.31
DateInterval Object ( [y] => 0 [m] => 3 [d] => 1 [h] => 4 [i] => 28 [s] => 10 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 92 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.30
DateInterval Object ( [y] => 0 [m] => 3 [d] => 12 [h] => 12 [i] => 56 [s] => 45 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 103 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.29
DateInterval Object ( [y] => 0 [m] => 3 [d] => 28 [h] => 7 [i] => 43 [s] => 45 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 119 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.28
DateInterval Object ( [y] => 0 [m] => 4 [d] => 1 [h] => 11 [i] => 11 [s] => 32 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 123 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.27
DateInterval Object ( [y] => 0 [m] => 4 [d] => 2 [h] => 12 [i] => 52 [s] => 1 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 124 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.26
DateInterval Object ( [y] => 0 [m] => 4 [d] => 6 [h] => 19 [i] => 3 [s] => 17 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 128 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.25
DateInterval Object ( [y] => 0 [m] => 4 [d] => 9 [h] => 2 [i] => 28 [s] => 39 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 131 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.5.24
DateInterval Object ( [y] => 0 [m] => 5 [d] => 4 [h] => 8 [i] => 54 [s] => 49 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 1 [days] => 156 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.44 - 5.4.45
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 40 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 5 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.43
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 39 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 5 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.40 - 5.4.42
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 38 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 5 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.36 - 5.4.39
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 37 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 5 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.4.32 - 5.4.35
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 36 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 5 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.3.29, 5.4.26 - 5.4.31
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 35 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 5 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.3.28, 5.4.21 - 5.4.25
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 34 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 5 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.3.27, 5.4.17 - 5.4.20
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 33 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => 5 [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 )
Output for 5.3.26, 5.4.16
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 33 [invert] => 0 [days] => 5 )
Output for 5.3.20 - 5.3.25, 5.4.10 - 5.4.15
DateInterval Object ( [y] => 0 [m] => 0 [d] => 5 [h] => 4 [i] => 52 [s] => 32 [invert] => 0 [days] => 5 )