3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(array_map(function($no){ $value = str_pad($no, 2, '0', STR_PAD_LEFT); return "<th>$value</th>"; }, range(0,24)));
based on gL8H8
Output for 5.3.0 - 7.2.0
array(25) { [0]=> string(11) "<th>00</th>" [1]=> string(11) "<th>01</th>" [2]=> string(11) "<th>02</th>" [3]=> string(11) "<th>03</th>" [4]=> string(11) "<th>04</th>" [5]=> string(11) "<th>05</th>" [6]=> string(11) "<th>06</th>" [7]=> string(11) "<th>07</th>" [8]=> string(11) "<th>08</th>" [9]=> string(11) "<th>09</th>" [10]=> string(11) "<th>10</th>" [11]=> string(11) "<th>11</th>" [12]=> string(11) "<th>12</th>" [13]=> string(11) "<th>13</th>" [14]=> string(11) "<th>14</th>" [15]=> string(11) "<th>15</th>" [16]=> string(11) "<th>16</th>" [17]=> string(11) "<th>17</th>" [18]=> string(11) "<th>18</th>" [19]=> string(11) "<th>19</th>" [20]=> string(11) "<th>20</th>" [21]=> string(11) "<th>21</th>" [22]=> string(11) "<th>22</th>" [23]=> string(11) "<th>23</th>" [24]=> string(11) "<th>24</th>" }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/S1mh4 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION, expecting ')' in /in/S1mh4 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/S1mh4 on line 3
Process exited with code 255.