3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $test = true; const TEST_ME = 'testing'; public $anything = true; private function getTest() { return $this->test; } } $fn = function () { echo self::TEST_ME; 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/eTJEP
function name:  (null)
number of ops:  13
compiled vars:  !0 = $fn, !1 = $a, !2 = $fn2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FeTJEP%3A19%240'
          1        ASSIGN                                                   !0, ~3
   28     2        NEW                                              $5      'A'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $5
   29     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
   30    10        INIT_DYNAMIC_CALL                                        !2
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FeTJEP%3A19%240

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

End of function gettest

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.23 ms | 1395 KiB | 13 Q