3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function test(){return function(){ echo 'coin';};} }; $part = 'Test'; $vare = 'part'; $i = new $$vare(); $func = $i->test(); $func();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d6MdA
function name:  (null)
number of ops:  13
compiled vars:  !0 = $part, !1 = $vare, !2 = $i, !3 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 'Test'
    6     1        ASSIGN                                                   !1, 'part'
    7     2        FETCH_R                      local               ~6      !1
          3        FETCH_CLASS                                   0  $7      ~6
          4        NEW                                              $8      $7
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !2, $8
    8     7        INIT_METHOD_CALL                                         !2, 'test'
          8        DO_FCALL                                      0  $11     
          9        ASSIGN                                                   !3, $11
    9    10        INIT_DYNAMIC_CALL                                        !3
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fd6MdA%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d6MdA
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'coin'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fd6MdA%3A3%240

Class Test:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d6MdA
function name:  test
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fd6MdA%3A3%240'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function test

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.46 ms | 1394 KiB | 13 Q