3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Weird { private $a = 1; 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/mq638
function name:  (null)
number of ops:  8
compiled vars:  !0 = $w
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_STATIC_METHOD_CALL                                  'Weird', 'test'
          1        DO_FCALL                                      0          
   12     2        NEW                                              $2      'Weird'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   13     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 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mq638
function name:  test
number of ops:  11
compiled vars:  !0 = $static
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_THIS                                       ~1      
          1        GET_CLASS                                        ~2      ~1
          2        BOOL_NOT                                         ~3      ~2
          3        ASSIGN                                                   !0, ~3
    7     4      > JMPZ                                                     !0, ->7
          5    >   QM_ASSIGN                                        ~5      'static'
          6      > JMP                                                      ->8
          7    >   QM_ASSIGN                                        ~5      'instance'
          8    >   CONCAT                                           ~6      ~5, '%0A'
          9        ECHO                                                     ~6
    8    10      > RETURN                                                   null

End of function test

End of class Weird.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.87 ms | 1385 KiB | 13 Q