3v4l.org

run code in 300+ PHP versions simultaneously
<?php function format_date($t, $s, $f){ return date($f,t); } $week =7*24*3600; $fix = ( intval(format_date(ceil(time()/$week)*$week,'custom', 'd')) - intval(format_date(time(),'custom','d')) )*24*3600; $sql = "select from_unixtime(ceil((created+$fix)/$week)*$week - $fix) date, count(*) from {node} where type='article' and status=1 group by date order by created desc limit 7"; print $sql;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bFDqE
function name:  (null)
number of ops:  38
compiled vars:  !0 = $week, !1 = $fix, !2 = $sql
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 604800
    5     1        INIT_FCALL                                               'format_date'
          2        INIT_FCALL                                               'ceil'
          3        INIT_FCALL                                               'time'
          4        DO_ICALL                                         $4      
          5        DIV                                              ~5      $4, !0
          6        SEND_VAL                                                 ~5
          7        DO_ICALL                                         $6      
          8        MUL                                              ~7      !0, $6
          9        SEND_VAL                                                 ~7
         10        SEND_VAL                                                 'custom'
         11        SEND_VAL                                                 'd'
         12        DO_FCALL                                      0  $8      
         13        CAST                                          4  ~9      $8
         14        INIT_FCALL                                               'format_date'
         15        INIT_FCALL                                               'time'
         16        DO_ICALL                                         $10     
         17        SEND_VAR                                                 $10
         18        SEND_VAL                                                 'custom'
         19        SEND_VAL                                                 'd'
         20        DO_FCALL                                      0  $11     
         21        CAST                                          4  ~12     $11
         22        SUB                                              ~13     ~9, ~12
         23        MUL                                              ~14     ~13, 24
         24        MUL                                              ~15     ~14, 3600
         25        ASSIGN                                                   !1, ~15
    6    26        ROPE_INIT                                     9  ~18     'select+from_unixtime%28ceil%28%28created%2B'
         27        ROPE_ADD                                      1  ~18     ~18, !1
         28        ROPE_ADD                                      2  ~18     ~18, '%29%2F'
         29        ROPE_ADD                                      3  ~18     ~18, !0
         30        ROPE_ADD                                      4  ~18     ~18, '%29%2A'
         31        ROPE_ADD                                      5  ~18     ~18, !0
         32        ROPE_ADD                                      6  ~18     ~18, '+-+'
         33        ROPE_ADD                                      7  ~18     ~18, !1
         34        ROPE_END                                      8  ~17     ~18, '%29+date%2C+count%28%2A%29+from+%7Bnode%7D+where+type%3D%27article%27+and+status%3D1+group+by+date+order+by+created+desc+limit+7'
         35        ASSIGN                                                   !2, ~17
    7    36        ECHO                                                     !2
         37      > RETURN                                                   1

Function format_date:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bFDqE
function name:  format_date
number of ops:  10
compiled vars:  !0 = $t, !1 = $s, !2 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        INIT_FCALL                                               'date'
          4        SEND_VAR                                                 !2
          5        FETCH_CONSTANT                                   ~3      't'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
          9*     > RETURN                                                   null

End of function format_date

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.15 ms | 1403 KiB | 21 Q