3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar() { return 'bar'; } } $services = []; function foo() { global $services; return $services['foo'] = new Foo(); } // $services['foo'] = new Foo(); echo ${($_ = isset($services['foo']) ? $services['foo'] : foo()) && false ?: '_'}->bar();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
Branch analysis from position: 12
filename:       /in/YXXQm
function name:  (null)
number of ops:  19
compiled vars:  !0 = $services, !1 = $_
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, <array>
   17     1        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'foo'
          2      > JMPZ                                                     ~3, ->6
          3    >   FETCH_DIM_R                                      ~4      !0, 'foo'
          4        QM_ASSIGN                                        ~5      ~4
          5      > JMP                                                      ->9
          6    >   INIT_FCALL                                               'foo'
          7        DO_FCALL                                      0  $6      
          8        QM_ASSIGN                                        ~5      $6
          9    >   ASSIGN                                           ~7      !1, ~5
         10      > JMPZ_EX                                          ~7      ~7, ->12
         11    >   BOOL                                             ~7      <false>
         12    >   JMP_SET                                          ~8      ~7, ->14
         13        QM_ASSIGN                                        ~8      '_'
         14        FETCH_R                      local               ~9      ~8
         15        INIT_METHOD_CALL                                         ~9, 'bar'
         16        DO_FCALL                                      0  $10     
         17        ECHO                                                     $10
         18      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YXXQm
function name:  foo
number of ops:  7
compiled vars:  !0 = $services
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   BIND_GLOBAL                                              !0, 'services'
          1        NEW                                              $2      'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN_DIM                                       ~1      !0, 'foo'
          4        OP_DATA                                                  $2
          5      > RETURN                                                   ~1
          6*     > RETURN                                                   null

End of function foo

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YXXQm
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   'bar'
    7     1*     > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.5 ms | 1012 KiB | 14 Q