3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startDate = '2024-05-26 00:00:01'; $secondsInWeek = 60 * 60 * 24 * 7; $weekDiff = (time() - strtotime($startDate)) / $secondsInWeek; $initial = 0.0; $increase = 0.1; $stepNo = intdiv(floor($weekDiff), 2); $value = $initial + $stepNo * $increase; echo $value;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gZgeY
function name:  (null)
number of ops:  25
compiled vars:  !0 = $startDate, !1 = $secondsInWeek, !2 = $weekDiff, !3 = $initial, !4 = $increase, !5 = $stepNo, !6 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2024-05-26+00%3A00%3A01'
    4     1        ASSIGN                                                   !1, 604800
    5     2        INIT_FCALL                                               'time'
          3        DO_ICALL                                         $9      
          4        INIT_FCALL                                               'strtotime'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $10     
          7        SUB                                              ~11     $9, $10
          8        DIV                                              ~12     ~11, !1
          9        ASSIGN                                                   !2, ~12
    7    10        ASSIGN                                                   !3, 0
    8    11        ASSIGN                                                   !4, 0.1
    9    12        INIT_FCALL                                               'intdiv'
         13        INIT_FCALL                                               'floor'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $16     
         16        SEND_VAR                                                 $16
         17        SEND_VAL                                                 2
         18        DO_ICALL                                         $17     
         19        ASSIGN                                                   !5, $17
   10    20        MUL                                              ~19     !5, !4
         21        ADD                                              ~20     !3, ~19
         22        ASSIGN                                                   !6, ~20
   12    23        ECHO                                                     !6
   13    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.69 ms | 1013 KiB | 17 Q