3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1, 2, 3]; try { $ressult = array_map(function($data) { throw new Exception("force exception"); }, $array); } catch(Exception $e) { echo $e->getMessage(); }
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 = 62) Position 1 = -2
Found catch point at position: 8
Branch analysis from position: 8
2 jumps found. (Code = 107) Position 1 = 9, Position 2 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kpq7V
function name:  (null)
number of ops:  13
compiled vars:  !0 = $array, !1 = $ressult, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    7     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FKpq7V%3A7%240'
          3        SEND_VAL                                                 ~4
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !1, $5
          7      > JMP                                                      ->12
   10     8  E > > CATCH                                       last         'Exception'
   11     9    >   INIT_METHOD_CALL                                         !2, 'getMessage'
         10        DO_FCALL                                      0  $7      
         11        ECHO                                                     $7
   12    12    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FKpq7V%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/Kpq7V
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        NEW                                              $1      'Exception'
          2        SEND_VAL_EX                                              'force+exception'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $1
          5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FKpq7V%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.76 ms | 1395 KiB | 15 Q