3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { private $a; public function __construct($a) { $this->a = (bool) $a; } public function a() { return $this->a; } } function foo(callable $x) { $object = new Bar(false); $x($object); return $object->a(); } var_dump(foo('Bar::__construct'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kPpaY
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'foo'
          2        SEND_VAL                                                 'Bar%3A%3A__construct'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kPpaY
function name:  foo
number of ops:  12
compiled vars:  !0 = $x, !1 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   20     1        NEW                                              $2      'Bar'
          2        SEND_VAL_EX                                              <false>
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $2
   21     5        INIT_DYNAMIC_CALL                                        !0
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0          
   22     8        INIT_METHOD_CALL                                         !1, 'a'
          9        DO_FCALL                                      0  $6      
         10      > RETURN                                                   $6
   23    11*     > RETURN                                                   null

End of function foo

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kPpaY
function name:  __construct
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        BOOL                                             ~2      !0
          2        ASSIGN_OBJ                                               'a'
          3        OP_DATA                                                  ~2
   10     4      > RETURN                                                   null

End of function __construct

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

End of function a

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.73 ms | 1013 KiB | 15 Q