3v4l.org

run code in 300+ PHP versions simultaneously
<?php $joinDate = '2014-04-22 10:36:33'; $today = date('Y-m-d H:i:s'); $Mdate1 = strtotime($joinDate); $Mdate2 = strtotime($today); $months = 0; while (strtotime('+1 MONTH', $Mdate1) < $Mdate2) { $months++; $Mdate1 = strtotime('+1 MONTH', $Mdate1); } echo $months; ?>

preferences:
38.95 ms | 402 KiB | 5 Q