3v4l.org

run code in 300+ PHP versions simultaneously
<?php print_r(getMonth(null)); function getMonth($d) { return dtf($d,'n'); } function getQuarter($d) { return ceil( getMonth($d) / 3); } function dtf($date, $format = 'd.m.Y'){ $date = new DateTime($date); return $date->format($format); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/V3u2q
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL_BY_NAME                                       'getMonth'
          2        SEND_VAL_EX                                              null
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   18     6      > RETURN                                                   1

Function getmonth:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/V3u2q
function name:  getMonth
number of ops:  7
compiled vars:  !0 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        INIT_FCALL_BY_NAME                                       'dtf'
          2        SEND_VAR_EX                                              !0
          3        SEND_VAL_EX                                              'n'
          4        DO_FCALL                                      0  $1      
          5      > RETURN                                                   $1
    8     6*     > RETURN                                                   null

End of function getmonth

Function getquarter:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/V3u2q
function name:  getQuarter
number of ops:  10
compiled vars:  !0 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'ceil'
          2        INIT_FCALL                                               'getmonth'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $1      
          5        DIV                                              ~2      $1, 3
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                         $3      
          8      > RETURN                                                   $3
   13     9*     > RETURN                                                   null

End of function getquarter

Function dtf:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/V3u2q
function name:  dtf
number of ops:  11
compiled vars:  !0 = $date, !1 = $format
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      'd.m.Y'
   16     2        NEW                                              $2      'DateTime'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   17     6        INIT_METHOD_CALL                                         !0, 'format'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0  $5      
          9      > RETURN                                                   $5
   18    10*     > RETURN                                                   null

End of function dtf

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.2 ms | 1403 KiB | 18 Q