3v4l.org

run code in 300+ PHP versions simultaneously
<?php /*Bugünkü Zamandan Önce Bir Tarih Girilirse Kaç Gün Geçtiğini, Bugünkü Zamandan Sonra Bir Tarih Girilirse Ne Kadar Kaldığığını Verir... http://abgsatman.com */ define("SANIYE",1); define("DAKIKA_SN",60*SANIYE); define("SAAT_SN",60*DAKIKA_SN); define("GUN_SN",24*SAAT_SN); class KalanZaman { var $snfark,$gun,$saat,$dakika,$saniye; var $durum="Var"; function KalanZaman($g) { $this->hesapla($g); } function hesapla($v) { $this->snfark = strtotime($v)-time(); if($this->snfark<0) { $this->snfark *= (-1); $this->durum = "Geçti"; } $this->gun = floor($this->snfark/GUN_SN); $this->snfark -= $this->gun*GUN_SN; $this->saat = floor($this->snfark/SAAT_SN); $this->snfark -= $this->saat*SAAT_SN; $this->dakika = floor($this->snfark/DAKIKA_SN); $this->snfark -= $this->dakika*DAKIKA_SN; $this->saniye = $this->snfark; } function rString() { $retVal = ""; if($this->gun!=0) $retVal .= $this->gun." Gün "; if($this->saat!=0) $retVal .=$this->saat." Saat "; if($this->dakika!=0) $retVal .=$this->dakika." Dakika "; if($this->saniye!=0) $retVal .=$this->saniye." Saniye"; return $retVal." ".$this->durum; } } $girilen_zaman = "2005-06-10 10:00:00"; $kalan_zaman = new KalanZaman("$girilen_zaman"); //Girilen Değerler MySQL datetime Formatıdır. :) echo "Girilen Zaman :$girilen_zaman<br>"; echo $kalan_zaman->rString(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2nmkp
function name:  (null)
number of ops:  36
compiled vars:  !0 = $girilen_zaman, !1 = $kalan_zaman
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'SANIYE'
          2        SEND_VAL                                                 1
          3        DO_ICALL                                                 
    7     4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 'DAKIKA_SN'
          6        FETCH_CONSTANT                                   ~3      'SANIYE'
          7        MUL                                              ~4      ~3, 60
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
    8    10        INIT_FCALL                                               'define'
         11        SEND_VAL                                                 'SAAT_SN'
         12        FETCH_CONSTANT                                   ~6      'DAKIKA_SN'
         13        MUL                                              ~7      ~6, 60
         14        SEND_VAL                                                 ~7
         15        DO_ICALL                                                 
    9    16        INIT_FCALL                                               'define'
         17        SEND_VAL                                                 'GUN_SN'
         18        FETCH_CONSTANT                                   ~9      'SAAT_SN'
         19        MUL                                              ~10     ~9, 24
         20        SEND_VAL                                                 ~10
         21        DO_ICALL                                                 
   42    22        ASSIGN                                                   !0, '2005-06-10+10%3A00%3A00'
   43    23        NEW                                              $13     'KalanZaman'
         24        CAST                                          6  ~14     !0
         25        SEND_VAL_EX                                              ~14
         26        DO_FCALL                                      0          
         27        ASSIGN                                                   !1, $13
   45    28        ROPE_INIT                                     3  ~18     'Girilen+Zaman+%3A'
         29        ROPE_ADD                                      1  ~18     ~18, !0
         30        ROPE_END                                      2  ~17     ~18, '%3Cbr%3E'
         31        ECHO                                                     ~17
   46    32        INIT_METHOD_CALL                                         !1, 'rString'
         33        DO_FCALL                                      0  $20     
         34        ECHO                                                     $20
   47    35      > RETURN                                                   1

Class KalanZaman:
Function kalanzaman:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2nmkp
function name:  KalanZaman
number of ops:  5
compiled vars:  !0 = $g
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        INIT_METHOD_CALL                                         'hesapla'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   16     4      > RETURN                                                   null

End of function kalanzaman

