3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set("America/New_York"); $json = '{ "StartDate": "5\/12\/2014", "EndDate": "5\/23\/2015" }'; $data = json_decode($json,true); function relativeDays($date){ $date .= " 12am"; $time = strtotime($date); return time() - $time; } var_dump(relativeDays($data['EndDate']));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6CoOQ
function name:  (null)
number of ops:  17
compiled vars:  !0 = $json, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'America%2FNew_York'
          2        DO_ICALL                                                 
    5     3        ASSIGN                                                   !0, '%7B%0A++++%22StartDate%22%3A+%225%5C%2F12%5C%2F2014%22%2C%0A++++%22EndDate%22%3A+%225%5C%2F23%5C%2F2015%22%0A%7D'
   10     4        INIT_FCALL                                               'json_decode'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !1, $4
   19     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'relativedays'
         11        FETCH_DIM_R                                      ~6      !1, 'EndDate'
         12        SEND_VAL                                                 ~6
         13        DO_FCALL                                      0  $7      
         14        SEND_VAR                                                 $7
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function relativedays:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6CoOQ
function name:  relativeDays
number of ops:  11
compiled vars:  !0 = $date, !1 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        ASSIGN_OP                                     8          !0, '+12am'
   15     2        INIT_FCALL                                               'strtotime'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
   16     6        INIT_FCALL                                               'time'
          7        DO_ICALL                                         $5      
          8        SUB                                              ~6      $5, !1
          9      > RETURN                                                   ~6
   17    10*     > RETURN                                                   null

End of function relativedays

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.91 ms | 1398 KiB | 24 Q