3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.23 ms | 1396 KiB | 17 Q