3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $post_timestamp = '2014-03-09 20:46:51'; $pc_time = '2014-03-09 20:56:00' $post = new DateTime($post_timestamp); $pc = new DateTime($pc_time); $diff = $post->diff($pc); $years = $diff->y; $months = $diff->m; $days = $diff->d; $hours = $diff->h; $minutes = $diff->i; $seconds = $diff->s; echo sprintf('Time Difference %s years, %s months, %s days, %s hours, %s minutes, %s seconds', $years, $months, $days, $hours, $minutes, $seconds);
Output for 5.4.0 - 5.4.26
Parse error: syntax error, unexpected '$post' (T_VARIABLE) in /in/rfdPL on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/rfdPL on line 5
Process exited with code 255.