3v4l.org

run code in 300+ 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        BOOL_NOT                                         ~7      $6
         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 = 10
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/djZu7
function name:  f
number of ops:  11
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        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->10
   31     4    >   INIT_FCALL                                               'substr'
          5        SEND_VAL                                                 'FizzBuzz'
          6        SEND_VAL                                                 <false>
          7        SEND_VAL                                                 4
          8        DO_ICALL                                         $3      
          9        ECHO                                                     $3
   33    10    > > 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 = 10
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/djZu7
function name:  b
number of ops:  11
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        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->10
   37     4    >   INIT_FCALL                                               'substr'
          5        SEND_VAL                                                 'FizzBuzz'
          6        SEND_VAL                                                 4
          7        SEND_VAL                                                 4
          8        DO_ICALL                                         $3      
          9        ECHO                                                     $3
   39    10    > > RETURN                                                   null

End of function b

End of class FizzBuzz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
125.45 ms | 1405 KiB | 19 Q