3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Prague'); $t = 1414754455; // 31.10.2014 # time() - 24*60*60; // yesterday $dt = new Datetime($t); $dt->modify("+1 month"); $dt->format("d.m.Y"); $t1 = strtotime("next month", $t); $t2 = strtotime("first day of next month", $t); echo date("d.m.Y", $t) . ": $t\n"; echo date("d.m.Y", $t1) . ": $t1\n"; echo date("d.m.Y", $t2) . ": $t2\n"; echo "DIFF: " . ($t1-$t2); echo $dt->format("d.m.Y") . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1N3Ms
function name:  (null)
number of ops:  60
compiled vars:  !0 = $t, !1 = $dt, !2 = $t1, !3 = $t2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'Europe%2FPrague'
          2        DO_ICALL                                                 
    5     3        ASSIGN                                                   !0, 1414754455
    7     4        NEW                                              $6      'Datetime'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
    8     8        INIT_METHOD_CALL                                         !1, 'modify'
          9        SEND_VAL_EX                                              '%2B1+month'
         10        DO_FCALL                                      0          
    9    11        INIT_METHOD_CALL                                         !1, 'format'
         12        SEND_VAL_EX                                              'd.m.Y'
         13        DO_FCALL                                      0          
   11    14        INIT_FCALL                                               'strtotime'
         15        SEND_VAL                                                 'next+month'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $11     
         18        ASSIGN                                                   !2, $11
   12    19        INIT_FCALL                                               'strtotime'
         20        SEND_VAL                                                 'first+day+of+next+month'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $13     
         23        ASSIGN                                                   !3, $13
   14    24        INIT_FCALL                                               'date'
         25        SEND_VAL                                                 'd.m.Y'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $15     
         28        ROPE_INIT                                     3  ~17     '%3A+'
         29        ROPE_ADD                                      1  ~17     ~17, !0
         30        ROPE_END                                      2  ~16     ~17, '%0A'
         31        CONCAT                                           ~19     $15, ~16
         32        ECHO                                                     ~19
   15    33        INIT_FCALL                                               'date'
         34        SEND_VAL                                                 'd.m.Y'
         35        SEND_VAR                                                 !2
         36        DO_ICALL                                         $20     
         37        ROPE_INIT                                     3  ~22     '%3A+'
         38        ROPE_ADD                                      1  ~22     ~22, !2
         39        ROPE_END                                      2  ~21     ~22, '%0A'
         40        CONCAT                                           ~24     $20, ~21
         41        ECHO                                                     ~24
   16    42        INIT_FCALL                                               'date'
         43        SEND_VAL                                                 'd.m.Y'
         44        SEND_VAR                                                 !3
         45        DO_ICALL                                         $25     
         46        ROPE_INIT                                     3  ~27     '%3A+'
         47        ROPE_ADD                                      1  ~27     ~27, !3
         48        ROPE_END                                      2  ~26     ~27, '%0A'
         49        CONCAT                                           ~29     $25, ~26
         50        ECHO                                                     ~29
   17    51        SUB                                              ~30     !2, !3
         52        CONCAT                                           ~31     'DIFF%3A+', ~30
         53        ECHO                                                     ~31
   19    54        INIT_METHOD_CALL                                         !1, 'format'
         55        SEND_VAL_EX                                              'd.m.Y'
         56        DO_FCALL                                      0  $32     
         57        CONCAT                                           ~33     $32, '%0A'
         58        ECHO                                                     ~33
         59      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.4 ms | 1392 KiB | 19 Q