3v4l.org

run code in 300+ PHP versions simultaneously
<?php $phonenumber = '+31 (0)612345678'; $phonenumber = str_replace([' ', '-', '.', '(', ')'], '', $phonenumber); if (strpos($phonenumber, '+3106') === 0) { $phonenumber = '+316' . substr($phonenumber, 5); } echo $phonenumber;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/nbSB7
function name:  (null)
number of ops:  21
compiled vars:  !0 = $phonenumber
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%2B31+%280%29612345678'
    3     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 <array>
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !0, $2
    4     7        INIT_FCALL                                               'strpos'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 '%2B3106'
         10        DO_ICALL                                         $4      
         11        IS_IDENTICAL                                             $4, 0
         12      > JMPZ                                                     ~5, ->19
    5    13    >   INIT_FCALL                                               'substr'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 5
         16        DO_ICALL                                         $6      
         17        CONCAT                                           ~7      '%2B316', $6
         18        ASSIGN                                                   !0, ~7
    8    19    >   ECHO                                                     !0
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.91 ms | 1395 KiB | 19 Q