3v4l.org

run code in 300+ PHP versions simultaneously
<?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 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 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.33, 7.2.0 - 7.2.25, 7.3.0 - 7.3.12, 7.4.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.3.11, 4.4.0 - 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.

preferences:
185.33 ms | 401 KiB | 264 Q