3v4l.org

run code in 300+ PHP versions simultaneously
<?php $correctTimestamp = correctMondayTimestamp(); $time_query = "data_ordine BETWEEN DATE('".date("Y-m-d",$correctTimestamp)."') AND DATE_ADD(DATE('".date("Y-m-d",strtotime("sunday this week"))."'), INTERVAL 1 DAY)"; $begin = new DateTime(date("c", $correctTimestamp)); echo "TQ: $time_query\nB: ".date_format('U',$begin); function correctMondayTimestamp(){ if(date('N') == 7) { return strtotime('monday last week'); } else { return strtotime('monday this week'); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mlUTN
function name:  (null)
number of ops:  37
compiled vars:  !0 = $correctTimestamp, !1 = $time_query, !2 = $begin
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL_BY_NAME                                       'correctMondayTimestamp'
          1        DO_FCALL                                      0  $3      
          2        ASSIGN                                                   !0, $3
    3     3        INIT_FCALL                                               'date'
          4        SEND_VAL                                                 'Y-m-d'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        CONCAT                                           ~6      'data_ordine+BETWEEN+DATE%28%27', $5
          8        CONCAT                                           ~7      ~6, '%27%29+AND+DATE_ADD%28DATE%28%27'
          9        INIT_FCALL                                               'date'
         10        SEND_VAL                                                 'Y-m-d'
         11        INIT_FCALL                                               'strtotime'
         12        SEND_VAL                                                 'sunday+this+week'
         13        DO_ICALL                                         $8      
         14        SEND_VAR                                                 $8
         15        DO_ICALL                                         $9      
         16        CONCAT                                           ~10     ~7, $9
         17        CONCAT                                           ~11     ~10, '%27%29%2C+INTERVAL+1+DAY%29'
         18        ASSIGN                                                   !1, ~11
    4    19        NEW                                              $13     'DateTime'
         20        INIT_FCALL                                               'date'
         21        SEND_VAL                                                 'c'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $14     
         24        SEND_VAR_NO_REF_EX                                       $14
         25        DO_FCALL                                      0          
         26        ASSIGN                                                   !2, $13
    6    27        ROPE_INIT                                     3  ~18     'TQ%3A+'
         28        ROPE_ADD                                      1  ~18     ~18, !1
         29        ROPE_END                                      2  ~17     ~18, '%0AB%3A+'
         30        INIT_FCALL                                               'date_format'
         31        SEND_VAL                                                 'U'
         32        SEND_VAR                                                 !2
         33        DO_ICALL                                         $20     
         34        CONCAT                                           ~21     ~17, $20
         35        ECHO                                                     ~21
   14    36      > RETURN                                                   1

Function correctmondaytimestamp:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mlUTN
function name:  correctMondayTimestamp
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'date'
          1        SEND_VAL                                                 'N'
          2        DO_ICALL                                         $0      
          3        IS_EQUAL                                                 $0, 7
          4      > JMPZ                                                     ~1, ->10
   10     5    >   INIT_FCALL                                               'strtotime'
          6        SEND_VAL                                                 'monday+last+week'
          7        DO_ICALL                                         $2      
          8      > RETURN                                                   $2
          9*       JMP                                                      ->14
   12    10    >   INIT_FCALL                                               'strtotime'
         11        SEND_VAL                                                 'monday+this+week'
         12        DO_ICALL                                         $3      
         13      > RETURN                                                   $3
   14    14*     > RETURN                                                   null

End of function correctmondaytimestamp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.72 ms | 1400 KiB | 19 Q