3v4l.org

run code in 300+ PHP versions simultaneously
<?php class bla { static function bar(){ static $flag = 1; $flag++; if ($flag == 2 ) { return 'blee'; } if ($flag == 3){ return new blee; } } } class blee { static $baz = "\nOh, baz!"; } /**********************************/ $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/OtR32
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ASSIGN                                                   !0, 'bla'
   22     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
   24     7        NEW                                              $6      'bla'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !0, $6
   25    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 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OtR32
function name:  bar
number of ops:  11
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, ->5
    9     4    > > RETURN                                                   'blee'
   11     5    >   IS_EQUAL                                                 !0, 3
          6      > JMPZ                                                     ~3, ->10
   12     7    >   NEW                                              $4      'blee'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   $4
   14    10    > > 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:
189.41 ms | 1395 KiB | 13 Q