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 BasicFoo implements Foo { protected $abc = array(); public function get() { return $this->abc; } } $b = new Baz(new BasicFoo());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cnRkT
function name:  (null)
number of ops:  8
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                            'basicfoo'
   21     1        NEW                                              $1      'Baz'
          2        NEW                                              $2      'BasicFoo'
          3        DO_FCALL                                      0          
          4        SEND_VAR_NO_REF_EX                                       $2
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $1
          7      > RETURN                                                   1

Class Baz:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/cnRkT
function name:  __construct
number of ops:  8
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        BOOL_NOT                                         ~3      ~2
          5      > JMPZ                                                     ~3, ->7
    8     6    >   ECHO                                                     'OK'
   10     7    > > RETURN                                                   null

End of function __construct

End of class Baz.

Class BasicFoo:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cnRkT
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 BasicFoo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.25 ms | 1394 KiB | 13 Q