3v4l.org

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

Class foo:
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/gmpMS
function name:  bar
number of ops:  11
compiled vars:  !0 = $flag
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    8     1        PRE_INC                                                  !0
    9     2        IS_EQUAL                                                 !0, 2
          3      > JMPZ                                                     ~2, ->5
   10     4    > > RETURN                                                   'blee'
   12     5    >   IS_EQUAL                                                 !0, 3
          6      > JMPZ                                                     ~3, ->10
   13     7    >   NEW                                              $4      'blee'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   $4
   15    10    > > RETURN                                                   null

End of function bar

End of class foo.

Class blee:
Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gmpMS
function name:  baz
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ECHO                                                     'Oh%2C+for+the+baz+of+it%21%0A'
   21     1      > RETURN                                                   null

End of function baz

End of class blee.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
188.18 ms | 1399 KiB | 13 Q