3v4l.org

run code in 300+ PHP versions simultaneously
<?php function my_class($x) { return new class() { public function myMeth() { return $x; } }; } $c = my_class(10); var_dump($c->myMeth());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IcjKR
function name:  (null)
number of ops:  10
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'my_class'
          1        SEND_VAL                                                 10
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   12     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'myMeth'
          6        DO_FCALL                                      0  $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function my_class:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IcjKR
function name:  my_class
number of ops:  6
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        DECLARE_ANON_CLASS                               <unknown> 
          2        NEW                                              $2      $1
          3        DO_FCALL                                      0          
          4      > RETURN                                                   $2
    9     5*     > RETURN                                                   null

End of function my_class

Class class@anonymous:
Function mymeth:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IcjKR
function name:  myMeth
number of ops:  2
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   !0
    7     1*     > RETURN                                                   null

End of function mymeth

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.58 ms | 1398 KiB | 16 Q