3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo phpversion(), "\n"; function handle($throw = FALSE) { try { try { throw new \LogicException('invalid xml'); } catch (\Exception $e) { throw new \LogicException('', 0, $e); // wrap } } catch (\LogicException $e) { echo "ok\n"; } catch (\Exception $e) { echo "ok\n"; } } try { handle(); } catch (\Exception $e) { die('FUCKING BUG'); } $port = str_replace('.', '', phpversion()); proc_close(proc_open('php -S 127.0.0.1:' . $port . ' >/dev/null 2>/dev/null &', array(), $null)); sleep(1); echo exec('curl ' . escapeshellarg('http://127.0.0.1:' . $port . '/' . basename(__FILE__)) . ' 2>/dev/null');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
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 = 79) Position 1 = -2
filename:       /in/hPUm0
function name:  (null)
number of ops:  46
compiled vars:  !0 = $e, !1 = $port, !2 = $null
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'phpversion'
          1        DO_ICALL                                         $3      
          2        ECHO                                                     $3
          3        ECHO                                                     '%0A'
   24     4        INIT_FCALL                                               'handle'
          5        DO_FCALL                                      0          
          6      > JMP                                                      ->9
   25     7  E > > CATCH                                       last         'Exception'
   26     8    > > EXIT                                                     'FUCKING+BUG'
   30     9    >   INIT_FCALL                                               'str_replace'
         10        SEND_VAL                                                 '.'
         11        SEND_VAL                                                 ''
         12        INIT_FCALL                                               'phpversion'
         13        DO_ICALL                                         $5      
         14        SEND_VAR                                                 $5
         15        DO_ICALL                                         $6      
         16        ASSIGN                                                   !1, $6
   31    17        INIT_FCALL                                               'proc_close'
         18        INIT_FCALL                                               'proc_open'
         19        CONCAT                                           ~8      'php+-S+127.0.0.1%3A', !1
         20        CONCAT                                           ~9      ~8, '+%3E%2Fdev%2Fnull+2%3E%2Fdev%2Fnull+%26'
         21        SEND_VAL                                                 ~9
         22        SEND_VAL                                                 <array>
         23        SEND_REF                                                 !2
         24        DO_ICALL                                         $10     
         25        SEND_VAR                                                 $10
         26        DO_ICALL                                                 
   32    27        INIT_FCALL                                               'sleep'
         28        SEND_VAL                                                 1
         29        DO_ICALL                                                 
   34    30        INIT_FCALL                                               'exec'
         31        INIT_FCALL                                               'escapeshellarg'
         32        CONCAT                                           ~13     'http%3A%2F%2F127.0.0.1%3A', !1
         33        CONCAT                                           ~14     ~13, '%2F'
         34        INIT_FCALL                                               'basename'
         35        SEND_VAL                                                 '%2Fin%2FhPUm0'
         36        DO_ICALL                                         $15     
         37        CONCAT                                           ~16     ~14, $15
         38        SEND_VAL                                                 ~16
         39        DO_ICALL                                         $17     
         40        CONCAT                                           ~18     'curl+', $17
         41        CONCAT                                           ~19     ~18, '++2%3E%2Fdev%2Fnull'
         42        SEND_VAL                                                 ~19
         43        DO_ICALL                                         $20     
         44        ECHO                                                     $20
         45      > RETURN                                                   1

Function handle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 14
Branch analysis from position: 14
2 jumps found. (Code = 107) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
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 = 62) Position 1 = -2
Found catch point at position: 17
Branch analysis from position: 17
filename:       /in/hPUm0
function name:  handle
number of ops:  20
compiled vars:  !0 = $throw, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      <false>
    9     1        NEW                                              $2      'LogicException'
          2        SEND_VAL_EX                                              'invalid+xml'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $2
          5*       JMP                                                      ->13
   11     6  E > > CATCH                                       last         'Exception'
   12     7    >   NEW                                              $4      'LogicException'
          8        SEND_VAL_EX                                              ''
          9        SEND_VAL_EX                                              0
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $4
         13*       JMP                                                      ->19
   15    14  E > > CATCH                                                    'LogicException', ->17
   16    15    >   ECHO                                                     'ok%0A'
         16      > JMP                                                      ->19
   18    17  E > > CATCH                                       last         'Exception'
   19    18    >   ECHO                                                     'ok%0A'
   21    19    > > RETURN                                                   null

End of function handle

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.07 ms | 1403 KiB | 30 Q