3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //include_once "fbconfig.php"; if($user){ echo "<!-- user logged in -->"; if($_POST) { include_once "limit.php"; if($s['posts'] !== 10) { if(time()>$_SESSION['timelimit']) { if(time()>$_SESSION['postTimeFlag']) { if($_POST['message'] || $_POST['link'] || $_POST['picture']) { $body = array( 'message' => $_POST['message'], 'link' => $_POST['link'], 'picture' => $_POST['picture'], 'name' => $_POST['name'], 'caption' => $_POST['caption'], 'description' => $_POST['description'], ); $batchPost=array(); $i=1; $flag=1; foreach($_POST as $key => $value) { if(strpos($key,"id_") === 0) { $batchPost[] = array('method' => 'POST', 'relative_url' => "/$value/feed", 'body' => http_build_query($body)); if($i++ == 50) { try{ $multiPostResponse = $facebook->api('?batch='.urlencode(json_encode($batchPost)), 'POST'); }catch(FacebookApiException $e){ error_log($e); echo("Batch Post Failed"); } $flag=0; unset($batchPost); $i=1; } } } if(isset($batchPost) && count($batchPost) > 0 ) { try{ $multiPostResponse = $facebook->api('?batch='.urlencode(json_encode($batchPost)), 'POST'); }catch(FacebookApiException $e){ error_log($e); echo("Batch Post Failed"); } $flag=0; } } else { $flag=2; } 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>"; } } else { echo "error 2"; } } else { echo "error 3"; } } } else { echo "Not logged in"; } ?>
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: user in /in/c6fWg on line 3 Not logged in
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: user in /in/c6fWg on line 3 Not logged in
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/c6fWg on line 48
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '{' in /in/c6fWg on line 48
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/c6fWg on line 48
Process exited with code 255.