3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lastmonday = strtotime('last monday of this month'); $lmonday = date('Y-m-d',$lastmonday); $firstday = strtotime('first day of this month'); $fday = date('Y-m-d',$firstday); $d1 = new DateTime($lmonday); $dd1 = $d1->format('Y-m-d'); // $d2 = new DateTime($fday); echo $dd2 = $d2->format('Y-m-d'); // $period_serv = $dd1->diff($dd2); // $theperiod = $period_serv->format('%a'); //echo $theperiod;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o6SXU
function name:  (null)
number of ops:  32
compiled vars:  !0 = $lastmonday, !1 = $lmonday, !2 = $firstday, !3 = $fday, !4 = $d1, !5 = $dd1, !6 = $dd2, !7 = $d2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'strtotime'
          1        SEND_VAL                                                 'last+monday+of+this+month'
          2        DO_ICALL                                         $8      
          3        ASSIGN                                                   !0, $8
    5     4        INIT_FCALL                                               'date'
          5        SEND_VAL                                                 'Y-m-d'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $10     
          8        ASSIGN                                                   !1, $10
    8     9        INIT_FCALL                                               'strtotime'
         10        SEND_VAL                                                 'first+day+of+this+month'
         11        DO_ICALL                                         $12     
         12        ASSIGN                                                   !2, $12
   10    13        INIT_FCALL                                               'date'
         14        SEND_VAL                                                 'Y-m-d'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $14     
         17        ASSIGN                                                   !3, $14
   15    18        NEW                                              $16     'DateTime'
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !4, $16
   16    22        INIT_METHOD_CALL                                         !4, 'format'
         23        SEND_VAL_EX                                              'Y-m-d'
         24        DO_FCALL                                      0  $19     
         25        ASSIGN                                                   !5, $19
   18    26        INIT_METHOD_CALL                                         !7, 'format'
         27        SEND_VAL_EX                                              'Y-m-d'
         28        DO_FCALL                                      0  $21     
         29        ASSIGN                                           ~22     !6, $21
         30        ECHO                                                     ~22
   23    31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.77 ms | 1396 KiB | 17 Q