3v4l.org

run code in 300+ PHP versions simultaneously
<?php $argv[1] = "-00010.1"; if('-'==($_=$argv[1])[0])$s=1||$_[0]=0; echo strlen(explode('.',$t=trim($_=$argv[1],0))[1]).($_!==$t?' '.$s?'-':''.(float)$t:''); exit;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 32
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 32
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 8
filename:       /in/pXY9v
function name:  (null)
number of ops:  37
compiled vars:  !0 = $argv, !1 = $_, !2 = $s, !3 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0, 1
          1        OP_DATA                                                  '-00010.1'
    5     2        FETCH_DIM_R                                      ~5      !0, 1
          3        ASSIGN                                           ~6      !1, ~5
          4        FETCH_DIM_R                                      ~7      ~6, 0
          5        IS_EQUAL                                                 ~7, '-'
          6      > JMPZ                                                     ~8, ->8
          7    >   ASSIGN                                                   !2, <true>
    6     8    >   INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '.'
         10        INIT_FCALL                                               'trim'
         11        FETCH_DIM_R                                      ~10     !0, 1
         12        ASSIGN                                           ~11     !1, ~10
         13        SEND_VAL                                                 ~11
         14        SEND_VAL                                                 0
         15        DO_ICALL                                         $12     
         16        ASSIGN                                           ~13     !3, $12
         17        SEND_VAL                                                 ~13
         18        DO_ICALL                                         $14     
         19        FETCH_DIM_R                                      ~15     $14, 1
         20        STRLEN                                           ~16     ~15
         21        IS_NOT_IDENTICAL                                         !1, !3
         22      > JMPZ                                                     ~17, ->32
         23    >   CONCAT                                           ~18     '+', !2
         24      > JMPZ                                                     ~18, ->27
         25    >   QM_ASSIGN                                        ~19     '-'
         26      > JMP                                                      ->30
         27    >   CAST                                          5  ~20     !3
         28        CONCAT                                           ~21     '', ~20
         29        QM_ASSIGN                                        ~19     ~21
         30    >   QM_ASSIGN                                        ~22     ~19
         31      > JMP                                                      ->33
         32    >   QM_ASSIGN                                        ~22     ''
         33    >   CONCAT                                           ~23     ~16, ~22
         34        ECHO                                                     ~23
    7    35      > EXIT                                                     
         36*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.85 ms | 1400 KiB | 17 Q