3v4l.org

run code in 300+ PHP versions simultaneously
<?php class W { const X = [1 => 2, 3 => 4]; public function f() { $a = 1; if (isset(static::X[$a])) { print "$a exists\n"; } else { print "$a doesn't exists\n"; } } } $x = new W; $x->f();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZV04G
function name:  (null)
number of ops:  6
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'W'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_METHOD_CALL                                         !0, 'f'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class W:
Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZV04G
function name:  f
number of ops:  12
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 1
    8     1        FETCH_CLASS_CONSTANT                             ~2      'X'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~2, !0
          3      > JMPZ                                                     ~3, ->8
    9     4    >   NOP                                                      
          5        FAST_CONCAT                                      ~4      !0, '+exists%0A'
          6        ECHO                                                     ~4
          7      > JMP                                                      ->11
   11     8    >   NOP                                                      
          9        FAST_CONCAT                                      ~5      !0, '+doesn%27t+exists%0A'
         10        ECHO                                                     ~5
   13    11    > > RETURN                                                   null

End of function f

End of class W.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.81 ms | 1393 KiB | 13 Q