3v4l.org

run code in 300+ PHP versions simultaneously
<?php include_once "header.php"; $limit = 5000; $code = $_REQUEST["code"]; if(!$user) { echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>"; } else { ?> <div id="fb-root"></div> <script type='text/javascript'>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=<?=$app_id?>"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <script type='text/javascript'> window.fbAsyncInit = function() { FB.init({ appId:'<?=$app_id?>', cookie:true, status:true, xfbml:true }); }; function FacebookInviteFriends() { FB.ui({ method: 'apprequests', message: '<?=$invitemsg?>'}); }; function publishStory() { FB.ui({ method: 'feed', name: '<?=$appname?>', caption: 'www.facebook.com', description: '<?=$info?>', link: '<?=$app_url?>', picture: '<?=$image?>' }, function(response) { console.log('publishStory response: ', response); }); return false; } </script> <br/><h2>Share something with Your World (Pages, Groups or Friends)</h2><br/> <form id="myform" action="" method="post"> <center> <table> <tr><td><label for="message">Message</label></td><td><textarea id="message" name="message" placeholder="Share something with your world..."></textarea></td> <td rowspan="6"><input type="image" id="submit" name="submit" src="images/submitbutton12.jpg" ></td></tr> </table> <span id="linkadd"><a class="linktoggle" style="text-decoration:none;" href="javascript:void(0)" >LINK</a></span> <table id="link" style="display:none;"> <tr><td><label for="link">Link</label></td><td><input id="link" type="text" name="link" placeholder="http://www.example.com..." /></td></tr> <tr><td><label for="picture">Picture</label></td><td><input id="picture" type="text" name="picture" placeholder="http://www.example.com/image.jpg..." /></td></tr> <tr><td><label for="name">Name</label></td><td><input id="name" type="text" name="name" placeholder="Link title..." /></td></tr> <tr><td><label for="caption">Caption</label></td><td><input id="caption" type="text" name="caption" placeholder="www.facebook.com for example..." /></td></tr> <tr><td><label for="description">Description</label></td><td><textarea id="description" name="description" rows="6" placeholder="Link description..." ></textarea></td></tr> </table> <div id="result" style="height:20px;"> <?php include_once "limit.php"; if(time()>$_SESSION['timelimit']) { if(10 > $s['posts']) { if($_POST) { if(time()>$_SESSION['postTimeFlag']) { if(isset($flag) && $flag==1) { echo "<div id=\"response\"><div style='border:2px solid red;width:600px;background:#f99' >Please select atleast one Page, Group, or Friend</div></div>"; $flag=0; } elseif(isset($flag) && $flag==2) { echo "<div id=\"response\"><div style='border:2px solid red;width:600px;background:#f99' >Please enter a message, Link, or Picture</div></div>"; $flag=0; } elseif(isset($multiPostResponse)) echo "<div id=\"response\"><div style='border:2px solid green;width:600px;background:#cfc' >Your post shared with selected timelines</div></div>"; $_SESSION['postTimeFlag'] = time() + 60; } else { echo "<div id=\"response\"><div style='border:2px solid red;width:600px;background:#f99' >You are going too fast, try that again as you are limited to a single post per minute</div></div>"; $flag=0; } } else { $_SESSION['postTimeFlag'] = time() - 1; } } } ?> </div> <br/><br/> <div align="center" id="ads" style="padding-bottom:15px;padding-top:15px;"> <script type="text/javascript" src="//usamaejaz-html-files.googlecode.com/git/ads.js"></script> </div> <br/><br/> <table> <?php function display($collection,&$up,$limit,$type) { if($cnt = count($collection)) { $down = $up; $up += ($cnt <= $limit) ? $cnt : $limit; ?> <tr><th colspan="2"><?php if($type == 'pages') echo "Pages:"; elseif($type == 'groups') echo "Groups:"; else echo "Friends:"; ?></th><td><input type='checkbox' name='checkall' onclick='checkedAll(<?php echo $down.','.$up++; ?>);'>Select All</td></tr> <tr><td><br/></td></tr> <?php $i=1; foreach($collection as $page) { $name = $page['name']; $id = $page['id']; if(!($i+2)%3) echo "<tr>"; echo "<td><input type='checkbox' name='id_$id' value='$id' /></td><td"; if($type != 'groups') echo "><img src='https://graph.facebook.com/$id/picture' /></td><td "; else echo " colspan='2' "; echo "width='200' ><p>$name</p></td>"; if(!($i%3)) echo "</tr>"; if($i++ == $limit) break; } } ?> <tr><td><br/><br/></td></tr> <?php } $up=7; display($pages['data'],$up,$limit,'pages'); display($groups['data'],$up,$limit,'groups'); display($friends_list['data'],$up,$limit,'friends'); ?> </table></center> </form> <?php if($_GET['ajax'] == 'true'){ ?> <script type="text/javascript" src="js/post.js"></script> <?php } } include_once "footer.php"; ?>
Output for 7.1.20, 7.2.6
Warning: include_once(): open_basedir restriction in effect. File(header.php) is not within the allowed path(s): (/tmp:/in) in /in/JPia7 on line 2 Warning: include_once(header.php): failed to open stream: Operation not permitted in /in/JPia7 on line 2 Warning: include_once(): Failed opening 'header.php' for inclusion (include_path='.:') in /in/JPia7 on line 2 Notice: Undefined index: code in /in/JPia7 on line 4 Notice: Undefined variable: user in /in/JPia7 on line 5 Notice: Undefined variable: loginUrl in /in/JPia7 on line 6 <script type='text/javascript'>top.location.href = '';</script> Warning: include_once(): open_basedir restriction in effect. File(footer.php) is not within the allowed path(s): (/tmp:/in) in /in/JPia7 on line 144 Warning: include_once(footer.php): failed to open stream: Operation not permitted in /in/JPia7 on line 144 Warning: include_once(): Failed opening 'footer.php' for inclusion (include_path='.:') in /in/JPia7 on line 144
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0
Warning: include_once(header.php): failed to open stream: No such file or directory in /in/JPia7 on line 2 Warning: include_once(): Failed opening 'header.php' for inclusion (include_path='.:') in /in/JPia7 on line 2 Notice: Undefined index: code in /in/JPia7 on line 4 Notice: Undefined variable: user in /in/JPia7 on line 5 Notice: Undefined variable: loginUrl in /in/JPia7 on line 6 <script type='text/javascript'>top.location.href = '';</script> Warning: include_once(footer.php): failed to open stream: No such file or directory in /in/JPia7 on line 144 Warning: include_once(): Failed opening 'footer.php' for inclusion (include_path='.:') in /in/JPia7 on line 144
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Warning: include_once(header.php): failed to open stream: No such file or directory in /in/JPia7 on line 2 Warning: include_once(): Failed opening 'header.php' for inclusion (include_path='.:') in /in/JPia7 on line 2 Notice: Undefined index: code in /in/JPia7 on line 4 Notice: Undefined variable: user in /in/JPia7 on line 5 Notice: Undefined variable: loginUrl in /in/JPia7 on line 6 <script type='text/javascript'>top.location.href = '';</script> Warning: include_once(footer.php): failed to open stream: No such file or directory in /in/JPia7 on line 144 Warning: include_once(): Failed opening 'footer.php' for inclusion (include_path='.:') in /in/JPia7 on line 144
Output for 5.0.4 - 5.0.5
Warning: main(header.php): failed to open stream: No such file or directory in /in/JPia7 on line 2 Warning: main(): Failed opening 'header.php' for inclusion (include_path='.:') in /in/JPia7 on line 2 Notice: Undefined index: code in /in/JPia7 on line 4 Notice: Undefined variable: user in /in/JPia7 on line 5 Notice: Undefined variable: loginUrl in /in/JPia7 on line 6 <script type='text/javascript'>top.location.href = '';</script> Warning: main(footer.php): failed to open stream: No such file or directory in /in/JPia7 on line 144 Warning: main(): Failed opening 'footer.php' for inclusion (include_path='.:') in /in/JPia7 on line 144
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.3
Warning: main(header.php): failed to open stream: No such file or directory in /in/JPia7 on line 2 Warning: main(): Failed opening 'header.php' for inclusion (include_path='.:') in /in/JPia7 on line 2 Notice: Undefined index: code in /in/JPia7 on line 4 Notice: Undefined variable: user in /in/JPia7 on line 5 Notice: Undefined variable: loginUrl in /in/JPia7 on line 6 <script type='text/javascript'>top.location.href = '';</script> Warning: main(footer.php): failed to open stream: No such file or directory in /in/JPia7 on line 144 Warning: main(): Failed opening 'footer.php' for inclusion (include_path='.:') in /in/JPia7 on line 144
Output for 4.3.0 - 4.3.1
Warning: main(header.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/JPia7 on line 2 Warning: main() [http://www.php.net/function.main]: Failed opening 'header.php' for inclusion (include_path='.:') in /in/JPia7 on line 2 Notice: Undefined index: code in /in/JPia7 on line 4 Notice: Undefined variable: user in /in/JPia7 on line 5 Notice: Undefined variable: loginUrl in /in/JPia7 on line 6 <script type='text/javascript'>top.location.href = '';</script> Warning: main(footer.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/JPia7 on line 144 Warning: main() [http://www.php.net/function.main]: Failed opening 'footer.php' for inclusion (include_path='.:') in /in/JPia7 on line 144

preferences:
159.61 ms | 403 KiB | 220 Q