3v4l.org

run code in 300+ PHP versions simultaneously
<?php class bla { static function bar(){ static $flag = 1; $flag++; if ($flag == 2 ) { echo 'string name blee',"\n"; return 'blee'; } if ($flag == 3){ echo 'new object blee',"\n"; return new blee; } } } class blee { static $baz = "Oh, baz!\n"; } /**********************************/ $foo = "bla"; echo $foo::bar()::$baz; $foo = new bla; echo $foo::bar()::$baz;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n895P
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   ASSIGN                                                   !0, 'bla'
   24     1        FETCH_CLASS                                   0  $2      !0
          2        INIT_STATIC_METHOD_CALL                                  $2, 'bar'
          3        DO_FCALL                                      0  $3      
          4        FETCH_CLASS                                   0  $4      $3
          5        FETCH_STATIC_PROP_R          unknown             ~5      'baz'
          6        ECHO                                                     ~5
   26     7        NEW                                              $6      'bla'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !0, $6
   27    10        FETCH_CLASS                                   0  $9      !0
         11        INIT_STATIC_METHOD_CALL                                  $9, 'bar'
         12        DO_FCALL                                      0  $10     
         13        FETCH_CLASS                                   0  $11     $10
         14        FETCH_STATIC_PROP_R          unknown             ~12     'baz'
         15        ECHO                                                     ~12
         16      > RETURN                                                   1

Class bla:
Function bar:
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
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n895P
function name:  bar
number of ops:  15
compiled vars:  !0 = $flag
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                              !0
    7     1        PRE_INC                                                  !0
    8     2        IS_EQUAL                                                 !0, 2
          3      > JMPZ                                                     ~2, ->7
    9     4    >   ECHO                                                     'string+name+blee'
          5        ECHO                                                     '%0A'
   10     6      > RETURN                                                   'blee'
   12     7    >   IS_EQUAL                                                 !0, 3
          8      > JMPZ                                                     ~3, ->14
   13     9    >   ECHO                                                     'new+object+blee'
         10        ECHO                                                     '%0A'
   14    11        NEW                                              $4      'blee'
         12        DO_FCALL                                      0          
         13      > RETURN                                                   $4
   16    14    > > RETURN                                                   null

End of function bar

End of class bla.

Class blee: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.06 ms | 1395 KiB | 13 Q