3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface IPrinter { function print(PrintableValue $value): void; } class PrintableValue { public readonly mixed $value; public function __construct(mixed $value) { $this->value = $value; } public function __toString() { return json_encode($this->value); } } class ConsolePrinter implements IPrinter { function print(PrintableValue $value): void { echo $value; } } $printer = new ConsolePrinter; $value = new PrintableValue(['33']); $printer->print($value);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FcbPh
function name:  (null)
number of ops:  13
compiled vars:  !0 = $printer, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'printablevalue'
   19     1        DECLARE_CLASS                                            'consoleprinter'
   25     2        NEW                                              $2      'ConsolePrinter'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   26     5        NEW                                              $5      'PrintableValue'
          6        SEND_VAL_EX                                              <array>
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $5
   28     9        INIT_METHOD_CALL                                         !0, 'print'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class IPrinter:
Function print:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FcbPh
function name:  print
number of ops:  2
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function print

End of class IPrinter.

Class PrintableValue:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FcbPh
function name:  __construct
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        ASSIGN_OBJ                                               'value'
          2        OP_DATA                                                  !0
   12     3      > RETURN                                                   null

End of function __construct

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FcbPh
function name:  __toString
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'json_encode'
          1        FETCH_OBJ_R                                      ~0      'value'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
   16     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function __tostring

End of class PrintableValue.

Class ConsolePrinter:
Function print:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FcbPh
function name:  print
number of ops:  3
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        ECHO                                                     !0
   22     2      > RETURN                                                   null

End of function print

End of class ConsolePrinter.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.32 ms | 1002 KiB | 14 Q