3v4l.org

run code in 300+ PHP versions simultaneously
<?php $client_id = '6091079'; // ID приложения $client_secret = 'M6RV5zJTnWAYqepBVeMb'; // Защищённый ключ $redirect_uri = 'https://simbrex.com/Farmose/auth.php'; // Адрес сайта $url = 'http://oauth.vk.com/authorize'; $params = array( 'client_id' => $client_id, 'redirect_uri' => $redirect_uri, 'response_type' => 'code' ); echo $link = '<p><a href="' . $url . '?' . urldecode(http_build_query($params)) . '"><section class="flat"><button>Анализ страницы ВК [ОСН]</button></section></a></p>'; if (isset($_GET['code'])) { $result = false; $params = array( 'client_id' => $client_id, 'client_secret' => $client_secret, 'code' => $_GET['code'], 'redirect_uri' => $redirect_uri ); $token = json_decode(file_get_contents('https://oauth.vk.com/access_token' . '?' . urldecode(http_build_query($params))), true); if (isset($token['access_token'])) { $params = array( 'uids' => $token['user_id'], 'fields' => 'photo_50,country,city,phone,uid,status,first_name,last_name,screen_name,sex,bdate,photo_big', 'access_token' => $token['access_token'] ); $userInfo = json_decode(file_get_contents('https://api.vk.com/method/users.get' . '?' . urldecode(http_build_query($params))), true); if (isset($userInfo['response'][0]['uid'])) { $userInfo = $userInfo['response'][0]; $result = true; } } if ($result) { echo '<center><img src="' . $userInfo['photo_big'] . '" /></center>'; echo "</br>"; echo '<center><img src="' . $userInfo['photo_50'] . '" /></center>'; echo "</br>"; function vk_date_account_create($id) { if (! is_int($id)) { $array = json_decode(file_get_contents('https://api.vk.com/method/users.get?user_ids='.$id), true); if (! isset($array['response'])) { return false; } $id = $array['response'][0]['uid']; } $xml = file_get_contents('http://vk.com/foaf.php?id='.$id); preg_match('~<ya:created dc:date="([^"]+)"~i', $xml, $preg); $exp = explode("T", $preg[1]); $exp = $exp[0]; echo "$exp[0]"; $exp = explode("-", $exp); $exp = "".$exp[2] .".". $exp[1] .".". $exp[0]; return $exp; } if ($userInfo['sex'] == 1) { $userInfo['sex'] = "Женский"; } elseif ($userInfo['sex'] == 2){ $userInfo['sex'] = "Мужской"; } elseif (1 == 1) { $userInfo['sex'] = "Не указано"; } function isNull($id, $userInfo){  If($userInfo[$id] == 0){  $res = "Не указано";  }  else{  $res = $userInfo["$id"];  }  return $res;  }  echo $userInfo['city']; $exp = vk_date_account_create($userInfo['uid']); $spec = '"'; echo"<dl class=".$spec."holiday".$spec."> <dt>ID</dt> <dd> ".$userInfo['uid']."</dd> <dt>Имя</dt> <dd> ".$userInfo['first_name']."</dd> <dt>Ссылка</dt> <dd> ".$userInfo['screen_name']." </dd> <dt>Дата¹</dt> <dd> ".$userInfo['bdate']."</dd> <dt>Дата²</dt> <dd> ".$exp."</dd> "; $x = $userInfo['sex']; echo " <dt>Пол</dt> <dd> ".$x."</dd> <dt>Статус</dt> <dd> ".$userInfo['statu']." </dd>"; $x = $userInfo['country']; echo" <dt>Страна</dt> <dd> ".$nulls."</dd> "; $x = $userInfo['city']; echo" <dt>Город</dt> <dd> ". $x ."</dd> <dt>Телефон</dt> <dd> ".$userInfo['phone']." </dd> <dt>Дата¹</dt> <dd> ".$userInfo['photo_50']."</dd> </dl>"; } } $_SESSION['userInfo'] = $userInfo; ?>

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)
7.1.70.0100.00316.93
7.1.60.0260.00335.09
7.1.50.0190.00934.84
7.1.40.0170.01334.43
7.1.30.0160.01334.24
7.1.20.0200.01034.50
7.1.10.0070.00716.51
7.1.00.0040.01116.18
7.0.200.0090.00316.39
7.0.190.0000.01216.48
7.0.180.0040.01615.96
7.0.170.0070.00715.84
7.0.160.0070.00716.12
7.0.150.0040.01116.00
7.0.140.0090.00616.13
7.0.130.0060.00916.32
7.0.120.0060.01316.19
7.0.110.0030.01616.05
7.0.100.0080.01216.02
7.0.90.0000.01416.02
7.0.80.0060.00916.21
7.0.70.0000.01416.18
7.0.60.0040.01115.73
7.0.50.0040.01116.27
7.0.40.0090.00616.36
7.0.30.0070.00716.34
7.0.20.0040.01116.14
7.0.10.0060.00916.30
7.0.00.0060.01016.48

preferences:
142.16 ms | 1386 KiB | 7 Q