3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace DrummondCentral\Bender\Command; class Command {} namespace Commands; use DrummondCentral\Bender\Command\Command; class HometimeCommand extends Command { public static function getCommand() { return 'hometime'; } public static function getDescription() { return 'Displays the number of hours and minutes until home time.'; } public function handle($message) { date_default_timezone_set('Europe/London'); $workend = strtotime('17:30'); $diff = $workend - time(); $hometime = gmdate("H:i:s", $diff); if (time() === $workend) { return 'It\'s home time! Rejoice!'; } return "Home time is in " . $hometime . "."; } } $command = new HometimeCommand(); var_dump($command->handle(''));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gFMe2
function name:  (null)
number of ops:  10
compiled vars:  !0 = $command
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   NEW                                              $1      'Commands%5CHometimeCommand'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   42     3        INIT_NS_FCALL_BY_NAME                                    'Commands%5Cvar_dump'
          4        INIT_METHOD_CALL                                         !0, 'handle'
          5        SEND_VAL_EX                                              ''
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR_NO_REF_EX                                       $4
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class DrummondCentral\Bender\Command\Command: [no user functions]
Class Commands\HometimeCommand:
Function getcommand:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gFMe2
function name:  getCommand
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E > > RETURN                                                   'hometime'
   16     1*     > RETURN                                                   null

End of function getcommand

Function getdescription:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gFMe2
function name:  getDescription
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E > > RETURN                                                   'Displays+the+number+of+hours+and+minutes+until+home+time.'
   21     1*     > RETURN                                                   null

End of function getdescription

Function handle:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gFMe2
function name:  handle
number of ops:  26
compiled vars:  !0 = $message, !1 = $workend, !2 = $diff, !3 = $hometime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   25     1        INIT_NS_FCALL_BY_NAME                                    'Commands%5Cdate_default_timezone_set'
          2        SEND_VAL_EX                                              'Europe%2FLondon'
          3        DO_FCALL                                      0          
   27     4        INIT_NS_FCALL_BY_NAME                                    'Commands%5Cstrtotime'
          5        SEND_VAL_EX                                              '17%3A30'
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !1, $5
   29     8        INIT_NS_FCALL_BY_NAME                                    'Commands%5Ctime'
          9        DO_FCALL                                      0  $7      
         10        SUB                                              ~8      !1, $7
         11        ASSIGN                                                   !2, ~8
   31    12        INIT_NS_FCALL_BY_NAME                                    'Commands%5Cgmdate'
         13        SEND_VAL_EX                                              'H%3Ai%3As'
         14        SEND_VAR_EX                                              !2
         15        DO_FCALL                                      0  $10     
         16        ASSIGN                                                   !3, $10
   33    17        INIT_NS_FCALL_BY_NAME                                    'Commands%5Ctime'
         18        DO_FCALL                                      0  $12     
         19        IS_IDENTICAL                                             !1, $12
         20      > JMPZ                                                     ~13, ->22
   34    21    > > RETURN                                                   'It%27s+home+time%21+Rejoice%21'
   37    22    >   CONCAT                                           ~14     'Home+time+is+in+', !3
         23        CONCAT                                           ~15     ~14, '.'
         24      > RETURN                                                   ~15
   38    25*     > RETURN                                                   null

End of function handle

End of class Commands\HometimeCommand.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.61 ms | 1400 KiB | 23 Q