3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lastmonday = strtotime('last monday of this month'); echo date('Y-m-d',$lastmonday); $firstday = strtotime('first day of this month'); echo date('Y-m-d',$firstday); $d1 = new DateTime($lastmonday); $d2 = new DateTime($firstday); $period_serv = $d1->diff($d2); $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/JpEjM
function name:  (null)
number of ops:  36
compiled vars:  !0 = $lastmonday, !1 = $firstday, !2 = $d1, !3 = $d2, !4 = $period_serv, !5 = $theperiod
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                                         $6      
          3        ASSIGN                                                   !0, $6
    5     4        INIT_FCALL                                               'date'
          5        SEND_VAL                                                 'Y-m-d'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $8      
          8        ECHO                                                     $8
    8     9        INIT_FCALL                                               'strtotime'
         10        SEND_VAL                                                 'first+day+of+this+month'
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !1, $9
   10    13        INIT_FCALL                                               'date'
         14        SEND_VAL                                                 'Y-m-d'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $11     
         17        ECHO                                                     $11
   13    18        NEW                                              $12     'DateTime'
         19        SEND_VAR_EX                                              !0
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !2, $12
   14    22        NEW                                              $15     'DateTime'
         23        SEND_VAR_EX                                              !1
         24        DO_FCALL                                      0          
         25        ASSIGN                                                   !3, $15
   16    26        INIT_METHOD_CALL                                         !2, 'diff'
         27        SEND_VAR_EX                                              !3
         28        DO_FCALL                                      0  $18     
         29        ASSIGN                                                   !4, $18
   17    30        INIT_METHOD_CALL                                         !4, 'format'
         31        SEND_VAL_EX                                              '%25a'
         32        DO_FCALL                                      0  $20     
         33        ASSIGN                                                   !5, $20
   19    34        ECHO                                                     !5
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.92 ms | 1401 KiB | 17 Q