3v4l.org

run code in 300+ PHP versions simultaneously
<?php class asdf { const DUPA = array('hehe' => 'asdf'); public function foo() { defined(self::DUPA['asdf']) ? $m = 'tak' : $m = "nie"; echo $m; } } (new asdf)->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7p62q
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $0      'asdf'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'foo'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Class asdf:
Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7p62q
function name:  foo
number of ops:  13
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'defined'
          1        FETCH_DIM_R                                      ~1      <array>, 'asdf'
          2        SEND_VAL                                                 ~1
          3        DO_ICALL                                         $2      
          4      > JMPZ                                                     $2, ->8
          5    >   ASSIGN                                           ~3      !0, 'tak'
          6        QM_ASSIGN                                        ~4      ~3
          7      > JMP                                                      ->10
          8    >   ASSIGN                                           ~5      !0, 'nie'
          9        QM_ASSIGN                                        ~4      ~5
         10    >   FREE                                                     ~4
    9    11        ECHO                                                     !0
   10    12      > RETURN                                                   null

End of function foo

End of class asdf.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.71 ms | 1395 KiB | 15 Q