3v4l.org

run code in 300+ PHP versions simultaneously
<pre> <?php error_reporting(E_ALL); ini_set('display_errors', '1'); //http://stackoverflow.com/questions/1777101/php-check-to-see-if-a-string-matches-a-pattern require_once 'core.php'; if (!function_exists('rip') || !isset($_FILE)) die('can\'t rip'); /*start working...*/ init(); $a = getData(); if ($a === true) startSelect(); print_r(getDebug()); function init(){ global $_URL, $_CACHER, $_FILE, $_DATA; $_URL = file($_FILE); parseLines($_URL); $_CACHER['url'] = &$_URL; $_CACHER['count'] = array(); //$_CACHER['data'] = &$_DATA; return true; } function getData(){ global $_DATA, $_URL, $_CACHER, $_FPENDING, $_FALL, $_FSELECTED; if (is_file($_FPENDING){ unset($_CACHER['url']); unset($_CACHER['count']); $_CACHER['status'] = 'from_cache_see_pending'; return false; } @mkdir('tmp/' . date("Y-m-d"), 0777); @unlink($_FALL); foreach ($_URL as $val){ $data = getFromUrl($val); $_CACHER['count'][] = count($data); //$_DATA[] = $data; file_put_contents($_FALL, implode("\n", $data), FX_LOCK | FILE_APPEND); } $_CACHER['status'] = 'from_extern_cache_writed'; return true; } function startSelect(){ global $_PATT, $_FPENDING, $_FALL, $_FSELECTED; $list = file($_FALL); $good = array(); foreach ($list as $val){ foreach ($_PATT as $pat){ if (preg_match($pat, $val)){ $good[] = trim($val); } } } file_put_contents($_FSELECTED, implode("\n", $good));//only from patters file_put_contents($_FPENDING, implode("\n", $good));//pattern + human. } function getFromUrl($url){ $data = file_get_contents($url); $data = explode("\n", $data); foreach ($data as &$val){ $val = getCleared($val); } return $data; } function getCleared($val){ return trim($val); } function parseLines(&$a){ if (!is_array($a)) return false; foreach ($a as $k => $value){ $a[$k] = (getProp($value)); } return $a; } function getProp($text){ $text = preg_replace_callback("/\[(.*?)\]/", "callback", $text); return $text; } function callback($ok){ $ok = end($ok); $rez = ''; eval('$rez = ' . $ok . ';'); return $rez; }

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.190.0300.07318.86
5.4.180.0270.05319.05
5.4.170.0300.05319.19
5.4.160.0300.06018.96
5.4.150.0470.03718.99
5.4.140.0300.04316.56
5.4.130.0300.05716.51
5.4.120.0330.04716.56
5.4.110.0230.05316.50
5.4.100.0330.03716.50
5.4.90.0330.04016.41
5.4.80.0270.05716.22
5.4.70.0200.04716.60
5.4.60.0300.06316.43
5.4.50.0300.05316.16
5.4.40.0230.03716.48
5.4.30.0300.07016.34
5.4.20.0370.06016.17
5.4.10.0430.05016.55
5.4.00.0400.05715.78
5.3.270.0330.07014.66
5.3.260.0300.04314.62
5.3.250.0330.06714.77
5.3.240.0170.08014.54
5.3.230.0230.05014.77
5.3.220.0400.05014.60
5.3.210.0370.04714.59
5.3.200.0170.04314.54
5.3.190.0330.07014.74
5.3.180.0330.04014.56
5.3.170.0270.04714.58
5.3.160.0270.03714.59
5.3.150.0430.06314.66
5.3.140.0300.04014.55
5.3.130.0300.07014.71
5.3.120.0300.05014.46
5.3.110.0270.05014.46
5.3.100.0370.03014.27
5.3.90.0300.04314.04
5.3.80.0200.06714.04
5.3.70.0200.05014.03
5.3.60.0230.06314.01
5.3.50.0200.04013.88
5.3.40.0330.06013.98
5.3.30.0300.07313.94
5.3.20.0270.04313.68
5.3.10.0270.04313.66
5.3.00.0270.06013.66

preferences:
142.66 ms | 1394 KiB | 7 Q