3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Test { public function __construct(private int|float $multiplierEffect) { } public function doCalculation(int|float $input): int|float { $n = new \BcMath\Number($input); return $n->mul($this->multiplierEffect)->value; } } $test = new Test(3.4); var_dump($test->doCalculation(1.6));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6goJU
function name:  (null)
number of ops:  11
compiled vars:  !0 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   NEW                                                  $1      'Test'
          1        SEND_VAL_EX                                                  3.4
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   15     4        INIT_FCALL                                                   'var_dump'
          5        INIT_METHOD_CALL                                             !0, 'doCalculation'
          6        SEND_VAL_EX                                                  1.6
          7        DO_FCALL                                          0  $4      
          8        SEND_VAR                                                     $4
          9        DO_ICALL                                                     
         10      > RETURN                                                       1

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

End of function __construct

Function docalculation:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6goJU
function name:  doCalculation
number of ops:  15
compiled vars:  !0 = $input, !1 = $n
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
    8     1        NEW                                                  $2      'BcMath%5CNumber'
          2        SEND_VAR_EX                                                  !0
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !1, $2
   10     5        INIT_METHOD_CALL                                             !1, 'mul'
          6        CHECK_FUNC_ARG                                               
          7        FETCH_OBJ_FUNC_ARG                                   $5      'multiplierEffect'
          8        SEND_FUNC_ARG                                                $5
          9        DO_FCALL                                          0  $6      
         10        FETCH_OBJ_R                                          ~7      $6, 'value'
         11        VERIFY_RETURN_TYPE                                           ~7
         12      > RETURN                                                       ~7
   11    13*       VERIFY_RETURN_TYPE                                           
         14*     > RETURN                                                       null

End of function docalculation

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
147.51 ms | 804 KiB | 9 Q