3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Created by PhpStorm. * User: Martin Jirásek <martin.jirasek@nms.cz> * Date: 31.03.2017 * Time: 12:41 */ class PhoneNumberValidator { const PREFIX_SYMBOL_ZEROS = '00'; const PREFIX_SYMBOL_PLUS = '+'; private static $prefixSymbols = [ self::PREFIX_SYMBOL_ZEROS, self::PREFIX_SYMBOL_PLUS, ]; /** * @return array */ public static function internationalPrefixNumbers() { return [ '420', // cz '421', // sk ]; } /** * @param $phoneNumber * @return string */ public static function getPhoneNumberBase($phoneNumber) { return substr($phoneNumber, 0, -9); } /** * @param $phoneNumber * @return array|bool */ public static function getRecognizedCountryPrefixes($phoneNumber) { $prefixes = []; $prefixPart = self::getPhoneNumberBase($phoneNumber); $internationalPrefixNumbers = self::internationalPrefixNumbers(); if (strlen($prefixPart) <= min(array_map('strlen', $internationalPrefixNumbers))) { return false; } foreach ($internationalPrefixNumbers as $prefix) { if (!$prefixPart || strpos($prefixPart, $prefix) !== false) { foreach (self::$prefixSymbols as $prefixType) { $prefixes[] = $prefixType . $prefix; } } } return $prefixes; } /** * @param $phoneNumber * @return array|bool */ public static function getPhoneNumberInAllPossibleForms($phoneNumber) { $prefixes = self::getRecognizedCountryPrefixes($phoneNumber); if ($prefixes === false) { return false; } $forms = []; foreach ($prefixes as $prefix) { $forms[] = $prefix . self::getPhoneNumberBase($phoneNumber); } return $forms; } /** * @param $phoneNumber * @return bool|string */ public static function convertToRightForm($phoneNumber) { $forms = self::getPhoneNumberInAllPossibleForms($phoneNumber); if ($forms === false) { return false; } foreach ($forms as $form) { if (substr($form, 0, strlen(self::PREFIX_SYMBOL_PLUS)) === self::PREFIX_SYMBOL_PLUS) { return $form; } } return false; } /** * @param $phoneNumber * @return bool */ public static function isValid($phoneNumber) { if (!$phoneNumber) { return false; } $recognizedCountryPrefixes = self::getRecognizedCountryPrefixes($phoneNumber); if ($recognizedCountryPrefixes === false) { return false; } $regexPrefixes = array_map(function ($value) { return strpos($value, '+') !== false ? "\\$value" : $value; // escape for regex }, $recognizedCountryPrefixes); return (bool) preg_match('~^(' . implode('|', $regexPrefixes) . ')' /*. '?' */. '[0-9]{9}$~', $phoneNumber); } } var_dump('getPhoneNumberBase'); var_dump(PhoneNumberValidator::getPhoneNumberBase("608171262")); var_dump(PhoneNumberValidator::getPhoneNumberBase("0608171262")); var_dump(PhoneNumberValidator::getPhoneNumberBase("421608171262")); var_dump(PhoneNumberValidator::getPhoneNumberBase("+421608171262")); var_dump(PhoneNumberValidator::getPhoneNumberBase("00421608171262")); var_dump(PhoneNumberValidator::getPhoneNumberBase("+420608171262")); var_dump(PhoneNumberValidator::getPhoneNumberBase("00420608171262")); var_dump('isValid'); var_dump(PhoneNumberValidator::isValid("608171262")); var_dump(PhoneNumberValidator::isValid("0608171262")); var_dump(PhoneNumberValidator::isValid("420608171262")); var_dump(PhoneNumberValidator::isValid("+421608171262")); var_dump(PhoneNumberValidator::isValid("00421608171262")); var_dump(PhoneNumberValidator::isValid("+420608171262")); var_dump(PhoneNumberValidator::isValid("00420608171262")); var_dump('getRecognizedCountryPrefixes'); var_dump(PhoneNumberValidator::getRecognizedCountryPrefixes("608171262")); var_dump(PhoneNumberValidator::getRecognizedCountryPrefixes("0608171262")); var_dump(PhoneNumberValidator::getRecognizedCountryPrefixes("420608171262")); var_dump(PhoneNumberValidator::getRecognizedCountryPrefixes("+421608171262")); var_dump(PhoneNumberValidator::getRecognizedCountryPrefixes("00421608171262")); var_dump(PhoneNumberValidator::getRecognizedCountryPrefixes("+420608171262")); var_dump(PhoneNumberValidator::getRecognizedCountryPrefixes("00420608171262")); var_dump('getPhoneNumberInAllPossibleForms'); var_dump(PhoneNumberValidator::getPhoneNumberInAllPossibleForms("608171262")); var_dump(PhoneNumberValidator::getPhoneNumberInAllPossibleForms("0608171262")); var_dump(PhoneNumberValidator::getPhoneNumberInAllPossibleForms("420608171262")); var_dump(PhoneNumberValidator::getPhoneNumberInAllPossibleForms("+421608171262")); var_dump(PhoneNumberValidator::getPhoneNumberInAllPossibleForms("00421608171262")); var_dump(PhoneNumberValidator::getPhoneNumberInAllPossibleForms("+420608171262")); var_dump(PhoneNumberValidator::getPhoneNumberInAllPossibleForms("00420608171262")); var_dump('convertToRightForm'); var_dump(PhoneNumberValidator::convertToRightForm("608171262")); var_dump(PhoneNumberValidator::convertToRightForm("0608171262")); var_dump(PhoneNumberValidator::convertToRightForm("420608171262")); var_dump(PhoneNumberValidator::convertToRightForm("+421608171262")); var_dump(PhoneNumberValidator::convertToRightForm("00421608171262")); var_dump(PhoneNumberValidator::convertToRightForm("+420608171262")); var_dump(PhoneNumberValidator::convertToRightForm("00420608171262"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XtKFU
function name:  (null)
number of ops:  226
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  120     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'getPhoneNumberBase'
          2        DO_ICALL                                                 
  121     3        INIT_FCALL                                               'var_dump'
          4        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getPhoneNumberBase'
          5        SEND_VAL                                                 '608171262'
          6        DO_FCALL                                      0  $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                                 
  122     9        INIT_FCALL                                               'var_dump'
         10        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getPhoneNumberBase'
         11        SEND_VAL                                                 '0608171262'
         12        DO_FCALL                                      0  $3      
         13        SEND_VAR                                                 $3
         14        DO_ICALL                                                 
  123    15        INIT_FCALL                                               'var_dump'
         16        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getPhoneNumberBase'
         17        SEND_VAL                                                 '421608171262'
         18        DO_FCALL                                      0  $5      
         19        SEND_VAR                                                 $5
         20        DO_ICALL                                                 
  124    21        INIT_FCALL                                               'var_dump'
         22        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getPhoneNumberBase'
         23        SEND_VAL                                                 '%2B421608171262'
         24        DO_FCALL                                      0  $7      
         25        SEND_VAR                                                 $7
         26        DO_ICALL                                                 
  125    27        INIT_FCALL                                               'var_dump'
         28        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getPhoneNumberBase'
         29        SEND_VAL                                                 '00421608171262'
         30        DO_FCALL                                      0  $9      
         31        SEND_VAR                                                 $9
         32        DO_ICALL                                                 
  126    33        INIT_FCALL                                               'var_dump'
         34        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getPhoneNumberBase'
         35        SEND_VAL                                                 '%2B420608171262'
         36        DO_FCALL                                      0  $11     
         37        SEND_VAR                                                 $11
         38        DO_ICALL                                                 
  127    39        INIT_FCALL                                               'var_dump'
         40        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getPhoneNumberBase'
         41        SEND_VAL                                                 '00420608171262'
         42        DO_FCALL                                      0  $13     
         43        SEND_VAR                                                 $13
         44        DO_ICALL                                                 
  128    45        INIT_FCALL                                               'var_dump'
         46        SEND_VAL                                                 'isValid'
         47        DO_ICALL                                                 
  129    48        INIT_FCALL                                               'var_dump'
         49        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'isValid'
         50        SEND_VAL                                                 '608171262'
         51        DO_FCALL                                      0  $16     
         52        SEND_VAR                                                 $16
         53        DO_ICALL                                                 
  130    54        INIT_FCALL                                               'var_dump'
         55        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'isValid'
         56        SEND_VAL                                                 '0608171262'
         57        DO_FCALL                                      0  $18     
         58        SEND_VAR                                                 $18
         59        DO_ICALL                                                 
  131    60        INIT_FCALL                                               'var_dump'
         61        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'isValid'
         62        SEND_VAL                                                 '420608171262'
         63        DO_FCALL                                      0  $20     
         64        SEND_VAR                                                 $20
         65        DO_ICALL                                                 
  132    66        INIT_FCALL                                               'var_dump'
         67        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'isValid'
         68        SEND_VAL                                                 '%2B421608171262'
         69        DO_FCALL                                      0  $22     
         70        SEND_VAR                                                 $22
         71        DO_ICALL                                                 
  133    72        INIT_FCALL                                               'var_dump'
         73        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'isValid'
         74        SEND_VAL                                                 '00421608171262'
         75        DO_FCALL                                      0  $24     
         76        SEND_VAR                                                 $24
         77        DO_ICALL                                                 
  134    78        INIT_FCALL                                               'var_dump'
         79        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'isValid'
         80        SEND_VAL                                                 '%2B420608171262'
         81        DO_FCALL                                      0  $26     
         82        SEND_VAR                                                 $26
         83        DO_ICALL                                                 
  135    84        INIT_FCALL                                               'var_dump'
         85        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'isValid'
         86        SEND_VAL                                                 '00420608171262'
         87        DO_FCALL                                      0  $28     
         88        SEND_VAR                                                 $28
         89        DO_ICALL                                                 
  136    90        INIT_FCALL                                               'var_dump'
         91        SEND_VAL                                                 'getRecognizedCountryPrefixes'
         92        DO_ICALL                                                 
  137    93        INIT_FCALL                                               'var_dump'
         94        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getRecognizedCountryPrefixes'
         95        SEND_VAL                                                 '608171262'
         96        DO_FCALL                                      0  $31     
         97        SEND_VAR                                                 $31
         98        DO_ICALL                                                 
  138    99        INIT_FCALL                                               'var_dump'
        100        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getRecognizedCountryPrefixes'
        101        SEND_VAL                                                 '0608171262'
        102        DO_FCALL                                      0  $33     
        103        SEND_VAR                                                 $33
        104        DO_ICALL                                                 
  139   105        INIT_FCALL                                               'var_dump'
        106        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getRecognizedCountryPrefixes'
        107        SEND_VAL                                                 '420608171262'
        108        DO_FCALL                                      0  $35     
        109        SEND_VAR                                                 $35
        110        DO_ICALL                                                 
  140   111        INIT_FCALL                                               'var_dump'
        112        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getRecognizedCountryPrefixes'
        113        SEND_VAL                                                 '%2B421608171262'
        114        DO_FCALL                                      0  $37     
        115        SEND_VAR                                                 $37
        116        DO_ICALL                                                 
  141   117        INIT_FCALL                                               'var_dump'
        118        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getRecognizedCountryPrefixes'
        119        SEND_VAL                                                 '00421608171262'
        120        DO_FCALL                                      0  $39     
        121        SEND_VAR                                                 $39
        122        DO_ICALL                                                 
  142   123        INIT_FCALL                                               'var_dump'
        124        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getRecognizedCountryPrefixes'
        125        SEND_VAL                                                 '%2B420608171262'
        126        DO_FCALL                                      0  $41     
        127        SEND_VAR                                                 $41
        128        DO_ICALL                                                 
  143   129        INIT_FCALL                                               'var_dump'
        130        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getRecognizedCountryPrefixes'
        131        SEND_VAL                                                 '00420608171262'
        132        DO_FCALL                                      0  $43     
        133        SEND_VAR                                                 $43
        134        DO_ICALL                                                 
  144   135        INIT_FCALL                                               'var_dump'
        136        SEND_VAL                                                 'getPhoneNumberInAllPossibleForms'
        137        DO_ICALL                                                 
  145   138        INIT_FCALL                                               'var_dump'
        139        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getPhoneNumberInAllPossibleForms'
        140        SEND_VAL                                                 '608171262'
        141        DO_FCALL                                      0  $46     
        142        SEND_VAR                                                 $46
        143        DO_ICALL                                                 
  146   144        INIT_FCALL                                               'var_dump'
        145        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getPhoneNumberInAllPossibleForms'
        146        SEND_VAL                                                 '0608171262'
        147        DO_FCALL                                      0  $48     
        148        SEND_VAR                                                 $48
        149        DO_ICALL                                                 
  147   150        INIT_FCALL                                               'var_dump'
        151        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getPhoneNumberInAllPossibleForms'
        152        SEND_VAL                                                 '420608171262'
        153        DO_FCALL                                      0  $50     
        154        SEND_VAR                                                 $50
        155        DO_ICALL                                                 
  148   156        INIT_FCALL                                               'var_dump'
        157        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getPhoneNumberInAllPossibleForms'
        158        SEND_VAL                                                 '%2B421608171262'
        159        DO_FCALL                                      0  $52     
        160        SEND_VAR                                                 $52
        161        DO_ICALL                                                 
  149   162        INIT_FCALL                                               'var_dump'
        163        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getPhoneNumberInAllPossibleForms'
        164        SEND_VAL                                                 '00421608171262'
        165        DO_FCALL                                      0  $54     
        166        SEND_VAR                                                 $54
        167        DO_ICALL                                                 
  150   168        INIT_FCALL                                               'var_dump'
        169        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getPhoneNumberInAllPossibleForms'
        170        SEND_VAL                                                 '%2B420608171262'
        171        DO_FCALL                                      0  $56     
        172        SEND_VAR                                                 $56
        173        DO_ICALL                                                 
  151   174        INIT_FCALL                                               'var_dump'
        175        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'getPhoneNumberInAllPossibleForms'
        176        SEND_VAL                                                 '00420608171262'
        177        DO_FCALL                                      0  $58     
        178        SEND_VAR                                                 $58
        179        DO_ICALL                                                 
  152   180        INIT_FCALL                                               'var_dump'
        181        SEND_VAL                                                 'convertToRightForm'
        182        DO_ICALL                                                 
  153   183        INIT_FCALL                                               'var_dump'
        184        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'convertToRightForm'
        185        SEND_VAL                                                 '608171262'
        186        DO_FCALL                                      0  $61     
        187        SEND_VAR                                                 $61
        188        DO_ICALL                                                 
  154   189        INIT_FCALL                                               'var_dump'
        190        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'convertToRightForm'
        191        SEND_VAL                                                 '0608171262'
        192        DO_FCALL                                      0  $63     
        193        SEND_VAR                                                 $63
        194        DO_ICALL                                                 
  155   195        INIT_FCALL                                               'var_dump'
        196        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'convertToRightForm'
        197        SEND_VAL                                                 '420608171262'
        198        DO_FCALL                                      0  $65     
        199        SEND_VAR                                                 $65
        200        DO_ICALL                                                 
  156   201        INIT_FCALL                                               'var_dump'
        202        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'convertToRightForm'
        203        SEND_VAL                                                 '%2B421608171262'
        204        DO_FCALL                                      0  $67     
        205        SEND_VAR                                                 $67
        206        DO_ICALL                                                 
  157   207        INIT_FCALL                                               'var_dump'
        208        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'convertToRightForm'
        209        SEND_VAL                                                 '00421608171262'
        210        DO_FCALL                                      0  $69     
        211        SEND_VAR                                                 $69
        212        DO_ICALL                                                 
  158   213        INIT_FCALL                                               'var_dump'
        214        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'convertToRightForm'
        215        SEND_VAL                                                 '%2B420608171262'
        216        DO_FCALL                                      0  $71     
        217        SEND_VAR                                                 $71
        218        DO_ICALL                                                 
  159   219        INIT_FCALL                                               'var_dump'
        220        INIT_STATIC_METHOD_CALL                                  'PhoneNumberValidator', 'convertToRightForm'
        221        SEND_VAL                                                 '00420608171262'
        222        DO_FCALL                                      0  $73     
        223        SEND_VAR                                                 $73
        224        DO_ICALL                                                 
        225      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FXtKFU%3A113%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XtKFU
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  113     0  E >   RECV                                             !0      
  114     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%2B'
          4        DO_ICALL                                         $1      
          5        TYPE_CHECK                                  1018          $1
          6      > JMPZ                                                     ~2, ->11
          7    >   NOP                                                      
          8        FAST_CONCAT                                      ~3      '%5C', !0
          9        QM_ASSIGN                                        ~4      ~3
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~4      !0
         12    > > RETURN                                                   ~4
  115    13*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FXtKFU%3A113%240

Class PhoneNumberValidator:
Function internationalprefixnumbers:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XtKFU
function name:  internationalPrefixNumbers
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E > > RETURN                                                   <array>
   29     1*     > RETURN                                                   null

End of function internationalprefixnumbers

Function getphonenumberbase:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XtKFU
function name:  getPhoneNumberBase
number of ops:  8
compiled vars:  !0 = $phoneNumber
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
   37     1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 -9
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
   38     7*     > RETURN                                                   null

End of function getphonenumberbase

Function getrecognizedcountryprefixes:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 40
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 40
Branch analysis from position: 22
2 jumps found. (Code = 47) Position 1 = 24, Position 2 = 30
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 39
Branch analysis from position: 31
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 38
Branch analysis from position: 33
2 jumps found. (Code = 78) Position 1 = 34, Position 2 = 38
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 38
Branch analysis from position: 39
Branch analysis from position: 30
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/XtKFU
function name:  getRecognizedCountryPrefixes
number of ops:  43
compiled vars:  !0 = $phoneNumber, !1 = $prefixes, !2 = $prefixPart, !3 = $internationalPrefixNumbers, !4 = $prefix, !5 = $prefixType
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   RECV                                             !0      
   46     1        ASSIGN                                                   !1, <array>
   47     2        INIT_STATIC_METHOD_CALL                                  'getPhoneNumberBase'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $7      
          5        ASSIGN                                                   !2, $7
   48     6        INIT_STATIC_METHOD_CALL                                  'internationalPrefixNumbers'
          7        DO_FCALL                                      0  $9      
          8        ASSIGN                                                   !3, $9
   49     9        STRLEN                                           ~11     !2
         10        INIT_FCALL                                               'min'
         11        INIT_FCALL                                               'array_map'
         12        SEND_VAL                                                 'strlen'
         13        SEND_VAR                                                 !3
         14        DO_ICALL                                         $12     
         15        SEND_VAR                                                 $12
         16        DO_ICALL                                         $13     
         17        IS_SMALLER_OR_EQUAL                                      ~11, $13
         18      > JMPZ                                                     ~14, ->20
   50    19    > > RETURN                                                   <false>
   52    20    > > FE_RESET_R                                       $15     !3, ->40
         21    > > FE_FETCH_R                                               $15, !4, ->40
   53    22    >   BOOL_NOT                                         ~16     !2
         23      > JMPNZ_EX                                         ~16     ~16, ->30
         24    >   INIT_FCALL                                               'strpos'
         25        SEND_VAR                                                 !2
         26        SEND_VAR                                                 !4
         27        DO_ICALL                                         $17     
         28        TYPE_CHECK                                  1018  ~18     $17
         29        BOOL                                             ~16     ~18
         30    > > JMPZ                                                     ~16, ->39
   54    31    >   FETCH_STATIC_PROP_R          unknown             ~19     'prefixSymbols'
         32      > FE_RESET_R                                       $20     ~19, ->38
         33    > > FE_FETCH_R                                               $20, !5, ->38
   55    34    >   CONCAT                                           ~22     !5, !4
         35        ASSIGN_DIM                                               !1
         36        OP_DATA                                                  ~22
   54    37      > JMP                                                      ->33
         38    >   FE_FREE                                                  $20
   52    39    > > JMP                                                      ->21
         40    >   FE_FREE                                                  $15
   59    41      > RETURN                                                   !1
   60    42*     > RETURN                                                   null

End of function getrecognizedcountryprefixes

Function getphonenumberinallpossibleforms:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/XtKFU
function name:  getPhoneNumberInAllPossibleForms
number of ops:  21
compiled vars:  !0 = $phoneNumber, !1 = $prefixes, !2 = $forms, !3 = $prefix
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   66     0  E >   RECV                                             !0      
   68     1        INIT_STATIC_METHOD_CALL                                  'getRecognizedCountryPrefixes'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                                   !1, $4
   69     5        TYPE_CHECK                                    4          !1
          6      > JMPZ                                                     ~6, ->8
   70     7    > > RETURN                                                   <false>
   73     8    >   ASSIGN                                                   !2, <array>
   74     9      > FE_RESET_R                                       $8      !1, ->18
         10    > > FE_FETCH_R                                               $8, !3, ->18
   75    11    >   INIT_STATIC_METHOD_CALL                                  'getPhoneNumberBase'
         12        SEND_VAR                                                 !0
         13        DO_FCALL                                      0  $10     
         14        CONCAT                                           ~11     !3, $10
         15        ASSIGN_DIM                                               !2
         16        OP_DATA                                                  ~11
   74    17      > JMP                                                      ->10
         18    >   FE_FREE                                                  $8
   77    19      > RETURN                                                   !2
   78    20*     > RETURN                                                   null

End of function getphonenumberinallpossibleforms

Function converttorightform:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position:

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.65 ms | 1420 KiB | 23 Q