3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getDay($day) { $days = ['Monday' => 1, 'Tuesday' => 2, 'Wednesday' => 3, 'Thursday' => 4, 'Friday' => 5, 'Saturday' => 6, 'Sunday' => 7]; $today = new \DateTime(); $today->setISODate($today->format('o'), $today->format('W'), $days[ucfirst($day)]); return $today; } if (getDay == 'Tuesday') { echo "sali"; } else { echo "carsamba"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AjYmQ
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_CONSTANT                                   ~0      'getDay'
          1        IS_EQUAL                                                 ~0, 'Tuesday'
          2      > JMPZ                                                     ~1, ->5
   11     3    >   ECHO                                                     'sali'
          4      > JMP                                                      ->6
   13     5    >   ECHO                                                     'carsamba'
   14     6    > > RETURN                                                   1

Function getday:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AjYmQ
function name:  getDay
number of ops:  23
compiled vars:  !0 = $day, !1 = $days, !2 = $today
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <array>
    6     2        NEW                                              $4      'DateTime'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !2, $4
    7     5        INIT_METHOD_CALL                                         !2, 'setISODate'
          6        INIT_METHOD_CALL                                         !2, 'format'
          7        SEND_VAL_EX                                              'o'
          8        DO_FCALL                                      0  $7      
          9        SEND_VAR_NO_REF_EX                                       $7
         10        INIT_METHOD_CALL                                         !2, 'format'
         11        SEND_VAL_EX                                              'W'
         12        DO_FCALL                                      0  $8      
         13        SEND_VAR_NO_REF_EX                                       $8
         14        CHECK_FUNC_ARG                                           
         15        INIT_FCALL                                               'ucfirst'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $9      
         18        FETCH_DIM_FUNC_ARG                               $10     !1, $9
         19        SEND_FUNC_ARG                                            $10
         20        DO_FCALL                                      0          
    8    21      > RETURN                                                   !2
    9    22*     > RETURN                                                   null

End of function getday

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.09 ms | 1396 KiB | 15 Q