3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Logger { public static function write (Message $message) { return $this->getName(); } } interface Message { public function getName(); } $message = (new class() implements Message { public function getName() { return 'anonyme !'; } }); Logger::write($message);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bs5n0
function name:  (null)
number of ops:  8
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_ANON_CLASS                               <unknown> 
          1        NEW                                              $2      $1
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   17     4        INIT_STATIC_METHOD_CALL                                  'Logger', 'write'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class Logger:
Function write:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bs5n0
function name:  write
number of ops:  6
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        FETCH_THIS                                       $1      
          2        INIT_METHOD_CALL                                         $1, 'getName'
          3        DO_FCALL                                      0  $2      
          4      > RETURN                                                   $2
    8     5*     > RETURN                                                   null

End of function write

End of class Logger.

Class Message:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bs5n0
function name:  getName
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   null

End of function getname

End of class Message.

Class Message@anonymous:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bs5n0
function name:  getName
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E > > RETURN                                                   'anonyme+%21'
          1*     > RETURN                                                   null

End of function getname

End of class Message@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.45 ms | 1395 KiB | 13 Q