3v4l.org

run code in 300+ PHP versions simultaneously
<?php function add ($v1,$v2) { $v[] = (string) $v1; $v[] = (string) $v2; foreach ($v as $val) { preg_match('/\.(\d*)/',$match,$val); $dec[] = strlen($val); } var_dump($dec); } add(10.756,10.98324534); var_dump(bcadd(10.917,10)); var_dump(bcadd(10.917,10,0)); var_dump(bcadd(10.917,10,1)); var_dump(bcadd(10.917,10,2)); var_dump(bcadd(10.917,10,3)); var_dump(bcadd(10.917,10,4));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Th4Q
function name:  (null)
number of ops:  52
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'add'
          1        SEND_VAL                                                 10.756
          2        SEND_VAL                                                 10.9832
          3        DO_FCALL                                      0          
   12     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL_BY_NAME                                       'bcadd'
          6        SEND_VAL_EX                                              10.917
          7        SEND_VAL_EX                                              10
          8        DO_FCALL                                      0  $1      
          9        SEND_VAR                                                 $1
         10        DO_ICALL                                                 
   13    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL_BY_NAME                                       'bcadd'
         13        SEND_VAL_EX                                              10.917
         14        SEND_VAL_EX                                              10
         15        SEND_VAL_EX                                              0
         16        DO_FCALL                                      0  $3      
         17        SEND_VAR                                                 $3
         18        DO_ICALL                                                 
   14    19        INIT_FCALL                                               'var_dump'
         20        INIT_FCALL_BY_NAME                                       'bcadd'
         21        SEND_VAL_EX                                              10.917
         22        SEND_VAL_EX                                              10
         23        SEND_VAL_EX                                              1
         24        DO_FCALL                                      0  $5      
         25        SEND_VAR                                                 $5
         26        DO_ICALL                                                 
   15    27        INIT_FCALL                                               'var_dump'
         28        INIT_FCALL_BY_NAME                                       'bcadd'
         29        SEND_VAL_EX                                              10.917
         30        SEND_VAL_EX                                              10
         31        SEND_VAL_EX                                              2
         32        DO_FCALL                                      0  $7      
         33        SEND_VAR                                                 $7
         34        DO_ICALL                                                 
   16    35        INIT_FCALL                                               'var_dump'
         36        INIT_FCALL_BY_NAME                                       'bcadd'
         37        SEND_VAL_EX                                              10.917
         38        SEND_VAL_EX                                              10
         39        SEND_VAL_EX                                              3
         40        DO_FCALL                                      0  $9      
         41        SEND_VAR                                                 $9
         42        DO_ICALL                                                 
   17    43        INIT_FCALL                                               'var_dump'
         44        INIT_FCALL_BY_NAME                                       'bcadd'
         45        SEND_VAL_EX                                              10.917
         46        SEND_VAL_EX                                              10
         47        SEND_VAL_EX                                              4
         48        DO_FCALL                                      0  $11     
         49        SEND_VAR                                                 $11
         50        DO_ICALL                                                 
         51      > RETURN                                                   1

Function add:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/1Th4Q
function name:  add
number of ops:  24
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, ->19
          9    > > FE_FETCH_R                                               $10, !3, ->19
    6    10    >   INIT_FCALL                                               'preg_match'
         11        SEND_VAL                                                 '%2F%5C.%28%5Cd%2A%29%2F'
         12        SEND_VAR                                                 !4
         13        SEND_REF                                                 !3
         14        DO_ICALL                                                 
    7    15        STRLEN                                           ~13     !3
         16        ASSIGN_DIM                                               !5
         17        OP_DATA                                                  ~13
    5    18      > JMP                                                      ->9
         19    >   FE_FREE                                                  $10
    9    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !5
         22        DO_ICALL                                                 
   10    23      > RETURN                                                   null

End of function add

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.49 ms | 1403 KiB | 21 Q