3v4l.org

run code in 300+ PHP versions simultaneously
<?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)); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 6
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 6
Branch analysis from position: 34
Branch analysis from position: 6
filename:       /in/Qk8WP
function name:  (null)
number of ops:  35
compiled vars:  !0 = $score, !1 = $now, !2 = $i, !3 = $time, !4 = $timeScore
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
    4     1        INIT_FCALL                                               'time'
          2        DO_ICALL                                         $6      
          3        ASSIGN                                                   !1, $6
    5     4        ASSIGN                                                   !2, 0
          5      > JMP                                                      ->32
    6     6    >   INIT_FCALL                                               'strtotime'
          7        SUB                                              ~9      10, !2
          8        CONCAT                                           ~10     '-+', ~9
          9        CONCAT                                           ~11     ~10, '+hours'
         10        SEND_VAL                                                 ~11
         11        DO_ICALL                                         $12     
         12        ASSIGN                                                   !3, $12
    7    13        SUB                                              ~14     !1, !3
         14        DIV                                              ~15     ~14, !1
         15        SUB                                              ~16     1, ~15
         16        ASSIGN                                                   !4, ~16
    8    17        INIT_FCALL                                               'exp'
         18        MUL                                              ~18     !4, 12
         19        ADD                                              ~19     ~18, 12
         20        SEND_VAL                                                 ~19
         21        DO_ICALL                                         $20     
         22        ADD                                              ~21     1, $20
         23        DIV                                              ~22     1, ~21
         24        ASSIGN_OP                                     1          !0, ~22
    9    25        INIT_FCALL                                               'print_r'
         26        INIT_ARRAY                                       ~24     !3, 'time'
         27        ADD_ARRAY_ELEMENT                                ~24     !4, 'timeScore'
         28        ADD_ARRAY_ELEMENT                                ~24     !0, 'score'
         29        SEND_VAL                                                 ~24
         30        DO_ICALL                                                 
    5    31        PRE_INC                                                  !2
         32    >   IS_SMALLER                                               !2, 10
         33      > JMPNZ                                                    ~27, ->6
   10    34    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.29 ms | 1401 KiB | 21 Q