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 = 16
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kKr0r
function name:  (null)
number of ops:  18
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, ->16
    9     8    >   INIT_FCALL                                               'substr_replace'
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 '-'
         11        SEND_VAL                                                 5
         12        SEND_VAL                                                 0
         13        DO_ICALL                                         $6      
         14        ECHO                                                     $6
         15      > JMP                                                      ->17
   11    16    >   ECHO                                                     'com'
   12    17    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.11 ms | 1395 KiB | 17 Q