3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hj = strtotime(date("Y-m-d")); // pega a data atual $vence = strtotime("1985-10-21"); $resultado = ceil(($hj - $vence) / (60 * 60 * 24)); // converte de timestamp para dias if($resultado < 0){ $resultado = $resultado * -1; $texto = " dias para vencer"; }else $texto = " dias vencido"; echo $resultado . $texto;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BNpg9
function name:  (null)
number of ops:  27
compiled vars:  !0 = $hj, !1 = $vence, !2 = $resultado, !3 = $texto
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'strtotime'
          1        INIT_FCALL                                               'date'
          2        SEND_VAL                                                 'Y-m-d'
          3        DO_ICALL                                         $4      
          4        SEND_VAR                                                 $4
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !0, $5
    3     7        INIT_FCALL                                               'strtotime'
          8        SEND_VAL                                                 '1985-10-21'
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !1, $7
    4    11        INIT_FCALL                                               'ceil'
         12        SUB                                              ~9      !0, !1
         13        DIV                                              ~10     ~9, 86400
         14        SEND_VAL                                                 ~10
         15        DO_ICALL                                         $11     
         16        ASSIGN                                                   !2, $11
    5    17        IS_SMALLER                                               !2, 0
         18      > JMPZ                                                     ~13, ->23
    6    19    >   MUL                                              ~14     !2, -1
         20        ASSIGN                                                   !2, ~14
    7    21        ASSIGN                                                   !3, '+dias+para+vencer'
         22      > JMP                                                      ->24
    9    23    >   ASSIGN                                                   !3, '+dias+vencido'
   10    24    >   CONCAT                                           ~18     !2, !3
         25        ECHO                                                     ~18
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.86 ms | 1395 KiB | 19 Q