3v4l.org

run code in 300+ PHP versions simultaneously
<?php $calc = new Calc; $calc->execute(); class Calc { private $AkaraB; private $BkaraA; private $AkaraBnoZikan; private $BkaraAnoZikan; private $Abin; private $Bbin; private $ohuku; public function __construct() { // fscanf(STDIN, "%d %d", $AkaraB, $BkaraA); // fscanf(STDIN, "%d %d", $AkaraBnoZikan, $BkaraAnoZikan); // fscanf(STDIN, "%s", $AbinString); // fscanf(STDIN, "%s", $BbinString); $AkaraB=3; $BkaraA=4; $AkaraBnoZikan=2; $BkaraAnoZikan=3; $AbinString='1 5 7'; $BbinString='3 8 12 13'; $this->AkaraB = $AkaraB; $this->BkaraA = $BkaraA; $this->AkaraBnoZikan = $AkaraBnoZikan; $this->BkaraAnoZikan = $BkaraAnoZikan; $this->Abin = explode(' ', $AbinString); $this->Bbin = explode(' ', $BbinString); $this->ohuku = 0; } public function execute() { $now = 0; while(true) { $end = true; foreach ($this->Abin as $key => $value) { if($now <= $value){ $now = $value; $this->Abin = array_slice($this->Abin,$key+=1); $end =false; break; } } if ($end) break; $now += $this->AkaraBnoZikan; if ($now > 24) break; $nownow = $now; $end = true; foreach ($this->Bbin as $key => $value) { if($now <= $value) { $now = $value; $this->Bbin = array_slice($this->Bbin, $key+=1); $end =false; break; } } if ($end) break; $now += $this->BkaraAnoZikan; if ($now > 24) break; $this->ohuku++; } echo $this->ohuku . "\n"; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8dsbX
function name:  (null)
number of ops:  6
compiled vars:  !0 = $calc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $1      'Calc'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    5     3        INIT_METHOD_CALL                                         !0, 'execute'
          4        DO_FCALL                                      0          
   72     5      > RETURN                                                   1

Class Calc:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8dsbX
function name:  __construct
number of ops:  29
compiled vars:  !0 = $AkaraB, !1 = $BkaraA, !2 = $AkaraBnoZikan, !3 = $BkaraAnoZikan, !4 = $AbinString, !5 = $BbinString
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ASSIGN                                                   !0, 3
   22     1        ASSIGN                                                   !1, 4
   23     2        ASSIGN                                                   !2, 2
   24     3        ASSIGN                                                   !3, 3
   25     4        ASSIGN                                                   !4, '1+5+7'
   26     5        ASSIGN                                                   !5, '3+8+12+13'
   27     6        ASSIGN_OBJ                                               'AkaraB'
          7        OP_DATA                                                  !0
   28     8        ASSIGN_OBJ                                               'BkaraA'
          9        OP_DATA                                                  !1
   29    10        ASSIGN_OBJ                                               'AkaraBnoZikan'
         11        OP_DATA                                                  !2
   30    12        ASSIGN_OBJ                                               'BkaraAnoZikan'
         13        OP_DATA                                                  !3
   31    14        INIT_FCALL                                               'explode'
         15        SEND_VAL                                                 '+'
         16        SEND_VAR                                                 !4
         17        DO_ICALL                                         $17     
         18        ASSIGN_OBJ                                               'Abin'
         19        OP_DATA                                                  $17
   32    20        INIT_FCALL                                               'explode'
         21        SEND_VAL                                                 '+'
         22        SEND_VAR                                                 !5
         23        DO_ICALL                                         $19     
         24        ASSIGN_OBJ                                               'Bbin'
         25        OP_DATA                                                  $19
   33    26        ASSIGN_OBJ                                               'ohuku'
         27        OP_DATA                                                  0
   35    28      > RETURN                                                   null

End of function __construct

Function execute:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 2
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 21
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 21
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 24
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 29
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 29
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 49
Branch analysis from position: 33
2 jumps found. (Code = 78) Position 1 = 34, Position 2 = 49
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 48
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 52
Branch analysis from position: 51
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 57
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 2
Branch analysis from position: 59
Branch analysis from position: 2
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 49
Branch analysis from position: 49
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 21
Branch analysis from position: 21
filename:       /in/8dsbX
function name:  execute
number of ops:  63
compiled vars:  !0 = $now, !1 = $end, !2 = $value, !3 = $key, !4 = $nownow
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   ASSIGN                                                   !0, 0
   40     1      > JMP                                                      ->58
   41     2    >   ASSIGN                                                   !1, <true>
   42     3        FETCH_OBJ_R                                      ~7      'Abin'
          4      > FE_RESET_R                                       $8      ~7, ->21
          5    > > FE_FETCH_R                                       ~9      $8, !2, ->21
          6    >   ASSIGN                                                   !3, ~9
   43     7        IS_SMALLER_OR_EQUAL                                      !0, !2
          8      > JMPZ                                                     ~11, ->20
   44     9    >   ASSIGN                                                   !0, !2
   45    10        INIT_FCALL                                               'array_slice'
         11        FETCH_OBJ_R                                      ~14     'Abin'
         12        SEND_VAL                                                 ~14
         13        ASSIGN_OP                                     1  ~15     !3, 1
         14        SEND_VAL                                                 ~15
         15        DO_ICALL                                         $16     
         16        ASSIGN_OBJ                                               'Abin'
         17        OP_DATA                                                  $16
   46    18        ASSIGN                                                   !1, <false>
   47    19      > JMP                                                      ->21
   42    20    > > JMP                                                      ->5
         21    >   FE_FREE                                                  $8
   50    22      > JMPZ                                                     !1, ->24
         23    > > JMP                                                      ->59
   52    24    >   FETCH_OBJ_R                                      ~18     'AkaraBnoZikan'
         25        ASSIGN_OP                                     1          !0, ~18
   53    26        IS_SMALLER                                               24, !0
         27      > JMPZ                                                     ~20, ->29
         28    > > JMP                                                      ->59
   54    29    >   ASSIGN                                                   !4, !0
   55    30        ASSIGN                                                   !1, <true>
   56    31        FETCH_OBJ_R                                      ~23     'Bbin'
         32      > FE_RESET_R                                       $24     ~23, ->49
         33    > > FE_FETCH_R                                       ~25     $24, !2, ->49
         34    >   ASSIGN                                                   !3, ~25
   57    35        IS_SMALLER_OR_EQUAL                                      !0, !2
         36      > JMPZ                                                     ~27, ->48
   58    37    >   ASSIGN                                                   !0, !2
   59    38        INIT_FCALL                                               'array_slice'
         39        FETCH_OBJ_R                                      ~30     'Bbin'
         40        SEND_VAL                                                 ~30
         41        ASSIGN_OP                                     1  ~31     !3, 1
         42        SEND_VAL                                                 ~31
         43        DO_ICALL                                         $32     
         44        ASSIGN_OBJ                                               'Bbin'
         45        OP_DATA                                                  $32
   60    46        ASSIGN                                                   !1, <false>
   61    47      > JMP                                                      ->49
   56    48    > > JMP                                                      ->33
         49    >   FE_FREE                                                  $24
   64    50      > JMPZ                                                     !1, ->52
         51    > > JMP                                                      ->59
   65    52    >   FETCH_OBJ_R                                      ~34     'BkaraAnoZikan'
         53        ASSIGN_OP                                     1          !0, ~34
   66    54        IS_SMALLER                                               24, !0
         55      > JMPZ                                                     ~36, ->57
         56    > > JMP                                                      ->59
   67    57    >   PRE_INC_OBJ                                              'ohuku'
   40    58    > > JMPNZ                                                    <true>, ->2
   70    59    >   FETCH_OBJ_R                                      ~38     'ohuku'
         60        CONCAT                                           ~39     ~38, '%0A'
         61        ECHO                                                     ~39
   71    62      > RETURN                                                   null

End of function execute

End of class Calc.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.15 ms | 1404 KiB | 17 Q