3v4l.org

run code in 300+ PHP versions simultaneously
<?php function add ($v1,$v2) { $v[] = (string) $v1; $v[] = (string) $v2; foreach ($v as $val) { $match = array(); preg_match('/\.(\d*)/',$val,$match); if (isset($match[1])) { $dec[] = strlen($match[1]); } else { $dec[] = 0; } } var_dump(bcadd($v[0],$v[1],max($dec))); } add(10.756,10.98324534); add(10,10); add(10.756,10.9); add(10.756,10.); add(10.756,10);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Pluhd
function name:  (null)
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'add'
          1        SEND_VAL                                                 10.756
          2        SEND_VAL                                                 10.9832
          3        DO_FCALL                                      0          
   18     4        INIT_FCALL                                               'add'
          5        SEND_VAL                                                 10
          6        SEND_VAL                                                 10
          7        DO_FCALL                                      0          
   19     8        INIT_FCALL                                               'add'
          9        SEND_VAL                                                 10.756
         10        SEND_VAL                                                 10.9
         11        DO_FCALL                                      0          
   20    12        INIT_FCALL                                               'add'
         13        SEND_VAL                                                 10.756
         14        SEND_VAL                                                 10
         15        DO_FCALL                                      0          
   21    16        INIT_FCALL                                               'add'
         17        SEND_VAL                                                 10.756
         18        SEND_VAL                                                 10
         19        DO_FCALL                                      0          
         20      > RETURN                                                   1

Function add:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 26
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 26
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/Pluhd
function name:  add
number of ops:  43
compiled vars:  !0 = $v1, !1 = $v2, !2 = $v, !3 = $val, !4 = $match, !5 = $dec
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        CAST                                          6  ~7      !0
          3        ASSIGN_DIM                                               !2
          4        OP_DATA                                                  ~7
    4     5        CAST                                          6  ~9      !1
          6        ASSIGN_DIM                                               !2
          7        OP_DATA                                                  ~9
    5     8      > FE_RESET_R                                       $10     !2, ->26
          9    > > FE_FETCH_R                                               $10, !3, ->26
    6    10    >   ASSIGN                                                   !4, <array>
    7    11        INIT_FCALL                                               'preg_match'
         12        SEND_VAL                                                 '%2F%5C.%28%5Cd%2A%29%2F'
         13        SEND_VAR                                                 !3
         14        SEND_REF                                                 !4
         15        DO_ICALL                                                 
    8    16        ISSET_ISEMPTY_DIM_OBJ                         0          !4, 1
         17      > JMPZ                                                     ~13, ->23
    9    18    >   FETCH_DIM_R                                      ~15     !4, 1
         19        STRLEN                                           ~16     ~15
         20        ASSIGN_DIM                                               !5
         21        OP_DATA                                                  ~16
         22      > JMP                                                      ->25
   12    23    >   ASSIGN_DIM                                               !5
         24        OP_DATA                                                  0
    5    25    > > JMP                                                      ->9
         26    >   FE_FREE                                                  $10
   15    27        INIT_FCALL                                               'var_dump'
         28        INIT_FCALL_BY_NAME                                       'bcadd'
         29        CHECK_FUNC_ARG                                           
         30        FETCH_DIM_FUNC_ARG                               $18     !2, 0
         31        SEND_FUNC_ARG                                            $18
         32        CHECK_FUNC_ARG                                           
         33        FETCH_DIM_FUNC_ARG                               $19     !2, 1
         34        SEND_FUNC_ARG                                            $19
         35        INIT_FCALL                                               'max'
         36        SEND_VAR                                                 !5
         37        DO_ICALL                                         $20     
         38        SEND_VAR_NO_REF_EX                                       $20
         39        DO_FCALL                                      0  $21     
         40        SEND_VAR                                                 $21
         41        DO_ICALL                                                 
   16    42      > RETURN                                                   null

End of function add

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.16 ms | 1394 KiB | 27 Q