3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Out extends Exception { private $value; function __construct($value) { $this->value = $value; } function getValue() { return $this->value; } } function out($value = NULL) { throw new Out($value); } function mul($x, $y) { try { return ($x ?? out('x is NULL')) * ($y ?? out('y is NULL')); } catch (Out $out) { return $out->getValue(); } } var_export(mul(3, 4)); print "\n"; var_export(mul(3, NULL)); print "\n"; var_export(mul(NULL, 4)); print "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U6arm
function name:  (null)
number of ops:  25
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   INIT_FCALL                                                   'var_export'
          1        INIT_FCALL                                                   'mul'
          2        SEND_VAL                                                     3
          3        SEND_VAL                                                     4
          4        DO_FCALL                                          0  $0      
          5        SEND_VAR                                                     $0
          6        DO_ICALL                                                     
   27     7        ECHO                                                         '%0A'
   28     8        INIT_FCALL                                                   'var_export'
          9        INIT_FCALL                                                   'mul'
         10        SEND_VAL                                                     3
         11        SEND_VAL                                                     null
         12        DO_FCALL                                          0  $2      
         13        SEND_VAR                                                     $2
         14        DO_ICALL                                                     
   29    15        ECHO                                                         '%0A'
   30    16        INIT_FCALL                                                   'var_export'
         17        INIT_FCALL                                                   'mul'
         18        SEND_VAL                                                     null
         19        SEND_VAL                                                     4
         20        DO_FCALL                                          0  $4      
         21        SEND_VAR                                                     $4
         22        DO_ICALL                                                     
   31    23        ECHO                                                         '%0A'
         24      > RETURN                                                       1

Function out:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/U6arm
function name:  out
number of ops:  6
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   RECV_INIT                                            !0      null
   14     1        NEW                                                  $1      'Out'
          2        SEND_VAR_EX                                                  !0
          3        DO_FCALL                                          0          
          4      > THROW                                             0          $1
   15     5*     > RETURN                                                       null

End of function out

Function mul:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 15
Branch analysis from position: 15
2 jumps found. (Code = 107) Position 1 = 16, Position 2 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U6arm
function name:  mul
number of ops:  20
compiled vars:  !0 = $x, !1 = $y, !2 = $out
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   19     2        COALESCE                                             ~3      !0
          3        INIT_FCALL                                                   'out'
          4        SEND_VAL                                                     'x+is+NULL'
          5        DO_FCALL                                          0  $4      
          6        QM_ASSIGN                                            ~3      $4
          7        COALESCE                                             ~5      !1
          8        INIT_FCALL                                                   'out'
          9        SEND_VAL                                                     'y+is+NULL'
         10        DO_FCALL                                          0  $6      
         11        QM_ASSIGN                                            ~5      $6
         12        MUL                                                  ~7      ~3, ~5
         13      > RETURN                                                       ~7
         14*       JMP                                                          ->19
   21    15  E > > CATCH                                           last         'Out'
   22    16    >   INIT_METHOD_CALL                                             !2, 'getValue'
         17        DO_FCALL                                          0  $8      
         18      > RETURN                                                       $8
   24    19*     > RETURN                                                       null

End of function mul

Class Out:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U6arm
function name:  __construct
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    6     1        ASSIGN_OBJ                                                   'value'
          2        OP_DATA                                                      !0
    7     3      > RETURN                                                       null

End of function __construct

Function getvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U6arm
function name:  getValue
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                          ~0      'value'
          1      > RETURN                                                       ~0
   10     2*     > RETURN                                                       null

End of function getvalue

End of class Out.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
233.73 ms | 2087 KiB | 19 Q