3v4l.org

run code in 300+ PHP versions simultaneously
<?php $day1 = new DateTime( '2010-01-30' ); $day1->modify( '+1 month' ); $firstdaynextmonth=$day1->format( 'm' ); $firstday=$day1->format( 'd-m-Y' ); $day2 = new DateTime( '2010-01-30' ); $day2->modify( 'last day of next month' ); $seconddaynextmonth=$day2->format( 'm' ); $secondday=$day2->format( 'd-m-Y' ); echo "1st-".$firstday, "\n"; echo "2nd-".$secondday, "\n"; echo "1stnext month-".$firstdaynextmonth, "\n"; echo "2ndnext month-".$seconddaynextmonth, "\n"; //if($firstday > $secondday){ //echo $secondday; //} //else // echo $firstday; $result=($firstdaynextmonth == $seconddaynextmonth)?$firstday:$secondday; echo $result;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 46
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8kaHN
function name:  (null)
number of ops:  50
compiled vars:  !0 = $day1, !1 = $firstdaynextmonth, !2 = $firstday, !3 = $day2, !4 = $seconddaynextmonth, !5 = $secondday, !6 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $7      'DateTime'
          1        SEND_VAL_EX                                              '2010-01-30'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $7
    3     4        INIT_METHOD_CALL                                         !0, 'modify'
          5        SEND_VAL_EX                                              '%2B1+month'
          6        DO_FCALL                                      0          
    4     7        INIT_METHOD_CALL                                         !0, 'format'
          8        SEND_VAL_EX                                              'm'
          9        DO_FCALL                                      0  $11     
         10        ASSIGN                                                   !1, $11
    5    11        INIT_METHOD_CALL                                         !0, 'format'
         12        SEND_VAL_EX                                              'd-m-Y'
         13        DO_FCALL                                      0  $13     
         14        ASSIGN                                                   !2, $13
    7    15        NEW                                              $15     'DateTime'
         16        SEND_VAL_EX                                              '2010-01-30'
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !3, $15
    8    19        INIT_METHOD_CALL                                         !3, 'modify'
         20        SEND_VAL_EX                                              'last+day+of+next+month'
         21        DO_FCALL                                      0          
    9    22        INIT_METHOD_CALL                                         !3, 'format'
         23        SEND_VAL_EX                                              'm'
         24        DO_FCALL                                      0  $19     
         25        ASSIGN                                                   !4, $19
   10    26        INIT_METHOD_CALL                                         !3, 'format'
         27        SEND_VAL_EX                                              'd-m-Y'
         28        DO_FCALL                                      0  $21     
         29        ASSIGN                                                   !5, $21
   12    30        CONCAT                                           ~23     '1st-', !2
         31        ECHO                                                     ~23
         32        ECHO                                                     '%0A'
   13    33        CONCAT                                           ~24     '2nd-', !5
         34        ECHO                                                     ~24
         35        ECHO                                                     '%0A'
   14    36        CONCAT                                           ~25     '1stnext+month-', !1
         37        ECHO                                                     ~25
         38        ECHO                                                     '%0A'
   15    39        CONCAT                                           ~26     '2ndnext+month-', !4
         40        ECHO                                                     ~26
         41        ECHO                                                     '%0A'
   21    42        IS_EQUAL                                                 !1, !4
         43      > JMPZ                                                     ~27, ->46
         44    >   QM_ASSIGN                                        ~28     !2
         45      > JMP                                                      ->47
         46    >   QM_ASSIGN                                        ~28     !5
         47    >   ASSIGN                                                   !6, ~28
   22    48        ECHO                                                     !6
         49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.79 ms | 1399 KiB | 13 Q