3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Math { public int $x; public int $y; public function __construct($x, $y) { $this->x = $x; $this->y = $y; } public function add() { return $this->x + $this->y; } } try { (new Math(3, "nonsense"))->add(); } catch (Error $e) { echo "Look, I'm Python!"; }
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: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/obW7U
function name:  (null)
number of ops:  10
compiled vars:  !0 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   NEW                                                  $1      'Math'
          1        SEND_VAL_EX                                                  3
          2        SEND_VAL_EX                                                  'nonsense'
          3        DO_FCALL                                          0          
          4        INIT_METHOD_CALL                                             $1, 'add'
          5        DO_FCALL                                          0          
          6      > JMP                                                          ->9
   18     7  E > > CATCH                                           last         'Error'
   19     8    >   ECHO                                                         'Look%2C+I%27m+Python%21'
   20     9    > > RETURN                                                       1

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

End of function __construct

Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/obW7U
function name:  add
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                          ~0      'x'
          1        FETCH_OBJ_R                                          ~1      'y'
          2        ADD                                                  ~2      ~0, ~1
          3      > RETURN                                                       ~2
   13     4*     > RETURN                                                       null

End of function add

End of class Math.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163 ms | 2198 KiB | 13 Q