3v4l.org

run code in 300+ PHP versions simultaneously
<?php $emailDomain = 'subdomain.example.co.uk'; $domainParts = explode('.', $emailDomain); // The TLD will never be in the allow list, so we can pop it off first $domain = array_pop($domainParts); $listToCheck = []; foreach (array_reverse($domainParts) as $domainPart) { $domain = $domainPart .'.'. $domain; $listToCheck[] = $domain; } var_dump($listToCheck);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/qqLet
function name:  (null)
number of ops:  27
compiled vars:  !0 = $emailDomain, !1 = $domainParts, !2 = $domain, !3 = $listToCheck, !4 = $domainPart
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'subdomain.example.co.uk'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '.'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    6     6        INIT_FCALL                                               'array_pop'
          7        SEND_REF                                                 !1
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !2, $8
    7    10        ASSIGN                                                   !3, <array>
    8    11        INIT_FCALL                                               'array_reverse'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $11     
         14      > FE_RESET_R                                       $12     $11, ->22
         15    > > FE_FETCH_R                                               $12, !4, ->22
    9    16    >   CONCAT                                           ~13     !4, '.'
         17        CONCAT                                           ~14     ~13, !2
         18        ASSIGN                                                   !2, ~14
   10    19        ASSIGN_DIM                                               !3
         20        OP_DATA                                                  !2
    8    21      > JMP                                                      ->15
         22    >   FE_FREE                                                  $12
   13    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !3
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.27 ms | 1001 KiB | 17 Q