3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function test() { echo $undef; } public function test2() { $x = $this; // use $this echo $undef; } } set_error_handler(function($_1, $_2, $_3, $_4, $ctx) { var_dump(isset($ctx['this'])); }); (new Foo)->test(); (new Foo)->test2();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sQBL9
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'set_error_handler'
          1        DECLARE_LAMBDA_FUNCTION                          ~0      [0]
   15     2        SEND_VAL                                                 ~0
   13     3        DO_ICALL                                                 
   16     4        NEW                                              $2      'Foo'
          5        DO_FCALL                                      0          
          6        INIT_METHOD_CALL                                         $2, 'test'
          7        DO_FCALL                                      0          
   17     8        NEW                                              $5      'Foo'
          9        DO_FCALL                                      0          
         10        INIT_METHOD_CALL                                         $5, 'test2'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sQBL9
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $_1, !1 = $_2, !2 = $_3, !3 = $_4, !4 = $ctx
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
   14     5        INIT_FCALL                                               'var_dump'
          6        ISSET_ISEMPTY_DIM_OBJ                         0  ~5      !4, 'this'
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                                 
   15     9      > RETURN                                                   null

End of Dynamic Function 0

Class Foo:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sQBL9
function name:  test
number of ops:  2
compiled vars:  !0 = $undef
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     !0
    6     1      > RETURN                                                   null

End of function test

Function test2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sQBL9
function name:  test2
number of ops:  4
compiled vars:  !0 = $x, !1 = $undef
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_THIS                                       ~2      
          1        ASSIGN                                                   !0, ~2
    9     2        ECHO                                                     !1
   10     3      > RETURN                                                   null

End of function test2

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.49 ms | 1000 KiB | 15 Q