3v4l.org

run code in 300+ PHP versions simultaneously
<?php $yr="2012"; $dif=2012-$yr;if($dif < 0) $dif=$dif-1;if($dif > 1) $dif=$dif+1; $week="01"; $day="Monday"; $day=date("D",strtotime($day)); echo date("Y-m-d", strtotime($yr."W".$week."D ".$day)-(86000*$dif));; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
Branch analysis from position: 7
filename:       /in/c4iJt
function name:  (null)
number of ops:  36
compiled vars:  !0 = $yr, !1 = $dif, !2 = $week, !3 = $day
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '2012'
    3     1        SUB                                              ~5      2012, !0
          2        ASSIGN                                                   !1, ~5
          3        IS_SMALLER                                               !1, 0
          4      > JMPZ                                                     ~7, ->7
          5    >   SUB                                              ~8      !1, 1
          6        ASSIGN                                                   !1, ~8
          7    >   IS_SMALLER                                               1, !1
          8      > JMPZ                                                     ~10, ->11
          9    >   ADD                                              ~11     !1, 1
         10        ASSIGN                                                   !1, ~11
    4    11    >   ASSIGN                                                   !2, '01'
    5    12        ASSIGN                                                   !3, 'Monday'
    6    13        INIT_FCALL                                               'date'
         14        SEND_VAL                                                 'D'
         15        INIT_FCALL                                               'strtotime'
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                         $15     
         18        SEND_VAR                                                 $15
         19        DO_ICALL                                         $16     
         20        ASSIGN                                                   !3, $16
    7    21        INIT_FCALL                                               'date'
         22        SEND_VAL                                                 'Y-m-d'
         23        INIT_FCALL                                               'strtotime'
         24        CONCAT                                           ~18     !0, 'W'
         25        CONCAT                                           ~19     ~18, !2
         26        CONCAT                                           ~20     ~19, 'D+'
         27        CONCAT                                           ~21     ~20, !3
         28        SEND_VAL                                                 ~21
         29        DO_ICALL                                         $22     
         30        MUL                                              ~23     !1, 86000
         31        SUB                                              ~24     $22, ~23
         32        SEND_VAL                                                 ~24
         33        DO_ICALL                                         $25     
         34        ECHO                                                     $25
    9    35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.97 ms | 1396 KiB | 17 Q