3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** Подключение **/ include('../config/config_global.php'); // тут лежат данные /** Ошибки **/ if(empty($_REQUEST['id'])){die("error_synt");} /** Функции **/ function str_count($str, $source) { $arr=explode($str,$source); return(count($arr)-1); } function call_film($url){ $json = file_get_contents($url); $json = json_decode($json, true); return $json; } function obrabotkatextmalbuk($str) { $str = strtolower($str); $search = array( 'Й','Ц','У','К','Е','Н','Г','Ш','Щ','З','Х','Ъ','Ф','Ы','В','А','П','Р','О','Л','Д','Ж','Э','Я','Ч','С','М','И','Т','Ь','Б','Ю','Ё'); $replace = array( 'й','ц','у','к','е','н','г','ш','щ','з','х','ъ','ф','ы','в','а','п','р','о','л','д','ж','э','я','ч','с','м','и','т','ь','б','ю','ё'); $str = str_replace($search, $replace, $str); return $str; } function obrabotkatextspecsimv($text) { $text = preg_replace ("/[^A-Za-zАаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя0-9\s]/" ,"" ,$text); return $text; } function obrabotkatextarr($text){ $text = preg_split("/[\s,]+/", $text); return $text; } function vk_enter($text){ $text = urlencode($text); $text = str_replace('%5Cr%5C','%0A',$text); $text = urldecode($text); return $text; } /** Основное **/ $id = urlencode($_REQUEST['id']); $id = call_film(_PATH_.'pars_kinopoisk/pars_prov_1.php?id='.$id); preg_match('#([0-9]{2,7})#',$id,$m); /** Постер **/ $pars_img = call_film(_PATH_.'pars_img/img.php?album_id='.$album_id.'&group_id='.$group_id.'&url=http://st.kp.yandex.net/images/film_big/'.$m[0].'.jpg'); $pars_img = $pars_img[0]; $pid = $pars_img['pid']; $owner_id = $pars_img['owner_id']; $photo = 'photo'.$owner_id.'_'.$pid; /** Инофрмация **/ $pars_kinopoisk = call_film(_PATH_.'pars_kinopoisk/film.php?id='.$m[0]); $name_film = $pars_kinopoisk['Name_film']; //имя фильма $desk_film = $pars_kinopoisk['Desk_film']; //описание фильма $short_desk_film = $pars_kinopoisk['Short_desk_film']; //крткое описание фильма $short_desk_film2 = $pars_kinopoisk['Short_desk_film2']; //крткое описание фильма2 $keyyear_film= array_search('год', $short_desk_film2); $year_film = obrabotkatextarr($short_desk_film[$keyyear_film]); //год $year_film = $year_film['1']; $keycountry_film = array_search('страна', $short_desk_film2); $country_film = obrabotkatextarr($short_desk_film[$keycountry_film]); //страна $country_film = $country_film['1']; $janrs = $pars_kinopoisk['janrs']; //жанр $janrs = obrabotkatextarr($janrs); //жанр $janrscount = count($janrs); if ($janrscount >1) array_pop($janrs); $janrs2 = $janrs; $janrs = implode(", ", $janrs); foreach ($janrs2 as &$text) { $text = mb_convert_case($text, MB_CASE_TITLE, "UTF-8"); $text = '#'.$text.'@film_ru'; } $janrs2 = implode(" ", $janrs2); $text = vk_enter($name_film.' ('.$year_film.') '.$country_film.'\r\ \r\Жанр: '.$janrs.'.\r\ \r\Описание: '.$desk_film.'\r\ \r\#'.$country_film.'@film_ru #Film@film_ru #'.$year_film.'_year@film_ru '.$janrs2); /** Видео **/ $strfxy = $_REQUEST['video']; $strfxy = str_replace(array("videos"), "lkfjg", $strfxy); $proverkavideoy = str_count('video', $strfxy); if ($proverkavideoy >= 1) { $videoy = explode('video', $strfxy, 2); $videoy = $videoy['1']; $video_ry = substr($videoy, 0, 19); $proverkazny = str_count('-', $video_ry); if ($proverkazny >= 1) $videoy = substr($video_ry, 0, 19); else $videoy = $video_ry; } if ($videoy <> null) $video_poly = "video".$videoy; $video = $video_poly; /** Vk_api **/ $v = new Vk($config); $constrik = $photo.','.$video; $response = $v->api('wall.post', array( 'message' => $text, 'attachments' => $constrik, 'owner_id' => $owner_id_con)); $my_token_stat = $v->api('account.getAppPermissions', array( )); $url = $v->get_code_token(); if ($my_token_stat['0']){echo('Token okay ');}else{ echo('Token not okay, reload you token <a href="'.$url.'">Reload token</a>');} //$get_token = $v->get_token('b193b74a02942ae15d'); /** Демонстрация: **/ $t = new lime_test(1); $id_post_vk = $response['post_id']; $error_post_vk = $response['error']; if ($error_post_vk) {$t->error('error',$line='92');} if ($id_post_vk) {$t->isa_ok($id_post_vk, 'integer', 'return id');} print_var($response); //echo $debug;

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.0110.00418.55
8.3.50.0050.01421.99
8.3.40.0180.00019.04
8.3.30.0130.00718.97
8.3.20.0080.00020.46
8.3.10.0040.01121.98
8.3.00.0040.00418.16
8.2.180.0130.00316.88
8.2.170.0100.00722.96
8.2.160.0080.00820.64
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0000.00819.79
8.2.110.0090.00020.64
8.2.100.0070.00417.97
8.2.90.0050.00319.32
8.2.80.0030.00517.97
8.2.70.0030.00617.75
8.2.60.0000.00818.18
8.2.50.0030.00618.10
8.2.40.0000.00820.71
8.2.30.0040.00718.33
8.2.20.0000.00918.01
8.2.10.0040.00418.28
8.2.00.0040.00417.95
8.1.280.0200.00025.92
8.1.270.0030.00623.92
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0060.00620.95
8.1.230.0040.00720.98
8.1.220.0090.00317.91
8.1.210.0080.00018.77
8.1.200.0060.00317.60
8.1.190.0030.00617.79
8.1.180.0080.00018.10
8.1.170.0030.00618.64
8.1.160.0070.00022.24
8.1.150.0000.00818.97
8.1.140.0000.00717.57
8.1.130.0070.00017.89
8.1.120.0080.00017.55
8.1.110.0030.00517.40
8.1.100.0070.00017.54
8.1.90.0070.00017.53
8.1.80.0030.00317.50
8.1.70.0000.00717.46
8.1.60.0000.00817.75
8.1.50.0080.00017.69
8.1.40.0000.00817.67
8.1.30.0040.00417.81
8.1.20.0030.00617.63
8.1.10.0030.00617.61
8.1.00.0050.00317.70
8.0.300.0040.00418.77
8.0.290.0070.00017.00
8.0.280.0000.00718.52
8.0.270.0000.00717.38
8.0.260.0040.00417.34
8.0.250.0050.00217.23
8.0.240.0000.00717.18
8.0.230.0000.00717.27
8.0.220.0000.00717.06
8.0.210.0000.00717.15
8.0.200.0030.00317.21
8.0.190.0080.00017.23
8.0.180.0040.00417.08
8.0.170.0040.00417.23
8.0.160.0040.00417.12
8.0.150.0000.00717.14
8.0.140.0070.00017.16
8.0.130.0030.00313.60
8.0.120.0030.00617.18
8.0.110.0000.00817.16
8.0.100.0040.00417.22
8.0.90.0040.00417.02
8.0.80.0060.00917.23
8.0.70.0000.00717.05
8.0.60.0040.00417.18
8.0.50.0040.00417.12
8.0.30.0100.01417.19
8.0.20.0120.01117.42
8.0.10.0000.00717.03
8.0.00.0110.01017.02
7.4.330.0050.00015.11
7.4.320.0060.00016.73
7.4.300.0000.00616.73
7.4.290.0090.00016.69
7.4.280.0000.01116.75
7.4.270.0070.00016.68
7.4.260.0030.00716.80
7.4.250.0040.00416.61
7.4.240.0030.00416.73
7.4.230.0070.00016.65
7.4.220.0100.01316.78
7.4.210.0060.00816.72
7.4.200.0040.00416.41
7.4.160.0090.01316.57
7.4.150.0120.01217.40
7.4.140.0130.00817.86
7.4.130.0110.00616.68
7.4.120.0110.01116.56
7.4.110.0100.00716.67
7.4.100.0090.00916.72
7.4.90.0110.00716.78
7.4.80.0130.01019.39
7.4.70.0070.01116.67
7.4.60.0030.01416.64
7.4.50.0040.00016.71
7.4.40.0120.00616.78
7.4.30.0070.01016.55
7.4.00.0080.00414.89
7.3.330.0030.00313.36
7.3.320.0000.00513.30
7.3.310.0000.00716.53
7.3.300.0070.00016.50
7.3.290.0070.00716.56
7.3.280.0100.00816.52
7.3.270.0120.00617.40
7.3.260.0070.01116.53
7.3.250.0140.00416.52
7.3.240.0100.00716.48
7.3.230.0100.00716.63
7.3.210.0090.00916.60
7.3.200.0030.01319.39
7.3.190.0100.00716.56
7.3.180.0090.00616.60
7.3.170.0110.00616.45
7.3.160.0160.00616.45
7.3.120.0040.01215.12
7.2.330.0160.00716.61
7.2.320.0060.01216.63
7.2.310.0060.01216.80
7.2.300.0140.00416.68
7.2.290.0120.00616.62
7.2.00.0030.00919.40
7.1.100.0100.00717.97
7.1.70.0040.00417.06
7.1.60.0100.01319.25
7.1.50.0100.01316.82
7.1.00.0030.07722.55
7.0.200.0000.00716.58
7.0.140.0030.07321.92
7.0.100.0270.07720.02
7.0.90.0100.06720.06
7.0.80.0100.07719.97
7.0.70.0000.09019.95
7.0.60.0070.07719.98
7.0.50.0070.04720.45
7.0.40.0170.07320.05
7.0.30.0100.08020.11
7.0.20.0170.06320.08
7.0.10.0070.06019.95
7.0.00.0130.07020.07
5.6.280.0130.06321.18
5.6.250.0000.08320.61
5.6.240.0100.08020.80
5.6.230.0100.08020.61
5.6.220.0100.06020.52
5.6.210.0100.07320.73
5.6.200.0200.07321.06
5.6.190.0130.07721.06
5.6.180.0030.05720.98
5.6.170.0170.07721.16
5.6.160.0030.06321.10
5.6.150.0070.05020.96
5.6.140.0030.08321.15
5.6.130.0170.04321.10
5.6.120.0000.08321.10
5.6.110.0070.07321.00
5.6.100.0130.05721.13
5.6.90.0070.07721.06
5.6.80.0100.07020.48
5.6.70.0100.07720.59
5.6.60.0070.05720.35
5.6.50.0070.04320.54
5.6.40.0130.06720.49
5.6.30.0000.08720.54
5.6.20.0030.08320.43
5.6.10.0070.05320.46
5.6.00.0130.07020.44
5.5.380.0100.07720.39
5.5.370.0100.04020.41
5.5.360.0130.08020.40
5.5.350.0170.07020.46
5.5.340.0130.07720.83
5.5.330.0100.08720.83
5.5.320.0100.07720.89
5.5.310.0100.07720.98
5.5.300.0230.06720.97
5.5.290.0100.07720.85
5.5.280.0030.05320.86
5.5.270.0100.05320.91
5.5.260.0200.06020.68
5.5.250.0030.04720.59
5.5.240.0100.07020.36
5.5.230.0030.08320.25
5.5.220.0130.07020.33
5.5.210.0130.07020.28
5.5.200.0100.06720.29
5.5.190.0030.07020.29
5.5.180.0130.07720.16
5.5.160.0100.05720.28
5.5.150.0130.06720.29
5.5.140.0030.04720.32
5.5.130.0100.04020.11
5.5.120.0100.08320.27
5.5.110.0030.08320.12
5.5.100.0070.08320.13
5.5.90.0100.04020.09
5.5.80.0100.04320.09
5.5.70.0130.08020.05
5.5.60.0170.07020.20
5.5.50.0070.08020.07
5.5.40.0030.04720.07
5.5.30.0030.08319.98
5.5.20.0070.06720.14
5.5.10.0100.04320.07
5.5.00.0030.04320.06
5.4.450.0100.04019.55
5.4.440.0130.07019.37
5.4.430.0070.08019.46
5.4.420.0070.07719.29
5.4.410.0030.08019.33
5.4.400.0100.07018.91
5.4.390.0070.07318.91
5.4.380.0070.07019.04
5.4.370.0070.07018.88
5.4.360.0030.08019.14
5.4.350.0030.07318.86
5.4.340.0030.08019.13
5.4.320.0000.04319.23
5.4.310.0070.07319.17
5.4.300.0070.07719.04
5.4.290.0100.07019.07
5.4.280.0030.04319.19
5.4.270.0130.06719.13
5.4.260.0100.04018.90
5.4.250.0030.07319.13
5.4.240.0100.05319.09
5.4.230.0070.05019.13
5.4.220.0100.07719.18
5.4.210.0070.06318.90
5.4.200.0070.07019.13
5.4.190.0030.05718.89
5.4.180.0070.06318.95
5.4.170.0070.08019.03
5.4.160.0000.07719.18
5.4.150.0170.06318.93
5.4.140.0070.05716.40
5.4.130.0000.04316.50
5.4.120.0030.07716.24
5.4.110.0030.06716.39
5.4.100.0100.03316.45
5.4.90.0070.07316.42
5.4.80.0100.07016.44
5.4.70.0100.06016.45
5.4.60.0030.07716.38
5.4.50.0130.05716.49
5.4.40.0030.08016.36
5.4.30.0030.05716.51
5.4.20.0100.03716.27
5.4.10.0030.04016.48
5.4.00.0030.06715.81
5.3.290.0200.03314.79
5.3.280.0200.06314.66
5.3.270.0130.06714.76
5.3.260.0130.04714.60
5.3.250.0070.07714.73
5.3.240.0000.08014.64
5.3.230.0130.06714.61
5.3.220.0100.04314.77
5.3.210.0070.07714.57
5.3.200.0130.03714.56
5.3.190.0030.07314.69
5.3.180.0000.07014.55
5.3.170.0100.07014.54
5.3.160.0070.06314.57
5.3.150.0070.07014.76
5.3.140.0030.04314.63
5.3.130.0030.07014.53
5.3.120.0030.08314.58
5.3.110.0030.07714.67
5.3.100.0000.03714.11
5.3.90.0030.07314.08
5.3.80.0070.03314.20
5.3.70.0030.07314.16
5.3.60.0100.06313.99
5.3.50.0100.06314.09
5.3.40.0100.06314.11
5.3.30.0030.03314.08
5.3.20.0030.07313.87
5.3.10.0000.05013.74
5.3.00.0030.06313.81

preferences:
57.12 ms | 401 KiB | 5 Q