3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cep_1 = '04157-000'; $cep_2 = '04157000'; if( !preg_match('/-/',$cep_2) ){ echo substr_replace(cep_2, '-', 5, 0); }else{ echo 'com'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bu5CY
function name:  (null)
number of ops:  19
compiled vars:  !0 = $cep_1, !1 = $cep_2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '04157-000'
    5     1        ASSIGN                                                   !1, '04157000'
    7     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAL                                                 '%2F-%2F'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $4      
          6        BOOL_NOT                                         ~5      $4
          7      > JMPZ                                                     ~5, ->17
    9     8    >   INIT_FCALL                                               'substr_replace'
          9        FETCH_CONSTANT                                   ~6      'cep_2'
         10        SEND_VAL                                                 ~6
         11        SEND_VAL                                                 '-'
         12        SEND_VAL                                                 5
         13        SEND_VAL                                                 0
         14        DO_ICALL                                         $7      
         15        ECHO                                                     $7
         16      > JMP                                                      ->18
   11    17    >   ECHO                                                     'com'
   12    18    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.39 ms | 1399 KiB | 17 Q