3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); echo __LINE__; $foo = function() { return 'OK'; // throw new \Exception('foo'); return 'NOT OK'; }; $return = $foo(); echo $return; try { $foo = function() { return 'OK'; // throw new \Exception('foo'); return 'NOT OK'; }; $return = $foo(); echo $return; } catch (\Exception $e) { var_dump($e); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
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 = 62) Position 1 = -2
filename:       /in/mlhGq
function name:  (null)
number of ops:  22
compiled vars:  !0 = $foo, !1 = $return, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
    5     3        ECHO                                                     5
    7     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FmlhGq%3A7%240'
          5        ASSIGN                                                   !0, ~4
   12     6        INIT_DYNAMIC_CALL                                        !0
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !1, $6
   13     9        ECHO                                                     !1
   16    10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FmlhGq%3A16%241'
         11        ASSIGN                                                   !0, ~8
   21    12        INIT_DYNAMIC_CALL                                        !0
         13        DO_FCALL                                      0  $10     
         14        ASSIGN                                                   !1, $10
   22    15        ECHO                                                     !1
         16      > JMP                                                      ->21
   23    17  E > > CATCH                                       last         'Exception'
   24    18    >   INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                                 
   25    21    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FmlhGq%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mlhGq
function name:  {closure}
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   'OK'
   10     1*       RETURN                                                   'NOT+OK'
   11     2*     > RETURN                                                   null

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

Function %00%7Bclosure%7D%2Fin%2FmlhGq%3A16%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mlhGq
function name:  {closure}
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E > > RETURN                                                   'OK'
   19     1*       RETURN                                                   'NOT+OK'
   20     2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FmlhGq%3A16%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.75 ms | 1396 KiB | 17 Q