3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = gmp_pow("10", 100); $b = gmp_pow("10", 303); $c = gmp_pow("10", 600); echo "10^100 * 10^600 = ".dumbFormatScientific(gmp_mul($a, $c))." Aka.: \n"; echo gmp_mul($a, $c)."\n"; echo "10^100 * 10^303 = ".dumbFormatScientific(gmp_mul($a, $b))." Aka.: \n"; echo gmp_mul($a, $b)."\n"; function dumbFormatScientific(GMP $input) { $string = gmp_strval($input); $str_arr = str_split($string); $char_cnt = 0; foreach($str_arr as $char) { if($char == 0) { $char_cnt++; } } return "10^".$char_cnt; } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3LuWY
function name:  (null)
number of ops:  48
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'gmp_pow'
          1        SEND_VAL_EX                                              '10'
          2        SEND_VAL_EX                                              100
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !0, $3
    4     5        INIT_FCALL_BY_NAME                                       'gmp_pow'
          6        SEND_VAL_EX                                              '10'
          7        SEND_VAL_EX                                              303
          8        DO_FCALL                                      0  $5      
          9        ASSIGN                                                   !1, $5
    5    10        INIT_FCALL_BY_NAME                                       'gmp_pow'
         11        SEND_VAL_EX                                              '10'
         12        SEND_VAL_EX                                              600
         13        DO_FCALL                                      0  $7      
         14        ASSIGN                                                   !2, $7
    7    15        INIT_FCALL_BY_NAME                                       'dumbFormatScientific'
         16        INIT_FCALL_BY_NAME                                       'gmp_mul'
         17        SEND_VAR_EX                                              !0
         18        SEND_VAR_EX                                              !2
         19        DO_FCALL                                      0  $9      
         20        SEND_VAR_NO_REF_EX                                       $9
         21        DO_FCALL                                      0  $10     
         22        CONCAT                                           ~11     '10%5E100+%2A+10%5E600+%3D+', $10
         23        CONCAT                                           ~12     ~11, '+Aka.%3A+%0A'
         24        ECHO                                                     ~12
    8    25        INIT_FCALL_BY_NAME                                       'gmp_mul'
         26        SEND_VAR_EX                                              !0
         27        SEND_VAR_EX                                              !2
         28        DO_FCALL                                      0  $13     
         29        CONCAT                                           ~14     $13, '%0A'
         30        ECHO                                                     ~14
    9    31        INIT_FCALL_BY_NAME                                       'dumbFormatScientific'
         32        INIT_FCALL_BY_NAME                                       'gmp_mul'
         33        SEND_VAR_EX                                              !0
         34        SEND_VAR_EX                                              !1
         35        DO_FCALL                                      0  $15     
         36        SEND_VAR_NO_REF_EX                                       $15
         37        DO_FCALL                                      0  $16     
         38        CONCAT                                           ~17     '10%5E100+%2A+10%5E303+%3D+', $16
         39        CONCAT                                           ~18     ~17, '+Aka.%3A+%0A'
         40        ECHO                                                     ~18
   10    41        INIT_FCALL_BY_NAME                                       'gmp_mul'
         42        SEND_VAR_EX                                              !0
         43        SEND_VAR_EX                                              !1
         44        DO_FCALL                                      0  $19     
         45        CONCAT                                           ~20     $19, '%0A'
         46        ECHO                                                     ~20
   29    47      > RETURN                                                   1

Function dumbformatscientific:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 15
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/3LuWY
function name:  dumbFormatScientific
number of ops:  20
compiled vars:  !0 = $input, !1 = $string, !2 = $str_arr, !3 = $char_cnt, !4 = $char
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        INIT_FCALL_BY_NAME                                       'gmp_strval'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $5      
          4        ASSIGN                                                   !1, $5
   15     5        INIT_FCALL                                               'str_split'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !2, $7
   17     9        ASSIGN                                                   !3, 0
   18    10      > FE_RESET_R                                       $10     !2, ->16
         11    > > FE_FETCH_R                                               $10, !4, ->16
   20    12    >   IS_EQUAL                                                 !4, 0
         13      > JMPZ                                                     ~11, ->15
   22    14    >   PRE_INC                                                  !3
   18    15    > > JMP                                                      ->11
         16    >   FE_FREE                                                  $10
   26    17        CONCAT                                           ~13     '10%5E', !3
         18      > RETURN                                                   ~13
   27    19*     > RETURN                                                   null

End of function dumbformatscientific

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.18 ms | 1404 KiB | 24 Q