3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { function m() { if(empty($this)) { echo "Static"; } else { echo "Not static"; } } } $a = new foo(); $a->m(); foo::m();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1QrY7
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        INIT_METHOD_CALL                                         !0, 'm'
          4        DO_FCALL                                      0          
   15     5        INIT_STATIC_METHOD_CALL                                  'foo', 'm'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class foo:
Function m:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1QrY7
function name:  m
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ISSET_ISEMPTY_THIS                               ~0      
          1      > JMPZ                                                     ~0, ->4
    6     2    >   ECHO                                                     'Static'
    5     3      > JMP                                                      ->5
    8     4    >   ECHO                                                     'Not+static'
   10     5    > > RETURN                                                   null

End of function m

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.54 ms | 994 KiB | 13 Q