3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($n) { if ($n === 'bar') { throw new RuntimeException('WTF this ^ warning if I\'m catching the exception?'); } return $n; } try { array_map('test', ['foo', 'bar', 'bar']); } catch(RuntimeException $e) { echo $e->getMessage(); }
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: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gfjg8
function name:  (null)
number of ops:  10
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'array_map'
          1        SEND_VAL                                                 'test'
          2        SEND_VAL                                                 <array>
          3        DO_ICALL                                                 
          4      > JMP                                                      ->9
   12     5  E > > CATCH                                       last         'RuntimeException'
   13     6    >   INIT_METHOD_CALL                                         !0, 'getMessage'
          7        DO_FCALL                                      0  $2      
          8        ECHO                                                     $2
   14     9    > > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gfjg8
function name:  test
number of ops:  9
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        IS_IDENTICAL                                             !0, 'bar'
          2      > JMPZ                                                     ~1, ->7
    5     3    >   NEW                                              $2      'RuntimeException'
          4        SEND_VAL_EX                                              'WTF+this+%5E+warning+if+I%27m+catching+the+exception%3F'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
    7     7    > > RETURN                                                   !0
    8     8*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
212.44 ms | 1399 KiB | 15 Q