3v4l.org

run code in 300+ PHP versions simultaneously
<?php $roleRequiredToLogin = 'dev-keboola-gcp-us-central1_APP_LoginKeboola'; $projectRole = 'dev-keboola-gcp-us-central1_APP_Keboola'; $orgRole = 'dev-keboola-gcp-us-central1_APP_OrgKeboola'; $strings = [ $roleRequiredToLogin, $projectRole.'_', $orgRole.'_', ]; if (array_unique($strings) !== $strings) { throw new \InvalidArgumentException('The strings must be unique'); } foreach ($strings as $potentialPrefix) { foreach ($strings as $stringToCompareTo) { if ($potentialPrefix === $stringToCompareTo) { continue; } if (strpos($stringToCompareTo, $potentialPrefix) === 0) { throw new \InvalidArgumentException(sprintf( '"%s" is a prefix of "%s"', $potentialPrefix, $stringToCompareTo )); } } } echo 'Success';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 43
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 43
Branch analysis from position: 20
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 41
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 41
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 25
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 40
Branch analysis from position: 31
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 41
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
filename:       /in/kPXOC
function name:  (null)
number of ops:  46
compiled vars:  !0 = $roleRequiredToLogin, !1 = $projectRole, !2 = $orgRole, !3 = $strings, !4 = $potentialPrefix, !5 = $stringToCompareTo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'dev-keboola-gcp-us-central1_APP_LoginKeboola'
    4     1        ASSIGN                                                   !1, 'dev-keboola-gcp-us-central1_APP_Keboola'
    5     2        ASSIGN                                                   !2, 'dev-keboola-gcp-us-central1_APP_OrgKeboola'
   10     3        INIT_ARRAY                                       ~9      !0
   11     4        CONCAT                                           ~10     !1, '_'
          5        ADD_ARRAY_ELEMENT                                ~9      ~10
   12     6        CONCAT                                           ~11     !2, '_'
          7        ADD_ARRAY_ELEMENT                                ~9      ~11
    9     8        ASSIGN                                                   !3, ~9
   16     9        INIT_FCALL                                               'array_unique'
         10        SEND_VAR                                                 !3
         11        DO_ICALL                                         $13     
         12        IS_NOT_IDENTICAL                                         !3, $13
         13      > JMPZ                                                     ~14, ->18
   17    14    >   NEW                                              $15     'InvalidArgumentException'
         15        SEND_VAL_EX                                              'The+strings+must+be+unique'
         16        DO_FCALL                                      0          
         17      > THROW                                         0          $15
   19    18    > > FE_RESET_R                                       $17     !3, ->43
         19    > > FE_FETCH_R                                               $17, !4, ->43
   20    20    > > FE_RESET_R                                       $18     !3, ->41
         21    > > FE_FETCH_R                                               $18, !5, ->41
   21    22    >   IS_IDENTICAL                                             !4, !5
         23      > JMPZ                                                     ~19, ->25
   22    24    > > JMP                                                      ->21
   24    25    >   INIT_FCALL                                               'strpos'
         26        SEND_VAR                                                 !5
         27        SEND_VAR                                                 !4
         28        DO_ICALL                                         $20     
         29        IS_IDENTICAL                                             $20, 0
         30      > JMPZ                                                     ~21, ->40
   25    31    >   NEW                                              $22     'InvalidArgumentException'
         32        INIT_FCALL                                               'sprintf'
   26    33        SEND_VAL                                                 '%22%25s%22+is+a+prefix+of+%22%25s%22'
   27    34        SEND_VAR                                                 !4
   28    35        SEND_VAR                                                 !5
   25    36        DO_ICALL                                         $23     
   28    37        SEND_VAR_NO_REF_EX                                       $23
   25    38        DO_FCALL                                      0          
   28    39      > THROW                                         0          $22
   20    40    > > JMP                                                      ->21
         41    >   FE_FREE                                                  $18
   19    42      > JMP                                                      ->19
         43    >   FE_FREE                                                  $17
   34    44        ECHO                                                     'Success'
         45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.61 ms | 1017 KiB | 16 Q