3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Anagrafica { protected $contactableFrom; protected $contactableTo; public function getContactableFrom() { return $this->contactableFrom; } public function setContactableFrom($contactableFrom) { $this->contactableFrom = $contactableFrom; } public function getContactableTo() { return $this->contactableTo; } public function setContactableTo($contactableTo) { $this->contactableTo = $contactableTo; } } $anagrafica = new Anagrafica(); $anagrafica->setContactableFrom(\DateTime::createFromFormat('H:i:s', '12:00:00')); $contactableFrom = $anagrafica->getContactableFrom(); $contactableFrom = ($contactableFrom instanceof \DateTime) ? $anagrafica->getContactableFrom()->format('His') : '080000'; $contactableTo = $anagrafica->getContactableTo(); $contactableTo = ($contactableTo instanceof \DateTime) ? $anagrafica->getContactableTo()->format('His') : '220000'; $currentTime = (new \DateTime())->format('His'); if ($currentTime < $contactableFrom || $currentTime > $contactableTo) { echo "FALSE"; } else { echo "TRUE"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 36
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 47) Position 1 = 46, Position 2 = 48
Branch analysis from position: 46
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 51
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
Branch analysis from position: 36
2 jumps found. (Code = 47) Position 1 = 46, Position 2 = 48
Branch analysis from position: 46
Branch analysis from position: 48
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 36
Branch analysis from position: 29
Branch analysis from position: 36
filename:       /in/lvak3
function name:  (null)
number of ops:  53
compiled vars:  !0 = $anagrafica, !1 = $contactableFrom, !2 = $contactableTo, !3 = $currentTime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $4      'Anagrafica'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   29     3        INIT_METHOD_CALL                                         !0, 'setContactableFrom'
          4        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          5        SEND_VAL                                                 'H%3Ai%3As'
          6        SEND_VAL                                                 '12%3A00%3A00'
          7        DO_FCALL                                      0  $7      
          8        SEND_VAR_NO_REF_EX                                       $7
          9        DO_FCALL                                      0          
   31    10        INIT_METHOD_CALL                                         !0, 'getContactableFrom'
         11        DO_FCALL                                      0  $9      
         12        ASSIGN                                                   !1, $9
   32    13        INSTANCEOF                                               !1, 'DateTime'
         14      > JMPZ                                                     ~11, ->22
         15    >   INIT_METHOD_CALL                                         !0, 'getContactableFrom'
         16        DO_FCALL                                      0  $12     
         17        INIT_METHOD_CALL                                         $12, 'format'
         18        SEND_VAL_EX                                              'His'
         19        DO_FCALL                                      0  $13     
         20        QM_ASSIGN                                        ~14     $13
         21      > JMP                                                      ->23
         22    >   QM_ASSIGN                                        ~14     '080000'
         23    >   ASSIGN                                                   !1, ~14
   33    24        INIT_METHOD_CALL                                         !0, 'getContactableTo'
         25        DO_FCALL                                      0  $16     
         26        ASSIGN                                                   !2, $16
   34    27        INSTANCEOF                                               !2, 'DateTime'
         28      > JMPZ                                                     ~18, ->36
         29    >   INIT_METHOD_CALL                                         !0, 'getContactableTo'
         30        DO_FCALL                                      0  $19     
         31        INIT_METHOD_CALL                                         $19, 'format'
         32        SEND_VAL_EX                                              'His'
         33        DO_FCALL                                      0  $20     
         34        QM_ASSIGN                                        ~21     $20
         35      > JMP                                                      ->37
         36    >   QM_ASSIGN                                        ~21     '220000'
         37    >   ASSIGN                                                   !2, ~21
   35    38        NEW                                              $23     'DateTime'
         39        DO_FCALL                                      0          
         40        INIT_METHOD_CALL                                         $23, 'format'
         41        SEND_VAL_EX                                              'His'
         42        DO_FCALL                                      0  $25     
         43        ASSIGN                                                   !3, $25
   37    44        IS_SMALLER                                       ~27     !3, !1
         45      > JMPNZ_EX                                         ~27     ~27, ->48
         46    >   IS_SMALLER                                       ~28     !2, !3
         47        BOOL                                             ~27     ~28
         48    > > JMPZ                                                     ~27, ->51
   38    49    >   ECHO                                                     'FALSE'
         50      > JMP                                                      ->52
   40    51    >   ECHO                                                     'TRUE'
   41    52    > > RETURN                                                   1

Class Anagrafica:
Function getcontactablefrom:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lvak3
function name:  getContactableFrom
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                      ~0      'contactableFrom'
          1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function getcontactablefrom

Function setcontactablefrom:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lvak3
function name:  setContactableFrom
number of ops:  4
compiled vars:  !0 = $contactableFrom
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        ASSIGN_OBJ                                               'contactableFrom'
          2        OP_DATA                                                  !0
   15     3      > RETURN                                                   null

End of function setcontactablefrom

Function getcontactableto:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lvak3
function name:  getContactableTo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_OBJ_R                                      ~0      'contactableTo'
          1      > RETURN                                                   ~0
   20     2*     > RETURN                                                   null

End of function getcontactableto

Function setcontactableto:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lvak3
function name:  setContactableTo
number of ops:  4
compiled vars:  !0 = $contactableTo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   24     1        ASSIGN_OBJ                                               'contactableTo'
          2        OP_DATA                                                  !0
   25     3      > RETURN                                                   null

End of function setcontactableto

End of class Anagrafica.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.56 ms | 1403 KiB | 13 Q