3v4l.org

run code in 300+ PHP versions simultaneously
<?php $month = 5; $monthName = date('M', strtotime('2012-'.$month.'-01')); $to = strtotime('last day of '.$monthName.', 23:59:59'); if ( $to < time() ) { $to = strtotime('last day of '.$monthName.' '.(date('Y')+1).', 23:59:59'); } $from = strtotime('first day of this month', $to); echo date('d.m.Y H:i:s', $from)."\r\n"; echo date('d.m.Y H:i:s', $to)."\r\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 33
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/8gsic
function name:  (null)
number of ops:  51
compiled vars:  !0 = $month, !1 = $monthName, !2 = $to, !3 = $from
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 5
    4     1        INIT_FCALL                                               'date'
          2        SEND_VAL                                                 'M'
          3        INIT_FCALL                                               'strtotime'
          4        CONCAT                                           ~5      '2012-', !0
          5        CONCAT                                           ~6      ~5, '-01'
          6        SEND_VAL                                                 ~6
          7        DO_ICALL                                         $7      
          8        SEND_VAR                                                 $7
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !1, $8
    6    11        INIT_FCALL                                               'strtotime'
         12        CONCAT                                           ~10     'last+day+of+', !1
         13        CONCAT                                           ~11     ~10, '%2C+23%3A59%3A59'
         14        SEND_VAL                                                 ~11
         15        DO_ICALL                                         $12     
         16        ASSIGN                                                   !2, $12
    7    17        INIT_FCALL                                               'time'
         18        DO_ICALL                                         $14     
         19        IS_SMALLER                                               !2, $14
         20      > JMPZ                                                     ~15, ->33
    8    21    >   INIT_FCALL                                               'strtotime'
         22        CONCAT                                           ~16     'last+day+of+', !1
         23        CONCAT                                           ~17     ~16, '+'
         24        INIT_FCALL                                               'date'
         25        SEND_VAL                                                 'Y'
         26        DO_ICALL                                         $18     
         27        ADD                                              ~19     $18, 1
         28        CONCAT                                           ~20     ~17, ~19
         29        CONCAT                                           ~21     ~20, '%2C+23%3A59%3A59'
         30        SEND_VAL                                                 ~21
         31        DO_ICALL                                         $22     
         32        ASSIGN                                                   !2, $22
   11    33    >   INIT_FCALL                                               'strtotime'
         34        SEND_VAL                                                 'first+day+of+this+month'
         35        SEND_VAR                                                 !2
         36        DO_ICALL                                         $24     
         37        ASSIGN                                                   !3, $24
   13    38        INIT_FCALL                                               'date'
         39        SEND_VAL                                                 'd.m.Y+H%3Ai%3As'
         40        SEND_VAR                                                 !3
         41        DO_ICALL                                         $26     
         42        CONCAT                                           ~27     $26, '%0D%0A'
         43        ECHO                                                     ~27
   14    44        INIT_FCALL                                               'date'
         45        SEND_VAL                                                 'd.m.Y+H%3Ai%3As'
         46        SEND_VAR                                                 !2
         47        DO_ICALL                                         $28     
         48        CONCAT                                           ~29     $28, '%0D%0A'
         49        ECHO                                                     ~29
         50      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.59 ms | 1400 KiB | 19 Q