3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public $prop1 = "I'm a class property!"; public function get() { $a = $this->prop1; $f = function ($ref) { return $ref->prop1; }; return $f($this); } } $obj = new MyClass; echo $obj->get();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7WOc5
function name:  (null)
number of ops:  7
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'MyClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        INIT_METHOD_CALL                                         !0, 'get'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F7WOc5%3A12%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7WOc5
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        FETCH_OBJ_R                                      ~1      !0, 'prop1'
          2      > RETURN                                                   ~1
   14     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F7WOc5%3A12%240

Class MyClass:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7WOc5
function name:  get
number of ops:  10
compiled vars:  !0 = $a, !1 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_OBJ_R                                      ~2      'prop1'
          1        ASSIGN                                                   !0, ~2
   12     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F7WOc5%3A12%240'
          3        ASSIGN                                                   !1, ~4
   16     4        INIT_DYNAMIC_CALL                                        !1
          5        FETCH_THIS                                       $6      
          6        SEND_VAR_EX                                              $6
          7        DO_FCALL                                      0  $7      
          8      > RETURN                                                   $7
   17     9*     > RETURN                                                   null

End of function get

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.84 ms | 1394 KiB | 13 Q