3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "1 -4 5 6 -2"; $e = ""; $m = "-"; for($i = 0, $len = strlen($str); $i < $len; $i++) { if($m == $str[$i]) { $e = $m; } else { $e = ""; } if(is_numeric($str[$i])) { $result[] = $e . $str[$i]; } } echo $result;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 7
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 7
Branch analysis from position: 25
Branch analysis from position: 7
Branch analysis from position: 22
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
Branch analysis from position: 22
filename:       /in/MNIG5
function name:  (null)
number of ops:  27
compiled vars:  !0 = $str, !1 = $e, !2 = $m, !3 = $i, !4 = $len, !5 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '1+-4+5+6+-2'
    3     1        ASSIGN                                                   !1, ''
    4     2        ASSIGN                                                   !2, '-'
    5     3        ASSIGN                                                   !3, 0
          4        STRLEN                                           ~10     !0
          5        ASSIGN                                                   !4, ~10
          6      > JMP                                                      ->23
    6     7    >   FETCH_DIM_R                                      ~12     !0, !3
          8        IS_EQUAL                                                 !2, ~12
          9      > JMPZ                                                     ~13, ->12
    7    10    >   ASSIGN                                                   !1, !2
         11      > JMP                                                      ->13
   10    12    >   ASSIGN                                                   !1, ''
   13    13    >   INIT_FCALL                                               'is_numeric'
         14        FETCH_DIM_R                                      ~16     !0, !3
         15        SEND_VAL                                                 ~16
         16        DO_ICALL                                         $17     
         17      > JMPZ                                                     $17, ->22
   14    18    >   FETCH_DIM_R                                      ~19     !0, !3
         19        CONCAT                                           ~20     !1, ~19
         20        ASSIGN_DIM                                               !5
         21        OP_DATA                                                  ~20
    5    22    >   PRE_INC                                                  !3
         23    >   IS_SMALLER                                               !3, !4
         24      > JMPNZ                                                    ~22, ->7
   18    25    >   ECHO                                                     !5
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.13 ms | 1401 KiB | 15 Q