3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo (new DateTime())->format('Y-m-d'); function getDateDifference($datetime1, $datetime2) { $datetime1 = date_create($datetime1); $datetime2 = date_create($datetime2); $interval = date_diff($datetime1, $datetime2); return $interval->format('%m'); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9YRSF
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $0      'DateTime'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'format'
          3        SEND_VAL_EX                                              'Y-m-d'
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
   10     6      > RETURN                                                   1

Function getdatedifference:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9YRSF
function name:  getDateDifference
number of ops:  20
compiled vars:  !0 = $datetime1, !1 = $datetime2, !2 = $interval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        INIT_FCALL                                               'date_create'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !0, $3
    6     6        INIT_FCALL                                               'date_create'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !1, $5
    8    10        INIT_FCALL                                               'date_diff'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $7      
         14        ASSIGN                                                   !2, $7
    9    15        INIT_METHOD_CALL                                         !2, 'format'
         16        SEND_VAL_EX                                              '%25m'
         17        DO_FCALL                                      0  $9      
         18      > RETURN                                                   $9
   10    19*     > RETURN                                                   null

End of function getdatedifference

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.86 ms | 1395 KiB | 17 Q