3v4l.org

run code in 300+ PHP versions simultaneously
<?php include_once("config.php"); if($_POST) { $garray = array_filter($_POST["usergroups"]); if (empty($garray)) { die("No group selected"); } //Post variables we received from user $userGroupId = $_POST["usergroups"]; $userMessage = $_POST["message"]; if(strlen($userMessage)<1) { //message is empty die('No message was entered!'); } $link=$_POST['link']; if($link=="http://"){ $link=null; } if($link){ $html=file_get_contents($link) or die("Link unreachable!"); libxml_use_internal_errors(true); $doc = new DomDocument(); $doc->loadHTML($html); $xpath = new DOMXPath($doc); $query = '//*/meta[starts-with(@property, \'og:\')]'; $metas = $xpath->query($query); foreach ($metas as $meta) { $property = $meta->getAttribute('property'); $content = $meta->getAttribute('content'); $tags[$property] = $content; } $t2=get_meta_tags($link); if(!$tags['og:title']){ if($t2['og:title']){ $tags['og:title']=$t2['og:title']; } if(!$tags['og:title']){ if (preg_match( '/<title>(.+)<\/title>/', $html,$matches) && isset($matches[1] )) $title = $matches[1]; else $title = $link; $tags['og:title']=$title; } } if($_POST['name']){ $tags['og:title']=$_POST['name']; } if(!$tags['og:image']){ $links = $xpath->query('//link[@rel="image_src"]'); foreach ($links as $link) { $tags['og:image'] = $link->nodeValue; } if!($tags['og:image']){ if($t2['og:image']){ $tags['og:image']=$t2['og:image']; } } } if(!$tags['og:image']){ $tags['og:image']="http://placehold.it/250x250&text=%C2%A0"; } if(!$tags['og:description']){ $tags['og:description=$t2['og:description']; if(!$tags['og:description']){ $tags['og:description']=$t2['description']; } } if($tags['description']){ $tags['description']=$link; } $linkarray=parse_url($link); $msg_body = array( "access_token" => $access_token, "message" => $userMessage, "link" => $link, "picture" => $tags['og:image'], "name" => $tags['og:title'], "caption" => $linkarray['host'], "description" => $tags['og:description'] ); } else { $msg_body = array( "access_token" => $access_token, "message" => $userMessage ); } if ($fbuser) { ?> <html><head><title>Post Status</title><link href="style.css" rel="stylesheet" type="text/css" /></head><body> <div id="fbgroupform" class="groupform" align="center"> <h1>Your post was processed.</h1> <p> <?php if(!is_array($userGroupId)){ echo "error occured!<br/>"; } foreach($userGroupId as $userGroupId){ $fql_query = 'select name from group where gid ='.$userGroupId; $na = $facebook->api(array( 'method' => 'fql.query', 'query' => $fql_query)); foreach($na as $name){ $name=$name['name']; } try { $post_url = '/'.$userGroupId.'/feed'; $postResult = $facebook->api($post_url, 'post', $msg_body ); if($postResult){ echo 'Post success to <a href="//www.facebook.com/groups/'.$userGroupId.'" target="_blank">'.$name.'</a><br/>'; } } catch (FacebookApiException $e) { echo 'Error while posting to '.$name.': '. $e->getMessage()."<br/>"; } } ?> <br/><a class="button" href="<?=$homeurl?>">Back to Main Page</a><br/> </p> </div> </body> </html> <?php }else{ $loginUrl = $facebook->getLoginUrl(array('redirect_uri'=>$homeurl,'scope'=>$fbPermissions)); header('Location: ' . $loginUrl); } } ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.250.0100.06018.76
5.4.240.0030.08318.96
5.4.230.0070.06319.02
5.4.220.0070.05318.83
5.4.210.0070.05318.79
5.4.200.0100.07718.79
5.4.190.0200.04318.83
5.4.180.0070.05318.84
5.4.170.0130.05018.93
5.4.160.0070.06018.98
5.4.150.0130.05018.89
5.4.140.0100.04716.58
5.4.130.0100.05316.48
5.4.120.0130.06016.38
5.4.110.0100.05316.50
5.4.100.0030.07016.56
5.4.90.0030.05016.38
5.4.80.0030.05316.49
5.4.70.0070.05016.45
5.4.60.0070.06316.48
5.4.50.0070.05016.39
5.4.40.0170.04316.43
5.4.30.0070.04716.39
5.4.20.0130.04316.52
5.4.10.0000.06016.39
5.4.00.0070.05015.82
5.3.280.0130.06714.47
5.3.270.0000.05714.62
5.3.260.0070.05714.62
5.3.250.0100.06314.47
5.3.240.0100.05014.63
5.3.230.0100.05314.48
5.3.220.0170.04314.60
5.3.210.0070.05714.68
5.3.200.0030.05314.60
5.3.190.0070.05014.60
5.3.180.0100.05314.60
5.3.170.0000.05714.58
5.3.160.0070.04714.60
5.3.150.0100.07714.61
5.3.140.0100.05714.58
5.3.130.0000.06314.44
5.3.120.0100.05014.59
5.3.110.0100.06014.59
5.3.100.0100.06014.07
5.3.90.0100.05714.08
5.3.80.0100.06014.08
5.3.70.0070.05714.05
5.3.60.0070.07014.06
5.3.50.0130.06013.93
5.3.40.0000.05313.81
5.3.30.0100.04713.87
5.3.20.0070.05013.73
5.3.10.0000.05313.82
5.3.00.0030.05313.57

preferences:
136.36 ms | 1394 KiB | 7 Q