3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class AnonymousClassImporter { static public function __set_state($data){ return new class($data){ public function __construct($data){ foreach($data as $key => $value){ $this->{$key} = $value; } } }; } } spl_autoload_register(function($name){ if(str_starts_with($name, "class@anonymous\0")){ class_alias('AnonymousClassImporter', $name); } }, prepend: true); $imported = ('class@anonymous' . "\0" . '/in/RXBTu:3$0')::__set_state(array( 'x' => 12, )); var_dump($imported);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2HgDQ
function name:  (null)
number of ops:  14
compiled vars:  !0 = $imported
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'spl_autoload_register'
          1        DECLARE_LAMBDA_FUNCTION                          ~1      [0]
   19     2        SEND_VAL                                                 ~1
          3        SEND_VAL                                                 <true>
          4        CHECK_UNDEF_ARGS                                         
   15     5        DO_ICALL                                                 
   21     6        INIT_STATIC_METHOD_CALL                                  'class%40anonymous%00%2Fin%2FRXBTu%3A3%240', '__set_state'
   22     7        SEND_VAL_EX                                              <array>
   21     8        DO_FCALL                                      0  $3      
          9        ASSIGN                                                   !0, $3
   25    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
         13      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/2HgDQ
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        INIT_FCALL                                               'str_starts_with'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'class%40anonymous%00'
          4        DO_ICALL                                         $1      
          5      > JMPZ                                                     $1, ->10
   17     6    >   INIT_FCALL                                               'class_alias'
          7        SEND_VAL                                                 'AnonymousClassImporter'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   19    10    > > RETURN                                                   null

End of Dynamic Function 0

Class class@anonymous:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/2HgDQ
function name:  __construct
number of ops:  9
compiled vars:  !0 = $data, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1      > FE_RESET_R                                       $3      !0, ->7
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->7
          3    >   ASSIGN                                                   !2, ~4
    8     4        ASSIGN_OBJ                                               !2
          5        OP_DATA                                                  !1
    7     6      > JMP                                                      ->2
          7    >   FE_FREE                                                  $3
   10     8      > RETURN                                                   null

End of function __construct

End of class class@anonymous.

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

End of function __set_state

End of class AnonymousClassImporter.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
244.9 ms | 1018 KiB | 17 Q