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)))).($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 = 30, Position 2 = 37
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 33
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 37
Branch analysis from position: 30
Branch analysis from position: 37
filename:       /in/Z90sW
function name:  (null)
number of ops:  41
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        STRLEN                                           ~17     $16
         28        IS_NOT_IDENTICAL                                         !1, !2
         29      > JMPZ                                                     ~18, ->37
         30    > > JMPZ                                                     !3, ->33
         31    >   QM_ASSIGN                                        ~19     '+-'
         32      > JMP                                                      ->34
         33    >   QM_ASSIGN                                        ~19     '+'
         34    >   CONCAT                                           ~20     ~19, !1
         35        QM_ASSIGN                                        ~21     ~20
         36      > JMP                                                      ->38
         37    >   QM_ASSIGN                                        ~21     ''
         38    >   CONCAT                                           ~22     ~17, ~21
         39        ECHO                                                     ~22
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.23 ms | 1392 KiB | 17 Q