3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mobileNumber = '0631063771'; $countryCode = '49'; $mobileNumber = str_replace(' ', '', $mobileNumber); if (strpos($mobileNumber, '+') === false) { if (strpos($mobileNumber, '00') === 0) { $mobileNumber = substr($mobileNumber, 2); } elseif (strpos($mobileNumber, '0') === 0 || strpos($mobileNumber, '6') === 0 || strpos($mobileNumber, '7') === 0) { if (strpos($mobileNumber, '0') === 0) { $mobileNumber = substr($mobileNumber, 1); } $mobileNumber = $countryCode . $mobileNumber; } } else { $mobileNumber = substr($mobileNumber, 1); } if (strpos($mobileNumber, '0') === 2) { $arrayNumber = explode('0', $mobileNumber, 2); $mobileNumber = implode($arrayNumber); } echo $mobileNumber;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 60
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 26
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
2 jumps found. (Code = 43) Position 1 = 71, Position 2 = 81
Branch analysis from position: 71
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 81
Branch analysis from position: 26
2 jumps found. (Code = 47) Position 1 = 32, Position 2 = 38
Branch analysis from position: 32
2 jumps found. (Code = 47) Position 1 = 39, Position 2 = 45
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 59
Branch analysis from position: 46
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 57
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
Branch analysis from position: 57
Branch analysis from position: 59
Branch analysis from position: 45
Branch analysis from position: 38
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 71, Position 2 = 81
Branch analysis from position: 71
Branch analysis from position: 81
filename:       /in/0NtjW
function name:  (null)
number of ops:  83
compiled vars:  !0 = $mobileNumber, !1 = $countryCode, !2 = $arrayNumber
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '0631063771'
    3     1        ASSIGN                                                   !1, '49'
    5     2        INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 '+'
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !0, $5
    7     8        INIT_FCALL                                               'strpos'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 '%2B'
         11        DO_ICALL                                         $7      
         12        TYPE_CHECK                                    4          $7
         13      > JMPZ                                                     ~8, ->60
    8    14    >   INIT_FCALL                                               'strpos'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 '00'
         17        DO_ICALL                                         $9      
         18        IS_IDENTICAL                                             $9, 0
         19      > JMPZ                                                     ~10, ->26
    9    20    >   INIT_FCALL                                               'substr'
         21        SEND_VAR                                                 !0
         22        SEND_VAL                                                 2
         23        DO_ICALL                                         $11     
         24        ASSIGN                                                   !0, $11
         25      > JMP                                                      ->59
   11    26    >   INIT_FCALL                                               'strpos'
         27        SEND_VAR                                                 !0
         28        SEND_VAL                                                 '0'
         29        DO_ICALL                                         $13     
         30        IS_IDENTICAL                                     ~14     $13, 0
         31      > JMPNZ_EX                                         ~14     ~14, ->38
         32    >   INIT_FCALL                                               'strpos'
         33        SEND_VAR                                                 !0
         34        SEND_VAL                                                 '6'
         35        DO_ICALL                                         $15     
         36        IS_IDENTICAL                                     ~16     $15, 0
         37        BOOL                                             ~14     ~16
         38    > > JMPNZ_EX                                         ~14     ~14, ->45
         39    >   INIT_FCALL                                               'strpos'
         40        SEND_VAR                                                 !0
         41        SEND_VAL                                                 '7'
         42        DO_ICALL                                         $17     
         43        IS_IDENTICAL                                     ~18     $17, 0
         44        BOOL                                             ~14     ~18
         45    > > JMPZ                                                     ~14, ->59
   12    46    >   INIT_FCALL                                               'strpos'
         47        SEND_VAR                                                 !0
         48        SEND_VAL                                                 '0'
         49        DO_ICALL                                         $19     
         50        IS_IDENTICAL                                             $19, 0
         51      > JMPZ                                                     ~20, ->57
   13    52    >   INIT_FCALL                                               'substr'
         53        SEND_VAR                                                 !0
         54        SEND_VAL                                                 1
         55        DO_ICALL                                         $21     
         56        ASSIGN                                                   !0, $21
   16    57    >   CONCAT                                           ~23     !1, !0
         58        ASSIGN                                                   !0, ~23
         59    > > JMP                                                      ->65
   19    60    >   INIT_FCALL                                               'substr'
         61        SEND_VAR                                                 !0
         62        SEND_VAL                                                 1
         63        DO_ICALL                                         $25     
         64        ASSIGN                                                   !0, $25
   22    65    >   INIT_FCALL                                               'strpos'
         66        SEND_VAR                                                 !0
         67        SEND_VAL                                                 '0'
         68        DO_ICALL                                         $27     
         69        IS_IDENTICAL                                             $27, 2
         70      > JMPZ                                                     ~28, ->81
   23    71    >   INIT_FCALL                                               'explode'
         72        SEND_VAL                                                 '0'
         73        SEND_VAR                                                 !0
         74        SEND_VAL                                                 2
         75        DO_ICALL                                         $29     
         76        ASSIGN                                                   !2, $29
   24    77        INIT_FCALL                                               'implode'
         78        SEND_VAR                                                 !2
         79        DO_ICALL                                         $31     
         80        ASSIGN                                                   !0, $31
   27    81    >   ECHO                                                     !0
         82      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.86 ms | 1404 KiB | 23 Q