3v4l.org

run code in 300+ PHP versions simultaneously
<?php function handleError($level, $message, $file = '', $line = 0, $context = []) { throw new ErrorException($message, 0, $level, $file, $line); } set_error_handler('handleError'); class A { public function abc(): bool { return false; } } $r = new ReflectionMethod("A", "abc"); (string)$r->getReturnType() ?: "";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7UK9C
function name:  (null)
number of ops:  15
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'handleError'
          2        DO_ICALL                                                 
   18     3        NEW                                              $2      'ReflectionMethod'
          4        SEND_VAL_EX                                              'A'
          5        SEND_VAL_EX                                              'abc'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $2
   19     8        INIT_METHOD_CALL                                         !0, 'getReturnType'
          9        DO_FCALL                                      0  $5      
         10        CAST                                          6  ~6      $5
         11        JMP_SET                                          ~7      ~6, ->13
         12        QM_ASSIGN                                        ~7      ''
         13        FREE                                                     ~7
         14      > RETURN                                                   1

Function handleerror:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/7UK9C
function name:  handleError
number of ops:  14
compiled vars:  !0 = $level, !1 = $message, !2 = $file, !3 = $line, !4 = $context
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      ''
          3        RECV_INIT                                        !3      0
          4        RECV_INIT                                        !4      <array>
    4     5        NEW                                              $5      'ErrorException'
          6        SEND_VAR_EX                                              !1
          7        SEND_VAL_EX                                              0
          8        SEND_VAR_EX                                              !0
          9        SEND_VAR_EX                                              !2
         10        SEND_VAR_EX                                              !3
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $5
    5    13*     > RETURN                                                   null

End of function handleerror

Class A:
Function abc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7UK9C
function name:  abc
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E > > RETURN                                                   <false>
   15     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function abc

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.07 ms | 1396 KiB | 15 Q