3v4l.org

run code in 300+ PHP versions simultaneously
<?php $argv[1] = '-040.010'; $argv[1] = '-0000100.123400000'; echo strlen((explode('.',$t=trim('-'==($_=$argv[1])[0]?$n=$_=trim($_,'-'):$_,0)))[1]).($t!==$_?($n?' -':' ').$t:'');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 20
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 38
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 38
Branch analysis from position: 31
Branch analysis from position: 38
filename:       /in/1fFHI
function name:  (null)
number of ops:  42
compiled vars:  !0 = $argv, !1 = $t, !2 = $_, !3 = $n
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        INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '.'
          6        INIT_FCALL                                               'trim'
          7        FETCH_DIM_R                                      ~6      !0, 1
          8        ASSIGN                                           ~7      !2, ~6
          9        FETCH_DIM_R                                      ~8      ~7, 0
         10        IS_EQUAL                                                 ~8, '-'
         11      > JMPZ                                                     ~9, ->20
         12    >   INIT_FCALL                                               'trim'
         13        SEND_VAR                                                 !2
         14        SEND_VAL                                                 '-'
         15        DO_ICALL                                         $10     
         16        ASSIGN                                           ~11     !2, $10
         17        ASSIGN                                           ~12     !3, ~11
         18        QM_ASSIGN                                        ~13     ~12
         19      > JMP                                                      ->21
         20    >   QM_ASSIGN                                        ~13     !2
         21    >   SEND_VAL                                                 ~13
         22        SEND_VAL                                                 0
         23        DO_ICALL                                         $14     
         24        ASSIGN                                           ~15     !1, $14
         25        SEND_VAL                                                 ~15
         26        DO_ICALL                                         $16     
         27        FETCH_DIM_R                                      ~17     $16, 1
         28        STRLEN                                           ~18     ~17
         29        IS_NOT_IDENTICAL                                         !1, !2
         30      > JMPZ                                                     ~19, ->38
         31    > > JMPZ                                                     !3, ->34
         32    >   QM_ASSIGN                                        ~20     '+-'
         33      > JMP                                                      ->35
         34    >   QM_ASSIGN                                        ~20     '+'
         35    >   CONCAT                                           ~21     ~20, !1
         36        QM_ASSIGN                                        ~22     ~21
         37      > JMP                                                      ->39
         38    >   QM_ASSIGN                                        ~22     ''
         39    >   CONCAT                                           ~23     ~18, ~22
         40        ECHO                                                     ~23
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.31 ms | 1405 KiB | 17 Q