3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); set_error_handler(function ($n, $message) { echo 'Error handler called: ' . $message . PHP_EOL; }); set_exception_handler(function ($e) { echo 'Exception handler called: ' . get_class($e) . ' - ' . $e->getMessage() . PHP_EOL; }); function strict(int $i) {} explode(['not', 'valid'], ['arguments']); try { explode(['not', 'valid'], ['arguments']); } catch (Throwable $e) { echo 'Caught exception: ' . get_class($e) . ' - ' . $e->getMessage() . PHP_EOL; } try { eval('eval is evil'); } catch (ParseError $e) { echo 'Caught exception: ' . get_class($e) . ' - ' . $e->getMessage() . PHP_EOL; } try { echo 1 / 0; } catch (DivisionByZeroError $e) { echo 'Caught exception: ' . get_class($e) . ' - ' . $e->getMessage() . PHP_EOL; } try { strict('one'); } catch (TypeError $e) { echo 'Caught exception: ' . get_class($e) . ' - ' . $e->getMessage() . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 17
Branch analysis from position: 17
2 jumps found. (Code = 107) Position 1 = 18, Position 2 = -2
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Found catch point at position: 28
Branch analysis from position: 28
2 jumps found. (Code = 107) Position 1 = 29, Position 2 = -2
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
Found catch point at position: 40
Branch analysis from position: 40
2 jumps found. (Code = 107) Position 1 = 41, Position 2 = -2
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
Found catch point at position: 53
Branch analysis from position: 53
2 jumps found. (Code = 107) Position 1 = 54, Position 2 = -2
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RNKXa
function name:  (null)
number of ops:  63
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'set_error_handler'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FRNKXa%3A5%240'
    7     2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
    8     4        INIT_FCALL                                               'set_exception_handler'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FRNKXa%3A8%241'
   10     6        SEND_VAL                                                 ~3
          7        DO_ICALL                                                 
   14     8        INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 <array>
         10        SEND_VAL                                                 <array>
         11        DO_ICALL                                                 
   17    12        INIT_FCALL                                               'explode'
         13        SEND_VAL                                                 <array>
         14        SEND_VAL                                                 <array>
         15        DO_ICALL                                                 
         16      > JMP                                                      ->26
   18    17  E > > CATCH                                       last         'Throwable'
   19    18    >   GET_CLASS                                        ~7      !0
         19        CONCAT                                           ~8      'Caught+exception%3A+', ~7
         20        CONCAT                                           ~9      ~8, '+-+'
         21        INIT_METHOD_CALL                                         !0, 'getMessage'
         22        DO_FCALL                                      0  $10     
         23        CONCAT                                           ~11     ~9, $10
         24        CONCAT                                           ~12     ~11, '%0A'
         25        ECHO                                                     ~12
   23    26    >   INCLUDE_OR_EVAL                                          'eval+is+evil', EVAL
         27      > JMP                                                      ->37
   24    28  E > > CATCH                                       last         'ParseError'
   25    29    >   GET_CLASS                                        ~14     !0
         30        CONCAT                                           ~15     'Caught+exception%3A+', ~14
         31        CONCAT                                           ~16     ~15, '+-+'
         32        INIT_METHOD_CALL                                         !0, 'getMessage'
         33        DO_FCALL                                      0  $17     
         34        CONCAT                                           ~18     ~16, $17
         35        CONCAT                                           ~19     ~18, '%0A'
         36        ECHO                                                     ~19
   29    37    >   DIV                                              ~20     1, 0
         38        ECHO                                                     ~20
         39      > JMP                                                      ->49
   30    40  E > > CATCH                                       last         'DivisionByZeroError'
   31    41    >   GET_CLASS                                        ~21     !0
         42        CONCAT                                           ~22     'Caught+exception%3A+', ~21
         43        CONCAT                                           ~23     ~22, '+-+'
         44        INIT_METHOD_CALL                                         !0, 'getMessage'
         45        DO_FCALL                                      0  $24     
         46        CONCAT                                           ~25     ~23, $24
         47        CONCAT                                           ~26     ~25, '%0A'
         48        ECHO                                                     ~26
   35    49    >   INIT_FCALL                                               'strict'
         50        SEND_VAL                                                 'one'
         51        DO_FCALL                                      0          
         52      > JMP                                                      ->62
   36    53  E > > CATCH                                       last         'TypeError'
   37    54    >   GET_CLASS                                        ~28     !0
         55        CONCAT                                           ~29     'Caught+exception%3A+', ~28
         56        CONCAT                                           ~30     ~29, '+-+'
         57        INIT_METHOD_CALL                                         !0, 'getMessage'
         58        DO_FCALL                                      0  $31     
         59        CONCAT                                           ~32     ~30, $31
         60        CONCAT                                           ~33     ~32, '%0A'
         61        ECHO                                                     ~33
   38    62    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FRNKXa%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RNKXa
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $n, !1 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        CONCAT                                           ~2      'Error+handler+called%3A+', !1
          3        CONCAT                                           ~3      ~2, '%0A'
          4        ECHO                                                     ~3
    7     5      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FRNKXa%3A5%240

Function %00%7Bclosure%7D%2Fin%2FRNKXa%3A8%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RNKXa
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        GET_CLASS                                        ~1      !0
          2        CONCAT                                           ~2      'Exception+handler+called%3A+', ~1
          3        CONCAT                                           ~3      ~2, '+-+'
          4        INIT_METHOD_CALL                                         !0, 'getMessage'
          5        DO_FCALL                                      0  $4      
          6        CONCAT                                           ~5      ~3, $4
          7        CONCAT                                           ~6      ~5, '%0A'
          8        ECHO                                                     ~6
   10     9      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FRNKXa%3A8%241

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

End of function strict

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.86 ms | 1407 KiB | 20 Q