3v4l.org

run code in 300+ PHP versions simultaneously
<?php $month = 1; $year = 2016; $firstDay = new DateTime("first day of {$month} {$year}"); echo $firstDay->format('Y-m-d');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TXmjQ
function name:  (null)
number of ops:  15
compiled vars:  !0 = $month, !1 = $year, !2 = $firstDay
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 1
    4     1        ASSIGN                                                   !1, 2016
    6     2        NEW                                              $5      'DateTime'
          3        ROPE_INIT                                     4  ~7      'first+day+of+'
          4        ROPE_ADD                                      1  ~7      ~7, !0
          5        ROPE_ADD                                      2  ~7      ~7, '+'
          6        ROPE_END                                      3  ~6      ~7, !1
          7        SEND_VAL_EX                                              ~6
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !2, $5
    7    10        INIT_METHOD_CALL                                         !2, 'format'
         11        SEND_VAL_EX                                              'Y-m-d'
         12        DO_FCALL                                      0  $11     
         13        ECHO                                                     $11
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.35 ms | 1393 KiB | 13 Q