@ 2017-06-02T18:19:01Z <?php
//$states = json_decode('[[[2,0,1],[1,1,0]],[[4,1],[3,0,1]]]');
$states = json_decode('[[[2,0,1],[1,1,0]],[[4,1,2],[3,0,1]],[[99,0],[99,0],[22,0],[33,1,2]]]');
$state = 0;
$tape = array(1, 1, 1, 1, 0, 0, 0);
if (substr(phpversion(), -5) == '-hhvm') {
$updatesInternalPointer = true;
$noticesPointerOnlyMutation = true;
$rightEdgeBug = false;
} elseif (substr(phpversion(), 0, 1) == 7) {
$updatesInternalPointer = false;
$noticesPointerOnlyMutation = true;
$rightEdgeBug = false;
} else {
$updatesInternalPointer = true;
$noticesPointerOnlyMutation = false;
$rightEdgeBug = true;
}
if ($rightEdgeBug) $tape[] = 0;
foreach ($tape as $k => &$v) {
if (is_null($state)) break;
@list ($v, $d, $state) = $states[$state][$v];
if ($d) {
if (count($tape) - $k < ($rightEdgeBug ? 3 : 2)) $tape[] = 0;
if (!$updatesInternalPointer) next($tape);
} elseif ($k) {
$lol = $tape;
if ($noticesPointerOnlyMutation) {
prev($tape);
if ($updatesInternalPointer) prev($tape);
} else {
prev($lol);
if ($updatesInternalPointer) prev($lol);
$tape = $lol;
}
unset($lol);
} else {
array_unshift($tape, 0);
if (!$updatesInternalPointer) {
$lol = $tape;
reset($tape);
unset($lol);
}
}
}
unset($v);
if ($rightEdgeBug) array_pop($tape);
var_dump($tape);
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
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).
Version System time (s) User time (s) Memory (MiB) 7.2.6 0.011 0.003 16.73 7.2.0 0.010 0.010 19.30 7.1.10 0.003 0.007 18.35 7.1.7 0.004 0.004 17.23 7.1.6 0.006 0.006 17.37 7.1.5 0.070 0.010 32.71 7.1.4 0.017 0.013 32.52 7.1.3 0.067 0.007 32.50 7.1.2 0.057 0.013 32.70 7.1.1 0.050 0.007 14.63 7.1.0 0.037 0.010 14.54 7.0.20 0.000 0.010 16.52 7.0.19 0.050 0.010 14.61 7.0.18 0.003 0.010 14.32 7.0.17 0.057 0.013 14.38 7.0.16 0.043 0.010 14.32 7.0.15 0.057 0.003 14.35 7.0.14 0.043 0.013 14.30 7.0.13 0.037 0.007 14.67 7.0.12 0.023 0.017 14.68 7.0.11 0.040 0.013 14.56 7.0.10 0.037 0.013 14.61 7.0.9 0.023 0.010 14.21 7.0.8 0.037 0.013 14.65 7.0.7 0.033 0.007 14.44 7.0.6 0.003 0.013 14.14 7.0.5 0.023 0.013 14.54 7.0.4 0.030 0.010 14.62 7.0.3 0.030 0.007 14.61 7.0.2 0.003 0.010 14.41 7.0.1 0.033 0.007 14.45 7.0.0 0.027 0.010 14.67
preferences:dark mode live preview
35.93 ms | 402 KiB | 5 Q