3v4l.org

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

Function make:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UtmjV
function name:  make
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                            'foo'
   16     1        NEW                                              $0      'Foo'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   $0
   17     4*     > RETURN                                                   null

End of function make

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

End of function %00%7Bclosure%7D%2Fin%2FUtmjV%3A8%240

Class Foo:
Function getclass:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UtmjV
function name:  getClass
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FUtmjV%3A8%240'
   12     1        INIT_USER_CALL                                0          'call_user_func', ~0
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
   13     4*     > RETURN                                                   null

End of function getclass

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.98 ms | 1399 KiB | 16 Q