3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $score = 0; $now = time(); for ($i=0; $i<10; $i++) { $time = strtotime("- " . (10 - $i) . " hours"); $timeScore = 1 - (($now - $time) / $now); $score += 1/(1+exp(12*$timeScore + 12)); print_r(array('time' => $time, 'timeScore' => $timeScore, 'score' => $score)); }
based on GhT5f
Output for 5.1.2 - 5.4.9, 5.4.11 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [time] => 1407723727 [timeScore] => 0.99997442745427 [score] => 3.7762931995154E-11 ) Array ( [time] => 1407727327 [timeScore] => 0.99997698470884 [score] => 7.5524705174922E-11 ) Array ( [time] => 1407730927 [timeScore] => 0.99997954196341 [score] => 1.1328531957486E-10 ) Array ( [time] => 1407734527 [timeScore] => 0.99998209921799 [score] => 1.5104477523054E-10 ) Array ( [time] => 1407738127 [timeScore] => 0.99998465647256 [score] => 1.888030721775E-10 ) Array ( [time] => 1407741727 [timeScore] => 0.99998721372713 [score] => 2.2656021045132E-10 ) Array ( [time] => 1407745327 [timeScore] => 0.99998977098171 [score] => 2.6431619008753E-10 ) Array ( [time] => 1407748927 [timeScore] => 0.99999232823628 [score] => 3.0207101112171E-10 ) Array ( [time] => 1407752527 [timeScore] => 0.99999488549085 [score] => 3.398246735894E-10 ) Array ( [time] => 1407756127 [timeScore] => 0.99999744274543 [score] => 3.7757717752615E-10 )
Output for 5.4.10
Array ( [time] => 1407723726 [timeScore] => 0.99997442745425 [score] => 3.7762931995162E-11 ) Array ( [time] => 1407727326 [timeScore] => 0.99997698470882 [score] => 7.5524705174938E-11 ) Array ( [time] => 1407730926 [timeScore] => 0.9999795419634 [score] => 1.1328531957489E-10 ) Array ( [time] => 1407734526 [timeScore] => 0.99998209921797 [score] => 1.5104477523057E-10 ) Array ( [time] => 1407738126 [timeScore] => 0.99998465647255 [score] => 1.8880307217754E-10 ) Array ( [time] => 1407741726 [timeScore] => 0.99998721372712 [score] => 2.2656021045135E-10 ) Array ( [time] => 1407745326 [timeScore] => 0.9999897709817 [score] => 2.6431619008757E-10 ) Array ( [time] => 1407748926 [timeScore] => 0.99999232823627 [score] => 3.0207101112175E-10 ) Array ( [time] => 1407752526 [timeScore] => 0.99999488549085 [score] => 3.3982467358944E-10 ) Array ( [time] => 1407756126 [timeScore] => 0.99999744274542 [score] => 3.7757717752619E-10 )
Output for 5.1.0 - 5.1.1
Array ( [time] => [timeScore] => 0 [score] => 6.1441746022147E-06 ) Array ( [time] => [timeScore] => 0 [score] => 1.2288349204429E-05 ) Array ( [time] => [timeScore] => 0 [score] => 1.8432523806644E-05 ) Array ( [time] => [timeScore] => 0 [score] => 2.4576698408859E-05 ) Array ( [time] => [timeScore] => 0 [score] => 3.0720873011074E-05 ) Array ( [time] => [timeScore] => 0 [score] => 3.6865047613288E-05 ) Array ( [time] => [timeScore] => 0 [score] => 4.3009222215503E-05 ) Array ( [time] => [timeScore] => 0 [score] => 4.9153396817718E-05 ) Array ( [time] => [timeScore] => 0 [score] => 5.5297571419932E-05 ) Array ( [time] => [timeScore] => 0 [score] => 6.1441746022147E-05 )
Output for 4.3.0 - 4.4.9, 5.0.3 - 5.0.5
Array ( [time] => 1407795727 [timeScore] => 1.0000255725457 [score] => 3.7739762442604E-11 ) Array ( [time] => 1407792127 [timeScore] => 1.0000230152912 [score] => 7.548068302514E-11 ) Array ( [time] => 1407788527 [timeScore] => 1.0000204580366 [score] => 1.1322276178315E-10 ) Array ( [time] => 1407784927 [timeScore] => 1.000017900782 [score] => 1.5096599875217E-10 ) Array ( [time] => 1407781327 [timeScore] => 1.0000153435274 [score] => 1.8871039396774E-10 ) Array ( [time] => 1407777727 [timeScore] => 1.0000127862729 [score] => 2.2645594746542E-10 ) Array ( [time] => 1407774127 [timeScore] => 1.0000102290183 [score] => 2.6420265928074E-10 ) Array ( [time] => 1407770527 [timeScore] => 1.0000076717637 [score] => 3.0195052944925E-10 ) Array ( [time] => 1407766927 [timeScore] => 1.0000051145091 [score] => 3.3969955800649E-10 ) Array ( [time] => 1407763327 [timeScore] => 1.0000025572546 [score] => 3.7744974498802E-10 )
Output for 5.0.0 - 5.0.2
Array ( [time] => 1407744000 [timeScore] => 0.99998882834926 [score] => 3.7756406718771E-11 ) Array ( [time] => 1407740400 [timeScore] => 0.99998627109468 [score] => 7.5513972088245E-11 ) Array ( [time] => 1407736800 [timeScore] => 0.99998371384011 [score] => 1.1327269614398E-10 ) Array ( [time] => 1407733200 [timeScore] => 0.99998115658554 [score] => 1.5103257892153E-10 ) Array ( [time] => 1407729600 [timeScore] => 0.99997859933096 [score] => 1.8879362045645E-10 ) Array ( [time] => 1407726000 [timeScore] => 0.99997604207639 [score] => 2.2655582078431E-10 ) Array ( [time] => 1407722400 [timeScore] => 0.99997348482182 [score] => 2.6431917994066E-10 ) Array ( [time] => 1407718800 [timeScore] => 0.99997092756724 [score] => 3.0208369796106E-10 ) Array ( [time] => 1407715200 [timeScore] => 0.99996837031267 [score] => 3.3984937488109E-10 ) Array ( [time] => 1407711600 [timeScore] => 0.9999658130581 [score] => 3.776162107363E-10 )