3v4l.org

run code in 300+ PHP versions simultaneously
<?php $amount = '10,95'; $cents = explode(',', $amount); if (!isset($cents[0])) $cents[1] = '00'; $cents = implode($cents); echo $cents;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/uEC7G
function name:  (null)
number of ops:  17
compiled vars:  !0 = $amount, !1 = $cents
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '10%2C95'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    5     6        ISSET_ISEMPTY_DIM_OBJ                         0  ~5      !1, 0
          7        BOOL_NOT                                         ~6      ~5
          8      > JMPZ                                                     ~6, ->11
          9    >   ASSIGN_DIM                                               !1, 1
         10        OP_DATA                                                  '00'
    6    11    >   INIT_FCALL                                               'implode'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !1, $8
    7    15        ECHO                                                     !1
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.39 ms | 1394 KiB | 17 Q