3v4l.org

run code in 500+ PHP versions simultaneously
<?php $code = <<<'PHP' class X {} class X { PHP; try { eval($code); } catch (Throwable $e) { print $e->getMessage().PHP_EOL; } // Fatal error try { eval($code.'}'); } catch (Throwable $e) { print 'Caught exception'; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 3
Branch analysis from position: 3
2 jumps found. (Code = 107) Position 1 = 4, Position 2 = -2
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Found catch point at position: 11
Branch analysis from position: 11
2 jumps found. (Code = 107) Position 1 = 12, Position 2 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m2uli
function name:  (null)
number of ops:  14
compiled vars:  !0 = $code, !1 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'class+X+%7B%7D%0Aclass+X+%7B%0A'
   10     1        INCLUDE_OR_EVAL                                              !0, EVAL
          2      > JMP                                                          ->8
   11     3  E > > CATCH                                           last         'Throwable'
   12     4    >   INIT_METHOD_CALL                                             !1, 'getMessage'
          5        DO_FCALL                                          0  $4      
          6        CONCAT                                               ~5      $4, '%0A'
          7        ECHO                                                         ~5
   17     8    >   CONCAT                                               ~6      !0, '%7D'
          9        INCLUDE_OR_EVAL                                              ~6, EVAL
         10      > JMP                                                          ->13
   18    11  E > > CATCH                                           last         'Throwable'
   19    12    >   ECHO                                                         'Caught+exception'
   20    13    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
126.23 ms | 475 KiB | 7 Q