3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = mktime(0, 0, 0, 4, 1, 2013); $days = date("t", $date); for ($i = 1; $i <= $days; $i++) { if(i % 4 == 0){ echo "<div style='color: red'>" . $i . "</div>"; } else{ echo $i; } }
Output for 7.1.0
Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>1</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>2</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>3</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>4</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>5</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>6</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>7</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>8</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>9</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>10</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>11</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>12</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>13</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>14</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>15</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>16</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>17</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>18</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>19</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>20</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>21</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>22</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>23</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>24</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>25</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>26</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>27</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>28</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>29</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 Warning: A non-numeric value encountered in /in/HsUAr on line 7 <div style='color: red'>30</div>
Output for 4.3.0 - 7.0.14
Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>1</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>2</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>3</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>4</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>5</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>6</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>7</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>8</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>9</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>10</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>11</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>12</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>13</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>14</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>15</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>16</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>17</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>18</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>19</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>20</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>21</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>22</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>23</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>24</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>25</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>26</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>27</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>28</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>29</div> Notice: Use of undefined constant i - assumed 'i' in /in/HsUAr on line 7 <div style='color: red'>30</div>