3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $test = true; public $anything = true; private function getTest() { return $this->test; } } $fn = function () { echo $this->test; echo $this->getTest(); echo $this->anything; }; $a = new A(); $fn2 = $fn->bindTo($a, $a); $fn2();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4ZYO1
function name:  (null)
number of ops:  13
compiled vars:  !0 = $fn, !1 = $a, !2 = $fn2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4ZYO1%3A17%240'
          1        ASSIGN                                                   !0, ~3
   26     2        NEW                                              $5      'A'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $5
   27     5        INIT_METHOD_CALL                                         !0, 'bindTo'
          6        SEND_VAR_EX                                              !1
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0  $8      
          9        ASSIGN                                                   !2, $8
   28    10        INIT_DYNAMIC_CALL                                        !2
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F4ZYO1%3A17%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4ZYO1
function name:  {closure}
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'test'
          2        ECHO                                                     ~1
   21     3        FETCH_THIS                                       $2      
          4        INIT_METHOD_CALL                                         $2, 'getTest'
          5        DO_FCALL                                      0  $3      
          6        ECHO                                                     $3
   23     7        FETCH_THIS                                       $4      
          8        FETCH_OBJ_R                                      ~5      $4, 'anything'
          9        ECHO                                                     ~5
   24    10      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F4ZYO1%3A17%240

Class A:
Function gettest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4ZYO1
function name:  getTest
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'test'
          1      > RETURN                                                   ~0
   13     2*     > RETURN                                                   null

End of function gettest

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.69 ms | 1395 KiB | 13 Q