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 $foo->bar()::baz(); class bla { 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 bla; echo $foo::bar()::$baz();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qug8P
function name:  (null)
number of ops:  16
compiled vars:  !0 = $foo, !1 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_METHOD_CALL                                         !0, 'bar'
          1        DO_FCALL                                      0  $2      
          2        FETCH_CLASS                                   0  $3      $2
          3        INIT_STATIC_METHOD_CALL                                  $3, 'baz'
          4        DO_FCALL                                      0          
   28     5        NEW                                              $5      'bla'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $5
   29     8        FETCH_CLASS                                   0  $8      !0
          9        INIT_STATIC_METHOD_CALL                                  $8, 'bar'
         10        DO_FCALL                                      0  $9      
         11        FETCH_CLASS                                   0  $10     $9
         12        INIT_STATIC_METHOD_CALL                                  $10, !1
         13        DO_FCALL                                      0  $11     
         14        ECHO                                                     $11
         15      > 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/Qug8P
function name:  bar
number of ops:  11
compiled vars:  !0 = $flag
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   BIND_STATIC                                              !0
   12     1        PRE_INC                                                  !0
   13     2        IS_EQUAL                                                 !0, 2
          3      > JMPZ                                                     ~2, ->5
   14     4    > > RETURN                                                   'blee'
   16     5    >   IS_EQUAL                                                 !0, 3
          6      > JMPZ                                                     ~3, ->10
   17     7    >   NEW                                              $4      'blee'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   $4
   19    10    > > RETURN                                                   null

End of function bar

End of class bla.

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

End of function baz

End of class blee.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.11 ms | 1395 KiB | 13 Q