3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Using Tabs With PHP</title> <style> .link{ font-family:tahoma; font-size:11px; font-weight:bold; color:white; text-decoration:none; } </style> </head> <body> <? $id=$_REQUEST['id']; $links=array(); $links[]="Home"; $links[]="Services"; $links[]="Products"; $links[]="Downloads"; $links[]="Contact Us"; $total_links=count($links); ?> <table cellpadding="0px" cellspacing="0"> <tr> <td width="30px">&nbsp;</td> <? for($i=0;$i<$total_links;$i++){ if($i+1==$id){ ?> <td style="padding-left:3px"> <table cellpadding="0" cellspacing="0"> <tr height="28px"> <td width="15px"><img src="images/selected-left.gif" /></td> <td style="background-image:url(images/selected.gif);" class="link"><?=$links[$i]?></td> <td width="15px"><img src="images/selected-right.gif" /></td> </tr> </table> </td> <? } else { ?> <td style="padding-left:3px"> <table cellpadding="0" cellspacing="0"> <tr height="28px"> <td width="13px"><img src="images/tab-left.gif" /></td> <td style="background-image:url(images/tab.gif);"><a href="?id=<?=$i+1?>" class="link"><?=$links[$i]?></a></td> <td width="13px"><img src="images/tab-right.gif" /></td> </tr> </table> </td> <? } // else end } //for end ?> <td width="30px">&nbsp;</td> </tr> <tr> <td colspan="<?=$total_links+2?>" bgcolor="#1895D5">&nbsp;</td> </tr> <tr> <td colspan="<?=$total_links+2?>" style="border:1px #1895D5 solid;"> <h1 style="color:#1895D5">The text for linkid<?=$id?> goes here ...</h1> </td> </tr> </table> </body> </html>
Output for 5.4.34 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Using Tabs With PHP</title> <style> .link{ font-family:tahoma; font-size:11px; font-weight:bold; color:white; text-decoration:none; } </style> </head> <body> Notice: Undefined index: id in /in/mvNN8 on line 21 <table cellpadding="0px" cellspacing="0"> <tr> <td width="30px">&nbsp;</td> <td style="padding-left:3px"> <table cellpadding="0" cellspacing="0"> <tr height="28px"> <td width="13px"><img src="images/tab-left.gif" /></td> <td style="background-image:url(images/tab.gif);"><a href="?id=1" class="link">Home</a></td> <td width="13px"><img src="images/tab-right.gif" /></td> </tr> </table> </td> <td style="padding-left:3px"> <table cellpadding="0" cellspacing="0"> <tr height="28px"> <td width="13px"><img src="images/tab-left.gif" /></td> <td style="background-image:url(images/tab.gif);"><a href="?id=2" class="link">Services</a></td> <td width="13px"><img src="images/tab-right.gif" /></td> </tr> </table> </td> <td style="padding-left:3px"> <table cellpadding="0" cellspacing="0"> <tr height="28px"> <td width="13px"><img src="images/tab-left.gif" /></td> <td style="background-image:url(images/tab.gif);"><a href="?id=3" class="link">Products</a></td> <td width="13px"><img src="images/tab-right.gif" /></td> </tr> </table> </td> <td style="padding-left:3px"> <table cellpadding="0" cellspacing="0"> <tr height="28px"> <td width="13px"><img src="images/tab-left.gif" /></td> <td style="background-image:url(images/tab.gif);"><a href="?id=4" class="link">Downloads</a></td> <td width="13px"><img src="images/tab-right.gif" /></td> </tr> </table> </td> <td style="padding-left:3px"> <table cellpadding="0" cellspacing="0"> <tr height="28px"> <td width="13px"><img src="images/tab-left.gif" /></td> <td style="background-image:url(images/tab.gif);"><a href="?id=5" class="link">Contact Us</a></td> <td width="13px"><img src="images/tab-right.gif" /></td> </tr> </table> </td> <td width="30px">&nbsp;</td> </tr> <tr> <td colspan="7" bgcolor="#1895D5">&nbsp;</td> </tr> <tr> <td colspan="7" style="border:1px #1895D5 solid;"> <h1 style="color:#1895D5">The text for linkid goes here ...</h1> </td> </tr> </table> </body> </html>
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.4.0 - 5.4.32
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Using Tabs With PHP</title> <style> .link{ font-family:tahoma; font-size:11px; font-weight:bold; color:white; text-decoration:none; } </style> </head> <body> <? $id=$_REQUEST['id']; $links=array(); $links[]="Home"; $links[]="Services"; $links[]="Products"; $links[]="Downloads"; $links[]="Contact Us"; $total_links=count($links); ?> <table cellpadding="0px" cellspacing="0"> <tr> <td width="30px">&nbsp;</td> <? for($i=0;$i<$total_links;$i++){ if($i+1==$id){ ?> <td style="padding-left:3px"> <table cellpadding="0" cellspacing="0"> <tr height="28px"> <td width="15px"><img src="images/selected-left.gif" /></td> <td style="background-image:url(images/selected.gif);" class="link"> Notice: Undefined variable: links in /in/mvNN8 on line 50 Notice: Undefined variable: i in /in/mvNN8 on line 50 </td> <td width="15px"><img src="images/selected-right.gif" /></td> </tr> </table> </td> <? } else { ?> <td style="padding-left:3px"> <table cellpadding="0" cellspacing="0"> <tr height="28px"> <td width="13px"><img src="images/tab-left.gif" /></td> <td style="background-image:url(images/tab.gif);"><a href="?id= Notice: Undefined variable: i in /in/mvNN8 on line 64 1" class="link"> Notice: Undefined variable: links in /in/mvNN8 on line 64 Notice: Undefined variable: i in /in/mvNN8 on line 64 </a></td> <td width="13px"><img src="images/tab-right.gif" /></td> </tr> </table> </td> <? } // else end } //for end ?> <td width="30px">&nbsp;</td> </tr> <tr> <td colspan=" Notice: Undefined variable: total_links in /in/mvNN8 on line 79 2" bgcolor="#1895D5">&nbsp;</td> </tr> <tr> <td colspan=" Notice: Undefined variable: total_links in /in/mvNN8 on line 83 2" style="border:1px #1895D5 solid;"> <h1 style="color:#1895D5">The text for linkid Notice: Undefined variable: id in /in/mvNN8 on line 84 goes here ...</h1> </td> </tr> </table> </body> </html>
Output for 4.3.0 - 5.3.29
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Using Tabs With PHP</title> <style> .link{ font-family:tahoma; font-size:11px; font-weight:bold; color:white; text-decoration:none; } </style> </head> <body> <? $id=$_REQUEST['id']; $links=array(); $links[]="Home"; $links[]="Services"; $links[]="Products"; $links[]="Downloads"; $links[]="Contact Us"; $total_links=count($links); ?> <table cellpadding="0px" cellspacing="0"> <tr> <td width="30px">&nbsp;</td> <? for($i=0;$i<$total_links;$i++){ if($i+1==$id){ ?> <td style="padding-left:3px"> <table cellpadding="0" cellspacing="0"> <tr height="28px"> <td width="15px"><img src="images/selected-left.gif" /></td> <td style="background-image:url(images/selected.gif);" class="link"><?=$links[$i]?></td> <td width="15px"><img src="images/selected-right.gif" /></td> </tr> </table> </td> <? } else { ?> <td style="padding-left:3px"> <table cellpadding="0" cellspacing="0"> <tr height="28px"> <td width="13px"><img src="images/tab-left.gif" /></td> <td style="background-image:url(images/tab.gif);"><a href="?id=<?=$i+1?>" class="link"><?=$links[$i]?></a></td> <td width="13px"><img src="images/tab-right.gif" /></td> </tr> </table> </td> <? } // else end } //for end ?> <td width="30px">&nbsp;</td> </tr> <tr> <td colspan="<?=$total_links+2?>" bgcolor="#1895D5">&nbsp;</td> </tr> <tr> <td colspan="<?=$total_links+2?>" style="border:1px #1895D5 solid;"> <h1 style="color:#1895D5">The text for linkid<?=$id?> goes here ...</h1> </td> </tr> </table> </body> </html>