3v4l.org

run code in 300+ PHP versions simultaneously
<?php function lastWeekDay($mnt) { $result = strtotime("1 $mnt"); $result = mktime(0, 0, 0, date('n', $result) + 1, 0, date('Y', $result)); while (in_array(date('D', $result), array('Sat', 'Sun'))) $result -= 86400; return $result; } echo date('d-M-Y', lastWeekDay('Apr 2014'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DHqHC
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'date'
          1        SEND_VAL                                                 'd-M-Y'
          2        INIT_FCALL                                               'lastweekday'
          3        SEND_VAL                                                 'Apr+2014'
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                         $1      
          7        ECHO                                                     $1
          8      > RETURN                                                   1

Function lastweekday:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 26
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 26
Branch analysis from position: 33
Branch analysis from position: 26
filename:       /in/DHqHC
function name:  lastWeekDay
number of ops:  35
compiled vars:  !0 = $mnt, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'strtotime'
          2        NOP                                                      
          3        FAST_CONCAT                                      ~2      '1+', !0
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
    4     7        INIT_FCALL                                               'mktime'
          8        SEND_VAL                                                 0
          9        SEND_VAL                                                 0
         10        SEND_VAL                                                 0
         11        INIT_FCALL                                               'date'
         12        SEND_VAL                                                 'n'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $5      
         15        ADD                                              ~6      $5, 1
         16        SEND_VAL                                                 ~6
         17        SEND_VAL                                                 0
         18        INIT_FCALL                                               'date'
         19        SEND_VAL                                                 'Y'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                         $7      
         22        SEND_VAR                                                 $7
         23        DO_ICALL                                         $8      
         24        ASSIGN                                                   !1, $8
    5    25      > JMP                                                      ->27
         26    >   ASSIGN_OP                                     2          !1, 86400
         27    >   INIT_FCALL                                               'date'
         28        SEND_VAL                                                 'D'
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                         $11     
         31        IN_ARRAY                                                 $11, <array>
         32      > JMPNZ                                                    ~12, ->26
    6    33    > > RETURN                                                   !1
    7    34*     > RETURN                                                   null

End of function lastweekday

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.84 ms | 1403 KiB | 20 Q