3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); error_reporting(E_ALL); final class foo { public function __toString(): string { return 'asdas'; } } function bar (string|\Stringable $c) { var_dump((string)$c); } bar(new foo());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3FKKQ
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'error_reporting'
          1        SEND_VAL                                                     30719
          2        DO_ICALL                                                     
    6     3        DECLARE_CLASS                                                'foo'
   20     4        INIT_FCALL                                                   'bar'
          5        NEW                                                  $1      'foo'
          6        DO_FCALL                                          0          
          7        SEND_VAR                                                     $1
          8        DO_FCALL                                          0          
          9      > RETURN                                                       1

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3FKKQ
function name:  bar
number of ops:  6
compiled vars:  !0 = $c
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
   17     1        INIT_FCALL                                                   'var_dump'
          2        CAST                                              6  ~1      !0
          3        SEND_VAL                                                     ~1
          4        DO_ICALL                                                     
   18     5      > RETURN                                                       null

End of function bar

Class foo:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3FKKQ
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                       'asdas'
   12     1*       VERIFY_RETURN_TYPE                                           
          2*     > RETURN                                                       null

End of function __tostring

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.12 ms | 493 KiB | 12 Q