Function hesapla:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/2nmkp
function name:  hesapla
number of ops:  59
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        INIT_FCALL                                               'strtotime'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        INIT_FCALL                                               'time'
          5        DO_ICALL                                         $3      
          6        SUB                                              ~4      $2, $3
          7        ASSIGN_OBJ                                               'snfark'
          8        OP_DATA                                                  ~4
   19     9        FETCH_OBJ_R                                      ~5      'snfark'
         10        IS_SMALLER                                               ~5, 0
         11      > JMPZ                                                     ~6, ->16
   20    12    >   ASSIGN_OBJ_OP                                 3          'snfark'
         13        OP_DATA                                                  -1
   21    14        ASSIGN_OBJ                                               'durum'
         15        OP_DATA                                                  'Ge%C3%A7ti'
   23    16    >   INIT_FCALL                                               'floor'
         17        FETCH_OBJ_R                                      ~10     'snfark'
         18        FETCH_CONSTANT                                   ~11     'GUN_SN'
         19        DIV                                              ~12     ~10, ~11
         20        SEND_VAL                                                 ~12
         21        DO_ICALL                                         $13     
         22        ASSIGN_OBJ                                               'gun'
         23        OP_DATA                                                  $13
   24    24        FETCH_OBJ_R                                      ~15     'gun'
         25        FETCH_CONSTANT                                   ~16     'GUN_SN'
         26        MUL                                              ~17     ~15, ~16
         27        ASSIGN_OBJ_OP                                 2          'snfark'
         28        OP_DATA                                                  ~17
   25    29        INIT_FCALL                                               'floor'
         30        FETCH_OBJ_R                                      ~19     'snfark'
         31        FETCH_CONSTANT                                   ~20     'SAAT_SN'
         32        DIV                                              ~21     ~19, ~20
         33        SEND_VAL                                                 ~21
         34        DO_ICALL                                         $22     
         35        ASSIGN_OBJ                                               'saat'
         36        OP_DATA                                                  $22
   26    37        FETCH_OBJ_R                                      ~24     'saat'
         38        FETCH_CONSTANT                                   ~25     'SAAT_SN'
         39        MUL                                              ~26     ~24, ~25
         40        ASSIGN_OBJ_OP                                 2          'snfark'
         41        OP_DATA                                                  ~26
   27    42        INIT_FCALL                                               'floor'
         43        FETCH_OBJ_R                                      ~28     'snfark'
         44        FETCH_CONSTANT                                   ~29     'DAKIKA_SN'
         45        DIV                                              ~30     ~28, ~29
         46        SEND_VAL                                                 ~30
         47        DO_ICALL                                         $31     
         48        ASSIGN_OBJ                                               'dakika'
         49        OP_DATA                                                  $31
   28    50        FETCH_OBJ_R                                      ~33     'dakika'
         51        FETCH_CONSTANT                                   ~34     'DAKIKA_SN'
         52        MUL                                              ~35     ~33, ~34
         53        ASSIGN_OBJ_OP                                 2          'snfark'
         54        OP_DATA                                                  ~35
   29    55        FETCH_OBJ_R                                      ~37     'snfark'
         56        ASSIGN_OBJ                                               'saniye'
         57        OP_DATA                                                  ~37
   30    58      > RETURN                                                   null

End of function hesapla

Function rstring:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
Branch analysis from position: 19
Branch analysis from position: 13
Branch analysis from position: 7
filename:       /in/2nmkp
function name:  rString
number of ops:  30
compiled vars:  !0 = $retVal
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   ASSIGN                                                   !0, ''
          1        FETCH_OBJ_R                                      ~2      'gun'
          2        IS_NOT_EQUAL                                             ~2, 0
          3      > JMPZ                                                     ~3, ->7
   33     4    >   FETCH_OBJ_R                                      ~4      'gun'
          5        CONCAT                                           ~5      ~4, '+G%C3%BCn+'
          6        ASSIGN_OP                                     8          !0, ~5
   34     7    >   FETCH_OBJ_R                                      ~7      'saat'
          8        IS_NOT_EQUAL                                             ~7, 0
          9      > JMPZ                                                     ~8, ->13
         10    >   FETCH_OBJ_R                                      ~9      'saat'
         11        CONCAT                                           ~10     ~9, '+Saat+'
         12        ASSIGN_OP                                     8          !0, ~10
   35    13    >   FETCH_OBJ_R                                      ~12     'dakika'
         14        IS_NOT_EQUAL                                             ~12, 0
         15      > JMPZ                                                     ~13, ->19
         16    >   FETCH_OBJ_R                                      ~14     'dakika'
         17        CONCAT                                           ~15     ~14, '+Dakika+'
         18        ASSIGN_OP                                     8          !0, ~15
   36    19    >   FETCH_OBJ_R                                      ~17     'saniye'
         20        IS_NOT_EQUAL                                             ~17, 0
         21      > JMPZ                                                     ~18, ->25
         22    >   FETCH_OBJ_R                                      ~19     'saniye'
         23        CONCAT                                           ~20     ~19, '+Saniye'
         24        ASSIGN_OP                                     8          !0, ~20
   37    25    >   CONCAT                                           ~22     !0, '+'
         26        FETCH_OBJ_R                                      ~23     'durum'
         27        CONCAT                                           ~24     ~22, ~23
         28      > RETURN                                                   ~24
   38    29*     > RETURN                                                   null

End of function rstring

End of class KalanZaman.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.34 ms | 1408 KiB | 21 Q