3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $Draw_time = "29/01/2016 7pm"; $date = DateTime::createFromFormat("d/m/Y ha",$Draw_time); $new_date = $date->format('Y-m-d H:i:s'); $seconds = strtotime($new_date) - time(); $days = floor($seconds / 86400); $seconds %= 86400; $hours = floor($seconds / 3600); $seconds %= 3600; $minutes = floor($seconds / 60); $seconds %= 60; echo "$days days and $hours hours and $minutes minutes and $seconds seconds";
based on 9nNm7
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/5HEAS
function name:  (null)
number of ops:  45
compiled vars:  !0 = $Draw_time, !1 = $date, !2 = $new_date, !3 = $seconds, !4 = $days, !5 = $hours, !6 = $minutes
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ASSIGN                                                   !0, '29%2F01%2F2016+7pm'
   5     1        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
         2        SEND_VAL_EX                                              'd%2Fm%2FY+ha'
         3        SEND_VAR_EX                                              !0
         4        DO_FCALL                                      0  $8      
         5        ASSIGN                                                   !1, $8
   6     6        INIT_METHOD_CALL                                         !1, 'format'
         7        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         8        DO_FCALL                                      0  $10     
         9        ASSIGN                                                   !2, $10
   7    10        INIT_FCALL                                               'strtotime'
        11        SEND_VAR                                                 !2
        12        DO_ICALL                                         $12     
        13        INIT_FCALL                                               'time'
        14        DO_ICALL                                         $13     
        15        SUB                                              ~14     $12, $13
        16        ASSIGN                                                   !3, ~14
   9    17        INIT_FCALL                                               'floor'
        18        DIV                                              ~16     !3, 86400
        19        SEND_VAL                                                 ~16
        20        DO_ICALL                                         $17     
        21        ASSIGN                                                   !4, $17
  10    22        ASSIGN_MOD                                    0          !3, 86400
  12    23        INIT_FCALL                                               'floor'
        24        DIV                                              ~20     !3, 3600
        25        SEND_VAL                                                 ~20
        26        DO_ICALL                                         $21     
        27        ASSIGN                                                   !5, $21
  13    28        ASSIGN_MOD                                    0          !3, 3600
  15    29        INIT_FCALL                                               'floor'
        30        DIV                                              ~24     !3, 60
        31        SEND_VAL                                                 ~24
        32        DO_ICALL                                         $25     
        33        ASSIGN                                                   !6, $25
  16    34        ASSIGN_MOD                                    0          !3, 60
  18    35        ROPE_INIT                                     8  ~29     !4
        36        ROPE_ADD                                      1  ~29     ~29, '+days+and+'
        37        ROPE_ADD                                      2  ~29     ~29, !5
        38        ROPE_ADD                                      3  ~29     ~29, '+hours+and+'
        39        ROPE_ADD                                      4  ~29     ~29, !6
        40        ROPE_ADD                                      5  ~29     ~29, '+minutes+and+'
        41        ROPE_ADD                                      6  ~29     ~29, !3
        42        ROPE_END                                      7  ~28     ~29, '+seconds'
        43        ECHO                                                     ~28
        44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0