3v4l.org

run code in 500+ PHP versions simultaneously
<?php $d1 = new \Datetime('2017-5-1'); $d2 = new \Datetime('2017-6-1'); $diff = $d1->diff($d2); echo sprintf('%d Month\\s', $diff->m) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZsDWN
function name:  (null)
number of ops:  19
compiled vars:  !0 = $d1, !1 = $d2, !2 = $diff
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   NEW                                                  $3      'Datetime'
          1        SEND_VAL_EX                                                  '2017-5-1'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $3
    4     4        NEW                                                  $6      'Datetime'
          5        SEND_VAL_EX                                                  '2017-6-1'
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $6
    6     8        INIT_METHOD_CALL                                             !0, 'diff'
          9        SEND_VAR_EX                                                  !1
         10        DO_FCALL                                          0  $9      
         11        ASSIGN                                                       !2, $9
    8    12        FETCH_OBJ_R                                          ~11     !2, 'm'
         13        CAST                                              4  ~12     ~11
         14        NOP                                                          
         15        FAST_CONCAT                                          ~13     ~12, '+Month%5Cs'
         16        CONCAT                                               ~14     ~13, '%0A'
         17        ECHO                                                         ~14
         18      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.8 ms | 2939 KiB | 13 Q