3v4l.org

run code in 300+ PHP versions simultaneously
<?php $format="Y-m"; $date="2018-02"; $d = DateTime::createFromFormat($format, $date); echo ($d->format($format)); echo "\n" . date_format($d, $format);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/troeg
function name:  (null)
number of ops:  18
compiled vars:  !0 = $format, !1 = $date, !2 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Y-m'
    4     1        ASSIGN                                                   !1, '2018-02'
    7     2        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !2, $5
    8     7        INIT_METHOD_CALL                                         !2, 'format'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $7      
         10        ECHO                                                     $7
   10    11        INIT_FCALL                                               'date_format'
         12        SEND_VAR                                                 !2
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $8      
         15        CONCAT                                           ~9      '%0A', $8
         16        ECHO                                                     ~9
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.12 ms | 1431 KiB | 14 Q