3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sum(Number $left = null, Number $right = null) { try { return new Number($left->getValue() + $right->getValue()); } catch (\Error $e) { return new Number(0); } } class Number { private $value; public function __construct($value) { $this->value = $value; } public function getValue() { return $this->value; } } sum(new Number(8), null);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PvB23
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_FCALL                                               'sum'
          1        NEW                                              $0      'Number'
          2        SEND_VAL_EX                                              8
          3        DO_FCALL                                      0          
          4        SEND_VAR                                                 $0
          5        SEND_VAL                                                 null
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Function sum:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 12
Branch analysis from position: 12
2 jumps found. (Code = 107) Position 1 = 13, Position 2 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PvB23
function name:  sum
number of ops:  18
compiled vars:  !0 = $left, !1 = $right, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      null
    6     2        NEW                                              $3      'Number'
          3        INIT_METHOD_CALL                                         !0, 'getValue'
          4        DO_FCALL                                      0  $4      
          5        INIT_METHOD_CALL                                         !1, 'getValue'
          6        DO_FCALL                                      0  $5      
          7        ADD                                              ~6      $4, $5
          8        SEND_VAL_EX                                              ~6
          9        DO_FCALL                                      0          
         10      > RETURN                                                   $3
         11*       JMP                                                      ->17
    7    12  E > > CATCH                                       last         'Error'
    8    13    >   NEW                                              $8      'Number'
         14        SEND_VAL_EX                                              0
         15        DO_FCALL                                      0          
         16      > RETURN                                                   $8
   10    17*     > RETURN                                                   null

End of function sum

Class Number:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PvB23
function name:  __construct
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        ASSIGN_OBJ                                               'value'
          2        OP_DATA                                                  !0
   20     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/PvB23
function name:  getValue
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   FETCH_OBJ_R                                      ~0      'value'
          1      > RETURN                                                   ~0
   25     2*     > RETURN                                                   null

End of function getvalue

End of class Number.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.59 ms | 1394 KiB | 14 Q