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'); $rmetas[$property] = $content; } $tags=$rmetas; 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']){ $xpath = new DOMXPath($html); $links = $xpath->query('//link[@rel="image_src"]'); foreach ($links as $link) { $tags['og:image'] = $link->nodeValue; } } if(!$tags['og:image']){ $tags['og:image']="http://placehold.it/250x250&text=%C2%A0"; } if(!$tags['og:description']){ $t2=get_meta_tags($link); $tags['og:description']=$t2['description']; } $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)
8.3.60.0100.00718.56
8.3.50.0100.00721.27
8.3.40.0090.00619.04
8.3.30.0100.00320.26
8.3.20.0040.00420.41
8.3.10.0030.00521.96
8.3.00.0030.00522.45
8.2.180.0100.01316.63
8.2.170.0000.01422.96
8.2.160.0030.01020.39
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0100.00326.16
8.2.120.0050.00319.53
8.2.110.0100.00022.07
8.2.100.0040.00819.52
8.2.90.0030.00519.25
8.2.80.0040.00419.45
8.2.70.0040.00417.50
8.2.60.0000.00818.04
8.2.50.0040.00418.07
8.2.40.0040.00418.47
8.2.30.0060.00318.20
8.2.20.0040.00417.61
8.2.10.0060.00317.61
8.2.00.0060.00617.64
8.1.280.0110.00425.92
8.1.270.0110.00424.66
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00323.98
8.1.230.0080.00319.25
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0060.00317.47
8.1.190.0080.00017.30
8.1.180.0070.00020.22
8.1.170.0080.00018.74
8.1.160.0040.00422.18
8.1.150.0030.00618.56
8.1.140.0040.00417.37
8.1.130.0030.00317.75
8.1.120.0040.00417.54
8.1.110.0080.00017.45
8.1.100.0000.00817.47
8.1.90.0040.00417.43
8.1.80.0050.00217.47
8.1.70.0030.00317.49
8.1.60.0040.00417.59
8.1.50.0050.00317.53
8.1.40.0040.00417.46
8.1.30.0000.00817.68
8.1.20.0040.00417.72
8.1.10.0040.00417.63
8.1.00.0000.00817.54
8.0.300.0000.00718.77
8.0.290.0000.00817.41
8.0.280.0030.00318.55
8.0.270.0040.00417.44
8.0.260.0070.00017.00
8.0.250.0070.00017.16
8.0.240.0030.00617.16
8.0.230.0040.00417.19
8.0.220.0000.00717.16
8.0.210.0030.00317.10
8.0.200.0030.00317.20
8.0.190.0000.00717.08
8.0.180.0070.00017.17
8.0.170.0040.00417.04
8.0.160.0030.00317.11
8.0.150.0000.00817.03
8.0.140.0040.00416.98
8.0.130.0000.00513.57
8.0.120.0030.00617.04
8.0.110.0020.00517.04
8.0.100.0070.00016.98
8.0.90.0020.00516.98
8.0.80.0130.00317.07
8.0.70.0050.00217.20
8.0.60.0000.00816.95
8.0.50.0070.00017.08
8.0.30.0110.00817.26
8.0.20.0050.01917.40
8.0.10.0020.00517.19
8.0.00.0120.00516.79
7.4.330.0000.00515.00
7.4.320.0030.00316.73
7.4.300.0000.00616.61
7.4.290.0020.00516.56
7.4.280.0040.00416.61
7.4.270.0040.00416.61
7.4.260.0070.00016.69
7.4.250.0000.00916.59
7.4.240.0020.00516.66
7.4.230.0050.00216.54
7.4.220.0100.00716.66
7.4.210.0050.01016.69
7.4.200.0070.00016.69
7.4.190.0070.00016.73
7.4.160.0130.00316.87
7.4.150.0130.00717.40
7.4.140.0110.00817.86
7.4.130.0030.01616.64
7.4.120.0080.01216.79
7.4.110.0100.01316.57
7.4.100.0070.01016.69
7.4.90.0090.00916.65
7.4.80.0070.01019.39
7.4.70.0040.01616.78
7.4.60.0130.00816.55
7.4.50.0050.00016.53
7.4.40.0060.01022.77
7.4.30.0170.00016.52
7.4.10.0070.01115.17
7.4.00.0060.01315.06
7.3.330.0030.00313.20
7.3.320.0050.00013.28
7.3.310.0000.00716.29
7.3.300.0000.00716.36
7.3.290.0030.01016.32
7.3.280.0110.00616.36
7.3.270.0170.00317.40
7.3.260.0150.00316.40
7.3.250.0110.00716.36
7.3.240.0090.00916.42
7.3.230.0080.00916.39
7.3.210.0080.00816.47
7.3.200.0080.00819.39
7.3.190.0090.00916.36
7.3.180.0060.01016.47
7.3.170.0100.01016.47
7.3.160.0040.01616.38
7.3.130.0070.01114.94
7.3.120.0090.00915.00
7.3.110.0110.00814.65
7.3.100.0080.00514.77
7.3.90.0050.01014.78
7.3.80.0060.00914.89
7.3.70.0090.00714.88
7.3.60.0090.00414.74
7.3.50.0100.00614.88
7.3.40.0100.00614.85
7.3.30.0090.00514.85
7.3.20.0090.00716.72
7.3.10.0050.00916.60
7.3.00.0040.00916.68
7.2.330.0120.00616.57
7.2.320.0110.01516.49
7.2.310.0170.00016.80
7.2.300.0150.00416.78
7.2.290.0160.00316.70
7.2.260.0050.01515.04
7.2.250.0110.00815.06
7.2.240.0050.00915.02
7.2.230.0050.01014.88
7.2.220.0060.00914.94
7.2.210.0060.01114.98
7.2.200.0070.01015.06
7.2.190.0040.00914.97
7.2.180.0080.00515.10
7.2.170.0070.01114.97
7.2.160.0080.00414.93
7.2.150.0040.00916.89
7.2.140.0040.01516.96
7.2.130.0070.00816.92
7.2.120.0070.00716.92
7.2.110.0080.00816.70
7.2.100.0090.00616.78
7.2.90.0100.00616.84
7.2.80.0080.00816.89
7.2.70.0100.00516.78
7.2.60.0070.00616.78
7.2.50.0060.01216.84
7.2.40.0110.00616.79
7.2.30.0050.01116.93
7.2.20.0060.01016.76
7.2.10.0080.00816.76
7.2.00.0060.00916.84
7.1.330.0040.01115.59
7.1.320.0060.01115.65
7.1.310.0060.00615.64
7.1.300.0040.00515.61
7.1.290.0070.00615.68
7.1.280.0080.00815.67
7.1.270.0020.01115.68
7.1.260.0090.00715.69
7.1.250.0020.00815.71
7.1.240.0030.01315.75
7.1.230.0100.00615.73
7.1.220.0050.00715.71
7.1.210.0080.00815.83
7.1.200.0130.00515.71
7.1.190.0090.01115.63
7.1.180.0120.00415.66
7.1.170.0050.01015.63
7.1.160.0100.00915.81
7.1.150.0080.00815.79
7.1.140.0140.00315.61
7.1.130.0120.00515.79
7.1.120.0100.00615.73
7.1.110.0110.00415.79
7.1.100.0110.00516.21
7.1.90.0110.00415.68
7.1.80.0110.00915.70
7.1.70.0110.00515.99
7.1.60.0110.01016.66
7.1.50.0090.00915.86
7.1.40.0080.00815.76
7.1.30.0120.01115.73
7.1.20.0070.00915.70
7.1.10.0100.00315.70
7.1.00.0110.01617.18
7.0.330.0040.00915.20
7.0.320.0060.00615.41
7.0.310.0080.00815.25
7.0.300.0120.00415.32
7.0.290.0110.00515.20
7.0.280.0090.00915.36
7.0.270.0120.00615.30
7.0.260.0080.00915.08
7.0.250.0090.00715.31
7.0.240.0130.00415.35
7.0.230.0190.00615.31
7.0.220.0080.00615.30
7.0.210.0140.00515.37
7.0.200.0100.00615.64
7.0.190.0190.00515.27
7.0.180.0080.00815.15
7.0.170.0160.00315.29
7.0.160.0090.00815.21
7.0.150.0110.00615.28
7.0.140.0070.02217.01
7.0.130.0140.00515.31
7.0.120.0110.00815.29
7.0.110.0050.00915.11
7.0.100.0090.00815.43
7.0.90.0110.00715.28
7.0.80.0070.00915.40
7.0.70.0080.01015.20
7.0.60.0080.02516.49
7.0.50.0120.02315.94
7.0.40.0070.01614.99
7.0.30.0110.01714.97
7.0.20.0170.01615.05
7.0.10.0090.01615.01
7.0.00.0030.02515.00
5.6.400.0110.00614.50
5.6.390.0050.01014.16
5.6.380.0080.00514.29
5.6.370.0090.00614.31
5.6.360.0070.00914.24
5.6.350.0060.00814.42
5.6.340.0080.00614.30
5.6.330.0080.00614.43
5.6.320.0070.00714.21
5.6.310.0080.00714.37
5.6.300.0070.00814.31
5.6.290.0040.00914.24
5.6.280.0060.02316.13
5.6.270.0080.00514.33
5.6.260.0050.01014.38
5.6.250.0090.00614.19
5.6.240.0060.00814.30
5.6.230.0090.00614.30
5.6.220.0070.00714.21
5.6.210.0060.02215.81
5.6.200.0080.02615.27
5.6.190.0100.01315.73
5.6.180.0110.02715.98
5.6.170.0140.02215.83
5.6.160.0100.02115.80
5.6.150.0060.02015.19
5.6.140.0080.01815.25
5.6.130.0100.02215.38
5.6.120.0050.02915.96
5.6.110.0070.02416.00
5.6.100.0090.02015.91
5.6.90.0080.02315.86
5.6.80.0060.02615.68
5.6.70.0110.00514.04
5.6.60.0060.01214.07
5.6.50.0040.00714.38
5.6.40.0010.01314.19
5.6.30.0090.00514.12
5.6.20.0070.00814.25
5.6.10.0090.00414.06
5.6.00.0070.00714.19
5.5.380.0080.00713.66
5.5.370.0080.00513.81
5.5.360.0090.00513.79
5.5.350.0140.02115.33
5.5.340.0080.02614.82
5.5.330.0020.01815.29
5.5.320.0130.02615.33
5.5.310.0120.01615.34
5.5.300.0090.01914.78
5.5.290.0080.01314.82
5.5.280.0060.02515.47
5.5.270.0050.01515.47
5.5.260.0070.02415.50
5.5.250.0050.02815.40
5.5.240.0090.02315.27
5.5.230.0070.00713.75
5.5.220.0040.00913.55
5.5.210.0060.01013.64
5.5.200.0070.00613.55
5.5.190.0090.00713.57
5.5.180.0070.00513.52
5.5.170.0070.00814.02
5.5.160.0040.00913.64
5.5.150.0020.01113.59
5.5.140.0050.00913.56
5.5.130.0080.00713.77
5.5.120.0080.00413.51
5.5.110.0080.00713.69
5.5.100.0070.00613.53
5.5.90.0050.00713.72
5.5.80.0060.00813.54
5.5.70.0060.00613.62
5.5.60.0070.00513.67
5.5.50.0080.00713.52
5.5.40.0060.00713.54
5.5.30.0090.00413.76
5.5.20.0050.00513.61
5.5.10.0090.00413.64
5.5.00.0070.00713.50
5.4.450.0080.01913.88
5.4.440.0070.02413.78
5.4.430.0180.02213.82
5.4.420.0160.02113.89
5.4.410.0120.01713.82
5.4.400.0120.01313.80
5.4.390.0080.02013.79
5.4.380.0140.01713.64
5.4.370.0080.01613.63
5.4.360.0060.01713.68
5.4.350.0060.01312.00
5.4.340.0070.01312.00
5.4.330.0070.00312.00
5.4.320.0070.01112.12
5.4.310.0070.01412.12
5.4.300.0070.01412.12
5.4.290.0050.01612.12
5.4.280.0050.01612.09
5.4.270.0070.01512.09
5.4.260.0040.01612.09
5.4.250.0090.01413.73
5.4.240.0070.01813.74
5.4.230.0080.02013.73
5.4.220.0080.02213.73
5.4.210.0050.01913.71
5.4.200.0080.01413.75
5.4.190.0090.02013.69
5.4.180.0080.01513.76
5.4.170.0070.02113.74
5.4.160.0070.01613.75
5.4.150.0070.01713.70
5.4.140.0070.01713.15
5.4.130.0050.02013.14
5.4.120.0100.01913.11
5.4.110.0070.01813.11
5.4.100.0090.01913.09
5.4.90.0100.01813.12
5.4.80.0070.01613.10
5.4.70.0090.01413.06
5.4.60.0060.01713.10
5.4.50.0060.01613.10
5.4.40.0030.02113.11
5.4.30.0050.02313.12
5.4.20.0090.01513.11
5.4.10.0070.01413.08
5.4.00.0080.01412.93
5.3.290.0060.01512.20
5.3.280.0080.01612.67
5.3.270.0060.01812.66
5.3.260.0060.02012.66
5.3.250.0080.01512.60
5.3.240.0090.01512.66
5.3.230.0060.01612.66
5.3.220.0080.01612.67
5.3.210.0080.01512.61
5.3.200.0100.02012.65
5.3.190.0100.01412.67
5.3.180.0050.01712.61
5.3.170.0070.01712.62
5.3.160.0050.01712.65
5.3.150.0030.02012.65
5.3.140.0040.01812.65
5.3.130.0050.01812.64
5.3.120.0050.02012.65
5.3.110.0090.01412.57
5.3.100.0070.02012.46
5.3.90.0050.02012.51
5.3.80.0070.02012.49
5.3.70.0040.01612.51
5.3.60.0070.01612.54
5.3.50.0090.01412.49
5.3.40.0080.02012.50
5.3.30.0070.01512.48
5.3.20.0060.01612.43
5.3.10.0070.01912.42
5.3.00.0060.01612.38
5.2.170.0070.02412.04
5.2.160.0050.02411.99
5.2.150.0080.02511.99
5.2.140.0040.02612.06
5.2.130.0030.02311.93
5.2.120.0050.02211.97
5.2.110.0070.02911.93
5.2.100.0030.02312.04
5.2.90.0050.03211.96
5.2.80.0060.02111.88
5.2.70.0050.03011.93
5.2.60.0070.02811.95
5.2.50.0080.02211.93
5.2.40.0030.02411.83
5.2.30.0090.02111.87
5.2.20.0020.02511.91
5.2.10.0070.02211.96
5.2.00.0040.02211.86
5.1.60.0110.01311.43
5.1.50.0060.01811.51
5.1.40.0070.01911.42
5.1.30.0080.01811.46
5.1.20.0050.02011.54
5.1.10.0060.02011.57
5.1.00.0040.02811.41
5.0.50.0040.01910.73
5.0.40.0050.01410.51
5.0.30.0020.02410.42
5.0.20.0050.01310.50
5.0.10.0060.01210.54
5.0.00.0030.02310.55
4.4.90.0050.01310.10
4.4.80.0040.01210.10
4.4.70.0060.01010.10
4.4.60.0070.01210.10
4.4.50.0000.01710.10
4.4.40.0040.02310.10
4.4.30.0040.01510.10
4.4.20.0050.01010.10
4.4.10.0020.01510.10
4.4.00.0030.01810.10
4.3.110.0020.01410.10
4.3.100.0020.01410.10
4.3.90.0010.01310.10
4.3.80.0030.01910.10
4.3.70.0030.01310.10
4.3.60.0020.01310.10
4.3.50.0050.01210.10
4.3.40.0060.01510.10
4.3.30.0060.01310.10
4.3.20.0040.01310.10
4.3.10.0040.01010.10
4.3.00.0030.01310.03

preferences:
45.1 ms | 401 KiB | 5 Q