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')); $anagrafica->setContactableTo(\DateTime::createFromFormat('H:i:s', '15: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 = 22, Position 2 = 29
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 43
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 47) Position 1 = 53, Position 2 = 55
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 58
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 58
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
Branch analysis from position: 43
2 jumps found. (Code = 47) Position 1 = 53, Position 2 = 55
Branch analysis from position: 53
Branch analysis from position: 55
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 43
Branch analysis from position: 36
Branch analysis from position: 43
filename:       /in/XSDkL
function name:  (null)
number of ops:  60
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          
   30    10        INIT_METHOD_CALL                                         !0, 'setContactableTo'
         11        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
         12        SEND_VAL                                                 'H%3Ai%3As'
         13        SEND_VAL                                                 '15%3A00%3A00'
         14        DO_FCALL                                      0  $9      
         15        SEND_VAR_NO_REF_EX                                       $9
         16        DO_FCALL                                      0          
   32    17        INIT_METHOD_CALL                                         !0, 'getContactableFrom'
         18        DO_FCALL                                      0  $11     
         19        ASSIGN                                                   !1, $11
   33    20        INSTANCEOF                                               !1, 'DateTime'
         21      > JMPZ                                                     ~13, ->29
         22    >   INIT_METHOD_CALL                                         !0, 'getContactableFrom'
         23        DO_FCALL                                      0  $14     
         24        INIT_METHOD_CALL                                         $14, 'format'
         25        SEND_VAL_EX                                              'His'
         26        DO_FCALL                                      0  $15     
         27        QM_ASSIGN                                        ~16     $15
         28      > JMP                                                      ->30
         29    >   QM_ASSIGN                                        ~16     '080000'
         30    >   ASSIGN                                                   !1, ~16
   34    31        INIT_METHOD_CALL                                         !0, 'getContactableTo'
         32        DO_FCALL                                      0  $18     
         33        ASSIGN                                                   !2, $18
   35    34        INSTANCEOF                                               !2, 'DateTime'
         35      > JMPZ                                                     ~20, ->43
         36    >   INIT_METHOD_CALL                                         !0, 'getContactableTo'
         37        DO_FCALL                                      0  $21     
         38        INIT_METHOD_CALL                                         $21, 'format'
         39        SEND_VAL_EX                                              'His'
         40        DO_FCALL                                      0  $22     
         41        QM_ASSIGN                                        ~23     $22
         42      > JMP                                                      ->44
         43    >   QM_ASSIGN                                        ~23     '220000'
         44    >   ASSIGN                                                   !2, ~23
   36    45        NEW                                              $25     'DateTime'
         46        DO_FCALL                                      0          
         47        INIT_METHOD_CALL                                         $25, 'format'
         48        SEND_VAL_EX                                              'His'
         49        DO_FCALL                                      0  $27     
         50        ASSIGN                                                   !3, $27
   38    51        IS_SMALLER                                       ~29     !3, !1
         52      > JMPNZ_EX                                         ~29     ~29, ->55
         53    >   IS_SMALLER                                       ~30     !2, !3
         54        BOOL                                             ~29     ~30
         55    > > JMPZ                                                     ~29, ->58
   39    56    >   ECHO                                                     'FALSE'
         57      > JMP                                                      ->59
   41    58    >   ECHO                                                     'TRUE'
   42    59    > > RETURN                                                   1

Class Anagrafica:
Function getcontactablefrom:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XSDkL
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/XSDkL
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/XSDkL
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/XSDkL
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:
164.29 ms | 1403 KiB | 13 Q