3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler(function ($errno, $errstr, $errfile, $errline) { $namespace = 'ajf\ErrorExceptions\Dynamic'; $className = preg_replace('/[^a-zA-Z0-9]/g', '', preg_replace('/\:.*$/g', '', implode('', explode(' ', ucwords($errstr))))); $fullClassName = $namespace . '\\' . $className; if (!class_exists($fullClassName)) { eval("namespace $namespace { class $className extends \ErrorException {} }"); } throw new $fullClassName($errstr, 0, $errno, $errfile, $errline); }); try { $foo = 1/0; } catch (ajf\ErrorExceptions\Dynamic\DivisionByZero $e) { echo "ba-da-bing, ba-da-boom: I caught a $e!\n"; } try { $repent = sin("123abc"); } catch (ajf\ErrorExceptions\Dynamic\ANonWellFormedNumericValueEncountered $e) { echo "praise be to zend_is_numeric_string_ex: $e"; } try { $empty = []; $void = $empty["soul"]; } catch (ajf\ErrorExceptions\Dynamic\UndefinedOffset $e) { echo "not even the colon can defeat me: $e"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
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 = 29
Branch analysis from position: 29
Found catch point at position: 25
Branch analysis from position: 25
2 jumps found. (Code = 107) Position 1 = 26, Position 2 = -2
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jqjAl
function name:  (null)
number of ops:  30
compiled vars:  !0 = $foo, !1 = $e, !2 = $repent, !3 = $empty, !4 = $void
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'set_error_handler'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FjqjAl%3A3%240'
   12     2        SEND_VAL                                                 ~5
          3        DO_ICALL                                                 
   15     4        DIV                                              ~7      1, 0
          5        ASSIGN                                                   !0, ~7
          6      > JMP                                                      ->12
   16     7  E > > CATCH                                       last         'ajf%5CErrorExceptions%5CDynamic%5CDivisionByZero'
   17     8    >   ROPE_INIT                                     3  ~10     'ba-da-bing%2C+ba-da-boom%3A+I+caught+a+'
          9        ROPE_ADD                                      1  ~10     ~10, !1
         10        ROPE_END                                      2  ~9      ~10, '%21%0A'
         11        ECHO                                                     ~9
   21    12    >   INIT_FCALL                                               'sin'
         13        SEND_VAL                                                 '123abc'
         14        DO_ICALL                                         $12     
         15        ASSIGN                                                   !2, $12
         16      > JMP                                                      ->21
   22    17  E > > CATCH                                       last         'ajf%5CErrorExceptions%5CDynamic%5CANonWellFormedNumericValueEncountered'
   23    18    >   NOP                                                      
         19        FAST_CONCAT                                      ~14     'praise+be+to+zend_is_numeric_string_ex%3A+', !1
         20        ECHO                                                     ~14
   27    21    >   ASSIGN                                                   !3, <array>
   28    22        FETCH_DIM_R                                      ~16     !3, 'soul'
         23        ASSIGN                                                   !4, ~16
         24      > JMP                                                      ->29
   29    25  E > > CATCH                                       last         'ajf%5CErrorExceptions%5CDynamic%5CUndefinedOffset'
   30    26    >   NOP                                                      
         27        FAST_CONCAT                                      ~18     'not+even+the+colon+can+defeat+me%3A+', !1
         28        ECHO                                                     ~18
   31    29    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FjqjAl%3A3%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 41
Branch analysis from position: 35
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 41
filename:       /in/jqjAl
function name:  {closure}
number of ops:  51
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errfile, !3 = $errline, !4 = $namespace, !5 = $className, !6 = $fullClassName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    4     4        ASSIGN                                                   !4, 'ajf%5CErrorExceptions%5CDynamic'
    5     5        INIT_FCALL                                               'preg_replace'
          6        SEND_VAL                                                 '%2F%5B%5Ea-zA-Z0-9%5D%2Fg'
          7        SEND_VAL                                                 ''
          8        INIT_FCALL                                               'preg_replace'
          9        SEND_VAL                                                 '%2F%5C%3A.%2A%24%2Fg'
         10        SEND_VAL                                                 ''
         11        INIT_FCALL                                               'implode'
         12        SEND_VAL                                                 ''
         13        INIT_FCALL                                               'explode'
         14        SEND_VAL                                                 '+'
         15        INIT_FCALL                                               'ucwords'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $8      
         18        SEND_VAR                                                 $8
         19        DO_ICALL                                         $9      
         20        SEND_VAR                                                 $9
         21        DO_ICALL                                         $10     
         22        SEND_VAR                                                 $10
         23        DO_ICALL                                         $11     
         24        SEND_VAR                                                 $11
         25        DO_ICALL                                         $12     
         26        ASSIGN                                                   !5, $12
    6    27        CONCAT                                           ~14     !4, '%5C'
         28        CONCAT                                           ~15     ~14, !5
         29        ASSIGN                                                   !6, ~15
    7    30        INIT_FCALL                                               'class_exists'
         31        SEND_VAR                                                 !6
         32        DO_ICALL                                         $17     
         33        BOOL_NOT                                         ~18     $17
         34      > JMPZ                                                     ~18, ->41
    8    35    >   ROPE_INIT                                     5  ~20     'namespace+'
         36        ROPE_ADD                                      1  ~20     ~20, !4
         37        ROPE_ADD                                      2  ~20     ~20, '+%7B+class+'
         38        ROPE_ADD                                      3  ~20     ~20, !5
         39        ROPE_END                                      4  ~19     ~20, '+extends+%5CErrorException+%7B%7D+%7D'
         40        INCLUDE_OR_EVAL                                          ~19, EVAL
   11    41    >   FETCH_CLASS                                   0  $24     !6
         42        NEW                                              $25     $24
         43        SEND_VAR_EX                                              !1
         44        SEND_VAL_EX                                              0
         45        SEND_VAR_EX                                              !0
         46        SEND_VAR_EX                                              !2
         47        SEND_VAR_EX                                              !3
         48        DO_FCALL                                      0          
         49      > THROW                                         0          $25
   12    50*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FjqjAl%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.16 ms | 1404 KiB | 27 Q