3v4l.org

run code in 300+ PHP versions simultaneously
<?php function pmGetTaxRate($date = false) { if(!$date){ $date = time(); } if(!is_numeric($date)){ $date = strtotime($date); } if($date >= strtotime('2020-07-01') && $date < strtotime('2021-01-01')){ return 16; } return 19; } var_dump(pmGetTaxRate('2020-07-01'));
based on JTM54
Output for 7.2.0 - 7.2.31, 7.3.0 - 7.3.19, 7.4.0 - 7.4.7, 8.0.0alpha1
int(16)