3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function getClass() { return function () { //return call_user_func(function () { return [__CLASS__, __METHOD__, __FUNCTION__]; //}); }; } } //return new Foo(); $foo = new Foo();//make(); var_dump(call_user_func(Foo::getClass()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eYRv1
function name:  (null)
number of ops:  11
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        INIT_FCALL                                               'var_dump'
          4        INIT_STATIC_METHOD_CALL                                  'Foo', 'getClass'
          5        DO_FCALL                                      0  $4      
          6        INIT_USER_CALL                                0          'call_user_func', $4
          7        DO_FCALL                                      0  $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FeYRv1%3A6%240

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

End of function getclass

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.98 ms | 1395 KiB | 15 Q