3v4l.org

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

Class Anagrafica:
Function getcontactablefrom:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bAn4R
function name:  getContactableFrom
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~0      'contactableFrom'
          1      > RETURN                                                   ~0
    9     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/bAn4R
function name:  setContactableFrom
number of ops:  4
compiled vars:  !0 = $cF
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        ASSIGN_OBJ                                               'contactableFrom'
          2        OP_DATA                                                  !0
   13     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/bAn4R
function name:  getContactableTo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   FETCH_OBJ_R                                      ~0      'contactableTo'
          1      > RETURN                                                   ~0
   17     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/bAn4R
function name:  setContactableTo
number of ops:  4
compiled vars:  !0 = $cT
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        ASSIGN_OBJ                                               'contactableTo'
          2        OP_DATA                                                  !0
   21     3      > RETURN                                                   null

End of function setcontactableto

End of class Anagrafica.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.17 ms | 1403 KiB | 13 Q