3v4l.org

run code in 500+ PHP versions simultaneously
<?php class FizzBuzz { const THREE = __LINE__; const FOUR = __LINE__; const FIVE = __LINE__; const FIFTEEN = __LINE__; public function main() { for($i = (int) true;$i <= self::FIFTEEN;$i++) { ob_start(); $this->f($i); $this->b($i); if (ob_get_contents() == false) { echo $i; } echo PHP_EOL; } } private function f($i) { if ($i % self::THREE == false) { echo substr(__CLASS__, false, self::FOUR); } } private function b($i) { if ($i % self::FIVE == false) { echo substr(__CLASS__, self::FOUR, self::FOUR); } } } (new FizzBuzz())->main();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/djZu7
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   42     0  E >   NEW                                                  $0      'FizzBuzz'
          1        DO_FCALL                                          0          
          2        INIT_METHOD_CALL                                             $0, 'main'
          3        DO_FCALL                                          0          
          4      > RETURN                                                       1

Class FizzBuzz:
Function main:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 3
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 3
Branch analysis from position: 20
Branch analysis from position: 3
Branch analysis from position: 16
filename:       /in/djZu7
function name:  main
number of ops:  21
compiled vars:  !0 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   CAST                                              4  ~1      <true>
          1        ASSIGN                                                       !0, ~1
          2      > JMP                                                          ->18
   19     3    >   INIT_FCALL                                                   'ob_start'
          4        DO_ICALL                                                     
   20     5        INIT_METHOD_CALL                                             'f'
          6        SEND_VAR_EX                                                  !0
          7        DO_FCALL                                          0          
   21     8        INIT_METHOD_CALL                                             'b'
          9        SEND_VAR_EX                                                  !0
         10        DO_FCALL                                          0          
   22    11        INIT_FCALL                                                   'ob_get_contents'
         12        DO_ICALL                                             $6      
         13        IS_EQUAL                                                     $6, <false>
         14      > JMPZ                                                         ~7, ->16
   23    15    >   ECHO                                                         !0
   25    16    >   ECHO                                                         '%0A'
   18    17        PRE_INC                                                      !0
         18    >   IS_SMALLER_OR_EQUAL                                          !0, 15
         19      > JMPNZ                                                        ~9, ->3
   27    20    > > RETURN                                                       null

End of function main

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/djZu7
function name:  f
number of ops:  8
compiled vars:  !0 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   29     0  E >   RECV                                                 !0      
   30     1        MOD                                                  ~1      !0, 3
          2        IS_EQUAL                                                     ~1, <false>
          3      > JMPZ                                                         ~2, ->7
   31     4    >   FRAMELESS_ICALL_3                substr              ~3      'FizzBuzz', <false>
          5        OP_DATA                                                      4
          6        ECHO                                                         ~3
   33     7    > > RETURN                                                       null

End of function f

Function b:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/djZu7
function name:  b
number of ops:  8
compiled vars:  !0 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   35     0  E >   RECV                                                 !0      
   36     1        MOD                                                  ~1      !0, 5
          2        IS_EQUAL                                                     ~1, <false>
          3      > JMPZ                                                         ~2, ->7
   37     4    >   FRAMELESS_ICALL_3                substr              ~3      'FizzBuzz', 4
          5        OP_DATA                                                      4
          6        ECHO                                                         ~3
   39     7    > > RETURN                                                       null

End of function b

End of class FizzBuzz.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.26 ms | 1866 KiB | 15 Q