3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Baz { protected $xyz; public function __construct(Foo $foo) { if (empty($foo->get())) { echo 'OK'; } } } class Foo { protected $abc; public function get() { return $this->abc; } } $b = new Baz(new Foo());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uuK0G
function name:  (null)
number of ops:  7
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'Baz'
          1        NEW                                              $2      'Foo'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $2
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
          6      > RETURN                                                   1

Class Baz:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/uuK0G
function name:  __construct
number of ops:  7
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_METHOD_CALL                                         !0, 'get'
          2        DO_FCALL                                      0  $1      
          3        BOOL_NOT                                         ~2      $1
          4      > JMPZ                                                     ~2, ->6
    8     5    >   ECHO                                                     'OK'
   10     6    > > RETURN                                                   null

End of function __construct

End of class Baz.

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

End of function get

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.39 ms | 1394 KiB | 13 Q