3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = 10000.00; if (strpos((string)$number, '.') !== false) { list($number, $fraction) = explode('.', $number); if(empty($fraction)){ $fraction = "00"; } } echo $fraction; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 20
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 20
filename:       /in/CeG7M
function name:  (null)
number of ops:  22
compiled vars:  !0 = $number, !1 = $fraction
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 10000
    5     1        INIT_FCALL                                               'strpos'
          2        CAST                                          6  ~3      !0
          3        SEND_VAL                                                 ~3
          4        SEND_VAL                                                 '.'
          5        DO_ICALL                                         $4      
          6        TYPE_CHECK                                  1018          $4
          7      > JMPZ                                                     ~5, ->20
    6     8    >   INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '.'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $6      
         12        FETCH_LIST_R                                     $7      $6, 0
         13        ASSIGN                                                   !0, $7
         14        FETCH_LIST_R                                     $9      $6, 1
         15        ASSIGN                                                   !1, $9
         16        FREE                                                     $6
    7    17        ISSET_ISEMPTY_CV                                         !1
         18      > JMPZ                                                     ~11, ->20
    8    19    >   ASSIGN                                                   !1, '00'
   12    20    >   ECHO                                                     !1
   14    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.65 ms | 1386 KiB | 17 Q