3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { private $foo = 0; public function foo() { return $this->foo; } public function __construct($context) { $this->foo = 1; } public function comp() { return $this->foo() === static::foo(); } } $bar = new Bar; var_dump($bar->comp());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RWKgR
function name:  (null)
number of ops:  9
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'Bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'comp'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

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

End of function foo

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RWKgR
function name:  __construct
number of ops:  4
compiled vars:  !0 = $context
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        ASSIGN_OBJ                                               'foo'
          2        OP_DATA                                                  1
   15     3      > RETURN                                                   null

End of function __construct

Function comp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RWKgR
function name:  comp
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_METHOD_CALL                                         'foo'
          1        DO_FCALL                                      0  $0      
          2        INIT_STATIC_METHOD_CALL                                  'foo'
          3        DO_FCALL                                      0  $1      
          4        IS_IDENTICAL                                     ~2      $0, $1
          5      > RETURN                                                   ~2
   20     6*     > RETURN                                                   null

End of function comp

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.71 ms | 1396 KiB | 15 Q