3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date1 = new \DateTime('2024-09-01'); if ($date->format('m') > 9) { $tax = new \DateTime(($date1->format('Y')+1) . '-09-30'); } else { $tax = new \DateTime($date1->format('Y') . '-09-30'); } print_r($tax);

preferences:
68.66 ms | 405 KiB | 5 Q