3v4l.org

run code in 300+ 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:  20
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        INIT_FCALL                                               'sprintf'
         13        SEND_VAL                                                 '%25d+Month%5Cs'
         14        FETCH_OBJ_R                                      ~11     !2, 'm'
         15        SEND_VAL                                                 ~11
         16        DO_ICALL                                         $12     
         17        CONCAT                                           ~13     $12, '%0A'
         18        ECHO                                                     ~13
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.15 ms | 1386 KiB | 15 Q