3v4l.org

run code in 300+ PHP versions simultaneously
<?php class integer { private $value; public function __construct(int $value) { $this->value = $value; } public function __invoke(int ...$value) : int { if (count($value) === 1) $this->value = $value[0]; else throw new Exception('Multiple values given.'); return $this->value; } } $testi = new integer(1); $testi(2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EDaHS
function name:  (null)
number of ops:  8
compiled vars:  !0 = $testi
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'integer'
          1        SEND_VAL_EX                                              1
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   22     4        INIT_DYNAMIC_CALL                                        !0
          5        SEND_VAL_EX                                              2
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

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

End of function __construct

Function __invoke:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/EDaHS
function name:  __invoke
number of ops:  17
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV_VARIADIC                                    !0      
   13     1        COUNT                                            ~1      !0
          2        IS_IDENTICAL                                             ~1, 1
          3      > JMPZ                                                     ~2, ->8
   14     4    >   FETCH_DIM_R                                      ~4      !0, 0
          5        ASSIGN_OBJ                                               'value'
          6        OP_DATA                                                  ~4
          7      > JMP                                                      ->12
   16     8    >   NEW                                              $5      'Exception'
          9        SEND_VAL_EX                                              'Multiple+values+given.'
         10        DO_FCALL                                      0          
         11      > THROW                                         0          $5
   17    12    >   FETCH_OBJ_R                                      ~7      'value'
         13        VERIFY_RETURN_TYPE                                       ~7
         14      > RETURN                                                   ~7
   18    15*       VERIFY_RETURN_TYPE                                       
         16*     > RETURN                                                   null

End of function __invoke

End of class integer.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.23 ms | 1386 KiB | 13 Q