3v4l.org

run code in 300+ PHP versions simultaneously
<?php $success=false; if (true){ set_error_handler(function($a, $b, $c, $d) { var_dump('error_handler', $a, $b, $c, $d); }); register_shutdown_function(function(){ if ($success){return;} var_dump(get_last_error()); }); } $var = 1; try { $var->method(); // Throws an Error object in PHP 7. } catch (Error $e) { // Handle error var_dump('error', $e); } catch (Exception $e) { // Handle error var_dump('exception', $e); } $success=true; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 10
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
Found catch point at position: 14
Branch analysis from position: 14
2 jumps found. (Code = 107) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 20
2 jumps found. (Code = 107) Position 1 = 21, Position 2 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 20
Branch analysis from position: 20
filename:       /in/Uh2AD
function name:  (null)
number of ops:  27
compiled vars:  !0 = $success, !1 = $var, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <false>
    3     1      > JMPZ                                                     <true>, ->10
    4     2    >   INIT_FCALL                                               'set_error_handler'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FUh2AD%3A4%240'
    6     4        SEND_VAL                                                 ~4
          5        DO_ICALL                                                 
    7     6        INIT_FCALL                                               'register_shutdown_function'
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FUh2AD%3A7%241'
   11     8        SEND_VAL                                                 ~6
          9        DO_ICALL                                                 
   14    10    >   ASSIGN                                                   !1, 1
   17    11        INIT_METHOD_CALL                                         !1, 'method'
         12        DO_FCALL                                      0          
         13      > JMP                                                      ->25
   18    14  E > > CATCH                                                    'Error', ->20
   20    15    >   INIT_FCALL                                               'var_dump'
         16        SEND_VAL                                                 'error'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > JMP                                                      ->25
   21    20  E > > CATCH                                       last         'Exception'
   23    21    >   INIT_FCALL                                               'var_dump'
         22        SEND_VAL                                                 'exception'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
   26    25    >   ASSIGN                                                   !0, <true>
   27    26      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FUh2AD%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uh2AD
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    5     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAL                                                 'error_handler'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !1
          8        SEND_VAR                                                 !2
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                                 
    6    11      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FUh2AD%3A4%240

Function %00%7Bclosure%7D%2Fin%2FUh2AD%3A7%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 2
Branch analysis from position: 1
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uh2AD
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $success
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > JMPZ                                                     !0, ->2
          1    > > RETURN                                                   null
   10     2    >   INIT_FCALL                                               'var_dump'
          3        INIT_FCALL_BY_NAME                                       'get_last_error'
          4        DO_FCALL                                      0  $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                                 
   11     7      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FUh2AD%3A7%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.9 ms | 1404 KiB | 19 Q