3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function handler($errno, $errstr, $errfile, $errline){ echo "Handler in action: \n"; var_export($errstr); return true; } set_error_handler("handler"); $input = "Fly again"; function test(string $test) : string { return $test; } try{ echo test($input); } catch(Exception $ex) { echo "Catched Exception: \n"; var_export($ex); } catch(Error $er) { echo "Catched Error: \n"; var_export($er); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 9
Branch analysis from position: 9
2 jumps found. (Code = 107) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 15
2 jumps found. (Code = 107) Position 1 = 16, Position 2 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 15
Branch analysis from position: 15
filename:       /in/vWvV8
function name:  (null)
number of ops:  21
compiled vars:  !0 = $input, !1 = $ex, !2 = $er
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'handler'
          2        DO_ICALL                                                 
   13     3        ASSIGN                                                   !0, 'Fly+again'
   20     4        INIT_FCALL                                               'test'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $5      
          7        ECHO                                                     $5
          8      > JMP                                                      ->20
   21     9  E > > CATCH                                                    'Exception', ->15
   22    10    >   ECHO                                                     'Catched+Exception%3A+%0A'
   23    11        INIT_FCALL                                               'var_export'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
         14      > JMP                                                      ->20
   24    15  E > > CATCH                                       last         'Error'
   25    16    >   ECHO                                                     'Catched+Error%3A+%0A'
   26    17        INIT_FCALL                                               'var_export'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   27    20    > > RETURN                                                   1

Function handler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vWvV8
function name:  handler
number of ops:  10
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errfile, !3 = $errline
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    6     4        ECHO                                                     'Handler+in+action%3A+%0A'
    7     5        INIT_FCALL                                               'var_export'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
    8     8      > RETURN                                                   <true>
    9     9*     > RETURN                                                   null

End of function handler

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vWvV8
function name:  test
number of ops:  5
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        VERIFY_RETURN_TYPE                                       !0
          2      > RETURN                                                   !0
   17     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.92 ms | 1403 KiB | 18 Q