3v4l.org

run code in 300+ PHP versions simultaneously
<?php $argv[1] = '-040.010'; $argv[1] = '-0000100.123400000'; $_=$argv[1];$t=trim('-'==$_[0]?$n=$_=trim($_,'-'):$_,0); $t=trim('-'==($_=$argv[1])[0]?$n=$_=trim($_,'-'):$_,0); $R = explode('.',$t); echo strlen($R[1]).($t!==$_?($n?' -':' ').$t:'');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 37
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 58
Branch analysis from position: 51
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 54
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 58
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 58
Branch analysis from position: 51
Branch analysis from position: 58
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 37
Branch analysis from position: 29
Branch analysis from position: 37
filename:       /in/knMov
function name:  (null)
number of ops:  62
compiled vars:  !0 = $argv, !1 = $_, !2 = $t, !3 = $n, !4 = $R
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0, 1
          1        OP_DATA                                                  '-040.010'
    4     2        ASSIGN_DIM                                               !0, 1
          3        OP_DATA                                                  '-0000100.123400000'
    6     4        FETCH_DIM_R                                      ~7      !0, 1
          5        ASSIGN                                                   !1, ~7
          6        INIT_FCALL                                               'trim'
          7        FETCH_DIM_R                                      ~9      !1, 0
          8        IS_EQUAL                                                 ~9, '-'
          9      > JMPZ                                                     ~10, ->18
         10    >   INIT_FCALL                                               'trim'
         11        SEND_VAR                                                 !1
         12        SEND_VAL                                                 '-'
         13        DO_ICALL                                         $11     
         14        ASSIGN                                           ~12     !1, $11
         15        ASSIGN                                           ~13     !3, ~12
         16        QM_ASSIGN                                        ~14     ~13
         17      > JMP                                                      ->19
         18    >   QM_ASSIGN                                        ~14     !1
         19    >   SEND_VAL                                                 ~14
         20        SEND_VAL                                                 0
         21        DO_ICALL                                         $15     
         22        ASSIGN                                                   !2, $15
    7    23        INIT_FCALL                                               'trim'
         24        FETCH_DIM_R                                      ~17     !0, 1
         25        ASSIGN                                           ~18     !1, ~17
         26        FETCH_DIM_R                                      ~19     ~18, 0
         27        IS_EQUAL                                                 ~19, '-'
         28      > JMPZ                                                     ~20, ->37
         29    >   INIT_FCALL                                               'trim'
         30        SEND_VAR                                                 !1
         31        SEND_VAL                                                 '-'
         32        DO_ICALL                                         $21     
         33        ASSIGN                                           ~22     !1, $21
         34        ASSIGN                                           ~23     !3, ~22
         35        QM_ASSIGN                                        ~24     ~23
         36      > JMP                                                      ->38
         37    >   QM_ASSIGN                                        ~24     !1
         38    >   SEND_VAL                                                 ~24
         39        SEND_VAL                                                 0
         40        DO_ICALL                                         $25     
         41        ASSIGN                                                   !2, $25
    9    42        INIT_FCALL                                               'explode'
         43        SEND_VAL                                                 '.'
         44        SEND_VAR                                                 !2
         45        DO_ICALL                                         $27     
         46        ASSIGN                                                   !4, $27
   11    47        FETCH_DIM_R                                      ~29     !4, 1
         48        STRLEN                                           ~30     ~29
         49        IS_NOT_IDENTICAL                                         !2, !1
         50      > JMPZ                                                     ~31, ->58
         51    > > JMPZ                                                     !3, ->54
         52    >   QM_ASSIGN                                        ~32     '+-'
         53      > JMP                                                      ->55
         54    >   QM_ASSIGN                                        ~32     '+'
         55    >   CONCAT                                           ~33     ~32, !2
         56        QM_ASSIGN                                        ~34     ~33
         57      > JMP                                                      ->59
         58    >   QM_ASSIGN                                        ~34     ''
         59    >   CONCAT                                           ~35     ~30, ~34
         60        ECHO                                                     ~35
         61      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.4 ms | 1405 KiB | 17 Q