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)); }
Output for 7.1.0
Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Warning: A non-numeric value encountered in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 3.7762931995294E-11 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Warning: A non-numeric value encountered in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 7.5525863990588E-11 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Warning: A non-numeric value encountered in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 1.1328879598588E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Warning: A non-numeric value encountered in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 1.5105172798118E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Warning: A non-numeric value encountered in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 1.8881465997647E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Warning: A non-numeric value encountered in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 2.2657759197176E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Warning: A non-numeric value encountered in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 2.6434052396706E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Warning: A non-numeric value encountered in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 3.0210345596235E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Warning: A non-numeric value encountered in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 3.3986638795764E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Warning: A non-numeric value encountered in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 3.7762931995294E-10 )
Output for 5.1.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.14
Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 3.7762931995294E-11 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 7.5525863990588E-11 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 1.1328879598588E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 1.5105172798118E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 1.8881465997647E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 2.2657759197176E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 2.6434052396706E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 3.0210345596235E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 3.3986638795764E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407723710 [timeScore] => 0.99997442745396 [score] => 3.7762931995294E-10 )
Output for 5.1.0 - 5.1.1
Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => [timeScore] => 0 [score] => 6.1441746022147E-06 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => [timeScore] => 0 [score] => 1.2288349204429E-05 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => [timeScore] => 0 [score] => 1.8432523806644E-05 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => [timeScore] => 0 [score] => 2.4576698408859E-05 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => [timeScore] => 0 [score] => 3.0720873011074E-05 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => [timeScore] => 0 [score] => 3.6865047613288E-05 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => [timeScore] => 0 [score] => 4.3009222215503E-05 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => [timeScore] => 0 [score] => 4.9153396817718E-05 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => [timeScore] => 0 [score] => 5.5297571419932E-05 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => [timeScore] => 0 [score] => 6.1441746022147E-05 )
Output for 4.3.0 - 4.4.9, 5.0.3 - 5.0.5
Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407795710 [timeScore] => 1.000025572546 [score] => 3.7739762442464E-11 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407795710 [timeScore] => 1.000025572546 [score] => 7.5479524884929E-11 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407795710 [timeScore] => 1.000025572546 [score] => 1.1321928732739E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407795710 [timeScore] => 1.000025572546 [score] => 1.5095904976986E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407795710 [timeScore] => 1.000025572546 [score] => 1.8869881221232E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407795710 [timeScore] => 1.000025572546 [score] => 2.2643857465479E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407795710 [timeScore] => 1.000025572546 [score] => 2.6417833709725E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407795710 [timeScore] => 1.000025572546 [score] => 3.0191809953971E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407795710 [timeScore] => 1.000025572546 [score] => 3.3965786198218E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407795710 [timeScore] => 1.000025572546 [score] => 3.7739762442464E-10 )
Output for 5.0.0 - 5.0.2
Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407744000 [timeScore] => 0.99998884042505 [score] => 3.775640124751E-11 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407744000 [timeScore] => 0.99998884042505 [score] => 7.5512802495021E-11 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407744000 [timeScore] => 0.99998884042505 [score] => 1.1326920374253E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407744000 [timeScore] => 0.99998884042505 [score] => 1.5102560499004E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407744000 [timeScore] => 0.99998884042505 [score] => 1.8878200623755E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407744000 [timeScore] => 0.99998884042505 [score] => 2.2653840748506E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407744000 [timeScore] => 0.99998884042505 [score] => 2.6429480873257E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407744000 [timeScore] => 0.99998884042505 [score] => 3.0205120998008E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407744000 [timeScore] => 0.99998884042505 [score] => 3.3980761122759E-10 ) Notice: Use of undefined constant i - assumed 'i' in /in/GhT5f on line 6 Array ( [time] => 1407744000 [timeScore] => 0.99998884042505 [score] => 3.775640124751E-10 )