3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $priv = 1; protected $prot = 2; public $pub = 3; public function test() { $obj = $this; return function () { echo $this->priv; echo $this->prot; echo $this->pub; }; } } $a = new A(); $call = $a->test(); call_user_func($call);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cGOaa
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a, !1 = $call
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   23     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
   26     6        INIT_USER_CALL                                0          'call_user_func', !1
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FcGOaa%3A13%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cGOaa
function name:  {closure}
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'priv'
          2        ECHO                                                     ~1
   15     3        FETCH_THIS                                       $2      
          4        FETCH_OBJ_R                                      ~3      $2, 'prot'
          5        ECHO                                                     ~3
   16     6        FETCH_THIS                                       $4      
          7        FETCH_OBJ_R                                      ~5      $4, 'pub'
          8        ECHO                                                     ~5
   17     9      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FcGOaa%3A13%240

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cGOaa
function name:  test
number of ops:  5
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_THIS                                       ~1      
          1        ASSIGN                                                   !0, ~1
   13     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcGOaa%3A13%240'
   17     3      > RETURN                                                   ~3
   18     4*     > RETURN                                                   null

End of function test

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.01 ms | 1395 KiB | 13 Q