3v4l.org

run code in 300+ PHP versions simultaneously
<?php function makeScientificNumber($number){ $power = ($number % 10) - 1; return ($number / pow(10, $power)) . "e" . $power; } function makeNormalNumber($scientific){ return number_format($scientific,0,'.',''); } $number = 4567; $scientific_number = makeScientificNumber($number); echo "Scientific number is = $scientific_number"; echo PHP_EOL; $normal_number = makeNormalNumber($scientific_number); echo "Normal number is $normal_number";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jpUnV
function name:  (null)
number of ops:  17
compiled vars:  !0 = $number, !1 = $scientific_number, !2 = $normal_number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, 4567
   14     1        INIT_FCALL                                               'makescientificnumber'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                                   !1, $4
   15     5        NOP                                                      
          6        FAST_CONCAT                                      ~6      'Scientific+number+is+%3D+', !1
          7        ECHO                                                     ~6
   17     8        ECHO                                                     '%0A'
   19     9        INIT_FCALL                                               'makenormalnumber'
         10        SEND_VAR                                                 !1
         11        DO_FCALL                                      0  $7      
         12        ASSIGN                                                   !2, $7
   20    13        NOP                                                      
         14        FAST_CONCAT                                      ~9      'Normal+number+is+', !2
         15        ECHO                                                     ~9
         16      > RETURN                                                   1

Function makescientificnumber:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jpUnV
function name:  makeScientificNumber
number of ops:  13
compiled vars:  !0 = $number, !1 = $power
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        MOD                                              ~2      !0, 10
          2        SUB                                              ~3      ~2, 1
          3        ASSIGN                                                   !1, ~3
    5     4        INIT_FCALL                                               'pow'
          5        SEND_VAL                                                 10
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $5      
          8        DIV                                              ~6      !0, $5
          9        CONCAT                                           ~7      ~6, 'e'
         10        CONCAT                                           ~8      ~7, !1
         11      > RETURN                                                   ~8
    6    12*     > RETURN                                                   null

End of function makescientificnumber

Function makenormalnumber:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jpUnV
function name:  makeNormalNumber
number of ops:  9
compiled vars:  !0 = $scientific
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        INIT_FCALL                                               'number_format'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 '.'
          5        SEND_VAL                                                 ''
          6        DO_ICALL                                         $1      
          7      > RETURN                                                   $1
   11     8*     > RETURN                                                   null

End of function makenormalnumber

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.21 ms | 1403 KiB | 19 Q