3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Weird { public static function test() { $static = get_class($this); echo ($static ? "static" : "instance") . "\n"; } } Weird::test(); $w = new Weird; $w->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VZQfa
function name:  (null)
number of ops:  8
compiled vars:  !0 = $w
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_STATIC_METHOD_CALL                                  'Weird', 'test'
          1        DO_FCALL                                      0          
   11     2        NEW                                              $2      'Weird'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   12     5        INIT_METHOD_CALL                                         !0, 'test'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class Weird:
Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VZQfa
function name:  test
number of ops:  10
compiled vars:  !0 = $static
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_THIS                                       ~1      
          1        GET_CLASS                                        ~2      ~1
          2        ASSIGN                                                   !0, ~2
    6     3      > JMPZ                                                     !0, ->6
          4    >   QM_ASSIGN                                        ~4      'static'
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~4      'instance'
          7    >   CONCAT                                           ~5      ~4, '%0A'
          8        ECHO                                                     ~5
    7     9      > RETURN                                                   null

End of function test

End of class Weird.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.81 ms | 1394 KiB | 13 Q