3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
switch($mode) { case 'add': $mem_under=trim($_REQUEST['mem_under']); $mem_name=strtoupper(trim($_REQUEST['mem_name'])); $mem_address1=strtoupper(trim($_REQUEST['mem_address1'])); $mem_address2=strtoupper(trim($_REQUEST['mem_address2'])); $mem_city=strtoupper(trim($_REQUEST['mem_city'])); $mem_pincode=trim($_REQUEST['mem_pincode']); $mem_state=strtoupper(trim($_REQUEST['mem_state'])); $mem_country=strtoupper(trim($_REQUEST['mem_country'])); $mem_phone=trim($_REQUEST['mem_phone']); $mem_mobile=trim($_REQUEST['mem_mobile']); $mem_fax=trim($_REQUEST['mem_fax']); $mem_email=trim($_REQUEST['mem_email']); $mem_username=trim($_REQUEST['mem_username']); $mem_password=trim($_REQUEST['mem_password']); $mem_cardlength=trim($_REQUEST['mem_cardlength']); $mem_header=trim($_REQUEST['mem_header']); $result=mysql_query("select MAX(mem_id)+1 as mem_id,MAX(sub_id)+1 as sub_id from tbl_sitemember"); $row=mysql_fetch_array($result); $sub_id=$row['sub_id']; if ($mem_under=='1') { $mem_id=$row['mem_id']; $mem_role='2'; $mem_under='0'; } else { $mem_id=trim($_REQUEST['mem_under']); $mem_role='3'; $mem_under='0'; } if($mem_name!="") { $rs=mysql_query("select * from tbl_sitemember where mem_name='$mem_name'"); $num_row=mysql_num_rows($rs); if($num_row!=1) { @mysql_query("insert into tbl_sitemember (mem_id,sub_id,mem_role,mem_name,mem_address1,mem_address2,mem_city,mem_pincode,mem_state,mem_country,mem_phone,mem_mobile,mem_fax,mem_email,mem_username,mem_password,mem_cardlength,mem_header) VALUES('".$mem_id."','".$sub_id."','".$mem_role."','".$mem_name."','".$mem_address1."','".$mem_address2."','".$mem_city."','".$mem_pincode."','".$mem_state."','".$mem_country."','".$mem_phone."','".$mem_mobile."','".$mem_fax."','".$mem_email."','".$mem_username."','".$mem_password."','".$mem_cardlength."','".$mem_header."')"); ?> <script language="javascript">window.location.href="sitemember.php";</script> <? } else { echo "<p align='center'>Member Already Exist</p>"; } } ?> <form name="sitemember" action="sitemember.php?mode=add" method="post" onSubmit="return varify();"> <table width="940" border="0" cellpadding="5" cellspacing="1"> <tr><td colspan="2" class="tableheading">Add New Member</td></tr> <tr> <td width="240" class="fieldtitlerightred">Member Under</td> <td width="700" class="fieldtitleleft"> <select name="mem_under" class="fieldboxbig" id="mem_under" maxlength="50"> <?php $sql_select_tbl_sitemember=mysql_query("select mem_id,mem_name,mem_cardlength,mem_header from tbl_sitemember where mem_role=2 order by mem_name"); ?> <option value="1">NEW MEMBER</option> <?php while($row_select_tbl_sitemember=mysql_fetch_array($sql_select_tbl_sitemember)) { ?> <option value="<?php echo $row_select_tbl_sitemember['mem_id']; ?>"><?php echo $row_select_tbl_sitemember['mem_name']; ?></option> <?php } ?> </select> </td> </tr> <tr> <td width="240" class="fieldtitlerightred">Member Name</td> <td width="700" class="fieldtitleleft"><input name="mem_name" type="text" class="fieldboxbig" id="mem_name" maxlength="50"></td> </tr> <tr> <td width="240" class="fieldtitleright">Address</td> <td width="700" class="fieldtitleleft"><input name="mem_address1" type="text" class="fieldboxlarge" id="mem_address1" maxlength="50"></td> </tr> <tr> <td width="240" class="fieldtitleright"> </td> <td width="700" class="fieldtitleleft"><input name="mem_address2" type="text" class="fieldboxlarge" id="mem_address2" maxlength="50"></td> </tr> <tr> <td width="240" class="fieldtitlerightred">City</td> <td width="700" class="fieldtitleleft"><input name="mem_city" type="text" class="fieldboxmedium" id="mem_city" maxlength="50"></td> </tr> <tr> <td width="240" class="fieldtitleright">Pincode</td> <td width="700" class="fieldtitleleft"><input name="mem_pincode" type="text" class="fieldboxsmall" id="mem_pincode" maxlength="6"></td> </tr> <tr> <td width="240" class="fieldtitleright">State</td> <td width="700" class="fieldtitleleft"><input name="mem_state" type="text" class="fieldboxmedium" id="mem_state" maxlength="50"></td> </tr> <tr> <td width="240" class="fieldtitleright">Country</td> <td width="700" class="fieldtitleleft"><input name="mem_country" type="text" class="fieldboxmedium" id="mem_country" maxlength="50"></td> </tr> <tr> <td width="240" class="fieldtitleright">Phone</td> <td width="700" class="fieldtitleleft"><input name="mem_phone" type="text" class="fieldboxsmall" id="mem_phone" maxlength="19"></td> </tr> <tr> <td width="240" class="fieldtitleright">Mobile</td> <td width="700" class="fieldtitleleft"><input name="mem_mobile" type="text" class="fieldboxsmall" id="mem_mobile" maxlength="19"></td> </tr> <tr> <td width="240" class="fieldtitleright">Fax</td> <td width="700" class="fieldtitleleft"><input name="mem_fax" type="text" class="fieldboxsmall" id="mem_fax" maxlength="19"></td> </tr> <tr> <td width="240" class="fieldtitlerightred">Email</td> <td width="700" class="fieldtitleleft"><input name="mem_email" type="text" class="fieldboxlarge" id="mem_email" maxlength="50"></td> </tr> <tr> <td width="240" class="fieldtitlerightred">Username</td> <td width="700" class="fieldtitleleft"><input name="mem_username" type="text" class="fieldboxsmall" id="mem_username" maxlength="15" onBlur="checkusername(this.value);"></td> </tr> <tr> <td width="240" class="fieldtitlerightred">Password</td> <td width="700" class="fieldtitleleft"><input name="mem_password" type="password" class="fieldboxsmall" id="mem_password" maxlength="15"></td> </tr> <tr> <td width="240" class="fieldtitlerightred">Card Length</td> <td width="700" class="fieldtitleleft"><input name="mem_cardlength" type="text" class="fieldboxtiny" id="mem_cardlength" maxlength="2"></td> </tr> <tr> <td width="240" class="fieldtitlerightred">Header File Name</td> <td width="700" class="fieldtitleleft"><input name="mem_header" type="text" class="fieldboxmedium" id="mem_header" maxlength="20"></td> </tr> <tr><td width="680" colspan="2" class="fieldtitlecenter">&nbsp;</td></tr> <tr><td width="680" colspan="2" class="fieldtitlecenter"><input type="Submit" name="Save" class="buttontext" value="ADD">&nbsp;&nbsp;&nbsp;<input type="Submit" name="Cancel" class="buttontext" value="CANCEL"></td></tr> </table> </form> <?php break; default: ?> <table width="940" cellpadding="5" cellspacing="1"> <tr><td width="100%" class="tableheading">MEMBER</td></tr> <?php $sql="select sub_id,mem_role,mem_name,mem_city,mem_sort from tbl_sitemember where mem_role>=2 order by mem_sort"; $result=mysqli_query($con, $sql); if(mysqli_num_rows($result)>0) { while($R=mysqli_fetch_object($result)) { ?> <tr> <td class="tabletext"> <?php if ($R->mem_role=='2') { ?><img src="gallery/bullet.png" alt="" height="12" width="12">&nbsp;<a href="sitemember.php?mode=modify&sub_id=<?=$R->sub_id?>"><?php echo $R->mem_name;?>&nbsp;(<?php echo $R->mem_city;?>)</a><? } else { ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="sitemember.php?mode=modify&sub_id=<?=$R->sub_id?>"><?php echo $R->mem_name;?>&nbsp;(<?php echo $R->mem_city;?>)</a><? } ?> </td> </tr> <? } } ?> </table> <?php break; }
based on vlqGl
Output for 5.4.0 - 5.4.32
Parse error: syntax error, unexpected 'default' (T_DEFAULT) in /in/9nGNf on line 141
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_DEFAULT in /in/9nGNf on line 141
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_DEFAULT in /in/9nGNf on line 141
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/9nGNf on line 141
Process exited with code 255.