3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mobileNumber = '+33631063771'; $mobileNumber = str_replace(' ', '', $mobileNumber); if (strpos($mobileNumber, '+') !== 0) { if (strpos($mobileNumber, '00') === 0) { $number = substr_replace('00', '+', 0, strlen($mobileNumber)); } elseif (strpos($mobileNumber, '0') === 0 || strpos($mobileNumber, '6') === 0 || strpos($mobileNumber, '7') === 0) { if (strpos($mobileNumber, '0') === 0) { $number = substr($mobileNumber, 1); } $number = '+33' . $number; } } echo $number;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 61
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 28
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 47) Position 1 = 34, Position 2 = 40
Branch analysis from position: 34
2 jumps found. (Code = 47) Position 1 = 41, Position 2 = 47
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 61
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 59
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
Branch analysis from position: 61
Branch analysis from position: 47
Branch analysis from position: 40
Branch analysis from position: 61
filename:       /in/5kFaH
function name:  (null)
number of ops:  63
compiled vars:  !0 = $mobileNumber, !1 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%2B33631063771'
    4     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '+'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !0, $3
    5     7        INIT_FCALL                                               'strpos'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 '%2B'
         10        DO_ICALL                                         $5      
         11        IS_NOT_IDENTICAL                                         $5, 0
         12      > JMPZ                                                     ~6, ->61
    6    13    >   INIT_FCALL                                               'strpos'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 '00'
         16        DO_ICALL                                         $7      
         17        IS_IDENTICAL                                             $7, 0
         18      > JMPZ                                                     ~8, ->28
    7    19    >   INIT_FCALL                                               'substr_replace'
         20        SEND_VAL                                                 '00'
         21        SEND_VAL                                                 '%2B'
         22        SEND_VAL                                                 0
         23        STRLEN                                           ~9      !0
         24        SEND_VAL                                                 ~9
         25        DO_ICALL                                         $10     
         26        ASSIGN                                                   !1, $10
         27      > JMP                                                      ->61
    8    28    >   INIT_FCALL                                               'strpos'
         29        SEND_VAR                                                 !0
         30        SEND_VAL                                                 '0'
         31        DO_ICALL                                         $12     
         32        IS_IDENTICAL                                     ~13     $12, 0
         33      > JMPNZ_EX                                         ~13     ~13, ->40
         34    >   INIT_FCALL                                               'strpos'
         35        SEND_VAR                                                 !0
         36        SEND_VAL                                                 '6'
         37        DO_ICALL                                         $14     
         38        IS_IDENTICAL                                     ~15     $14, 0
         39        BOOL                                             ~13     ~15
         40    > > JMPNZ_EX                                         ~13     ~13, ->47
         41    >   INIT_FCALL                                               'strpos'
         42        SEND_VAR                                                 !0
         43        SEND_VAL                                                 '7'
         44        DO_ICALL                                         $16     
         45        IS_IDENTICAL                                     ~17     $16, 0
         46        BOOL                                             ~13     ~17
         47    > > JMPZ                                                     ~13, ->61
    9    48    >   INIT_FCALL                                               'strpos'
         49        SEND_VAR                                                 !0
         50        SEND_VAL                                                 '0'
         51        DO_ICALL                                         $18     
         52        IS_IDENTICAL                                             $18, 0
         53      > JMPZ                                                     ~19, ->59
   10    54    >   INIT_FCALL                                               'substr'
         55        SEND_VAR                                                 !0
         56        SEND_VAL                                                 1
         57        DO_ICALL                                         $20     
         58        ASSIGN                                                   !1, $20
   13    59    >   CONCAT                                           ~22     '%2B33', !1
         60        ASSIGN                                                   !1, ~22
   17    61    >   ECHO                                                     !1
         62      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.05 ms | 1404 KiB | 21 Q