3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait T{ public function test() { if (defined(self::class . "::X")) { echo self::X; } } } class A { private const X = "xxx"; use T; } $a = new A(); $a->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NQ1f8
function name:  (null)
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_CLASS                                            'a'
   14     1        NEW                                              $1      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   15     4        INIT_METHOD_CALL                                         !0, 'test'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class T:
Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/NQ1f8
function name:  test
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'defined'
          1        FETCH_CLASS_NAME                                 ~0      
          2        CONCAT                                           ~1      ~0, '%3A%3AX'
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > JMPZ                                                     $2, ->8
    5     6    >   FETCH_CLASS_CONSTANT                             ~3      'X'
          7        ECHO                                                     ~3
    7     8    > > RETURN                                                   null

End of function test

End of class T.

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.5 ms | 999 KiB | 14 Q