3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $a = 'b'; public function bar() { $fnc = function () { var_dump(isset($this)); var_dump(isset($this->a)); echo $this->a; }; $fnc = $fnc->bindTo(NULL); $fnc(); } } $foo = new Foo(); $foo->bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OooHB
function name:  (null)
number of ops:  6
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'bar'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FOooHB%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OooHB
function name:  {closure}
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'var_dump'
          1        ISSET_ISEMPTY_THIS                               ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   10     4        INIT_FCALL                                               'var_dump'
          5        FETCH_THIS                                       $2      
          6        ISSET_ISEMPTY_PROP_OBJ                           ~3      $2, 'a'
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                                 
   11     9        FETCH_THIS                                       $5      
         10        FETCH_OBJ_R                                      ~6      $5, 'a'
         11        ECHO                                                     ~6
   12    12      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FOooHB%3A8%240

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OooHB
function name:  bar
number of ops:  9
compiled vars:  !0 = $fnc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FOooHB%3A8%240'
          1        ASSIGN                                                   !0, ~1
   14     2        INIT_METHOD_CALL                                         !0, 'bindTo'
          3        SEND_VAL_EX                                              null
          4        DO_FCALL                                      0  $3      
          5        ASSIGN                                                   !0, $3
   15     6        INIT_DYNAMIC_CALL                                        !0
          7        DO_FCALL                                      0          
   16     8      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.77 ms | 1388 KiB | 15 Q