3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = new \DateTime('now'); $currentMonth = $now->format('n'); echo $currentMonth; $today = date('Y-n-j'); $last1 = "2021-11-1"; if($today > strtotime($last1)) echo 'true';
Output for 8.0.0 - 8.0.11, 8.1rc1 - rc2
9true
Output for 7.3.0 - 7.3.30, 7.4.0 - 7.4.23
9

preferences:
22.42 ms | 460 KiB | 5 Q