3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $year=(int) Date(Y); echo'<select name="yearofvisit>'; for($i=0;$i<10;$i++) {echo'<option value="'.$year.'" >'.$year.'</option>'; $year++; }
Output for 7.2.0
Warning: Use of undefined constant Y - assumed 'Y' (this will throw an Error in a future version of PHP) in /in/YrItT on line 1 <select name="yearofvisit><option value="2014" >2014</option><option value="2015" >2015</option><option value="2016" >2016</option><option value="2017" >2017</option><option value="2018" >2018</option><option value="2019" >2019</option><option value="2020" >2020</option><option value="2021" >2021</option><option value="2022" >2022</option><option value="2023" >2023</option>
Output for 4.3.0 - 7.1.10
Notice: Use of undefined constant Y - assumed 'Y' in /in/YrItT on line 1 <select name="yearofvisit><option value="2014" >2014</option><option value="2015" >2015</option><option value="2016" >2016</option><option value="2017" >2017</option><option value="2018" >2018</option><option value="2019" >2019</option><option value="2020" >2020</option><option value="2021" >2021</option><option value="2022" >2022</option><option value="2023" >2023</option>