3v4l.org

run code in 300+ PHP versions simultaneously
<?php function processMobileNumber($number = '') { // Removing non number chars from the number $cleanNumber = str_replace("(","", $number); $cleanNumber = str_replace(")","", $cleanNumber); $cleanNumber = str_replace("-","", $cleanNumber); $cleanNumber = str_replace(".","", $cleanNumber); $cleanNumber = str_replace(" ","", $cleanNumber); if (is_numeric($cleanNumber)) { //Phone number must start with a 1. if (substr($cleanNumber,0,1)==="1") { $msisdn = $cleanNumber; } else { $msisdn = "1" . $cleanNumber; } } else { $msisdn = 0; } return $msisdn; } echo(processMobileNumber(234));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XBY8v
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'processmobilenumber'
          1        SEND_VAL                                                 234
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function processmobilenumber:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 47
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 44
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XBY8v
function name:  processMobileNumber
number of ops:  50
compiled vars:  !0 = $number, !1 = $cleanNumber, !2 = $msisdn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                        !0      ''
    4     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '%28'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
    5     7        INIT_FCALL                                               'str_replace'
          8        SEND_VAL                                                 '%29'
          9        SEND_VAL                                                 ''
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $5      
         12        ASSIGN                                                   !1, $5
    6    13        INIT_FCALL                                               'str_replace'
         14        SEND_VAL                                                 '-'
         15        SEND_VAL                                                 ''
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $7      
         18        ASSIGN                                                   !1, $7
    7    19        INIT_FCALL                                               'str_replace'
         20        SEND_VAL                                                 '.'
         21        SEND_VAL                                                 ''
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $9      
         24        ASSIGN                                                   !1, $9
    8    25        INIT_FCALL                                               'str_replace'
         26        SEND_VAL                                                 '+'
         27        SEND_VAL                                                 ''
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $11     
         30        ASSIGN                                                   !1, $11
   10    31        INIT_FCALL                                               'is_numeric'
         32        SEND_VAR                                                 !1
         33        DO_ICALL                                         $13     
         34      > JMPZ                                                     $13, ->47
   12    35    >   INIT_FCALL                                               'substr'
         36        SEND_VAR                                                 !1
         37        SEND_VAL                                                 0
         38        SEND_VAL                                                 1
         39        DO_ICALL                                         $14     
         40        IS_IDENTICAL                                             $14, '1'
         41      > JMPZ                                                     ~15, ->44
   13    42    >   ASSIGN                                                   !2, !1
         43      > JMP                                                      ->46
   15    44    >   CONCAT                                           ~17     '1', !1
         45        ASSIGN                                                   !2, ~17
         46    > > JMP                                                      ->48
   18    47    >   ASSIGN                                                   !2, 0
   21    48    > > RETURN                                                   !2
   22    49*     > RETURN                                                   null

End of function processmobilenumber

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.09 ms | 1403 KiB | 20 Q