3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.62 ms | 1396 KiB | 15 Q