3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_last_dot_occurence ($url ) { $fullArray = explode('.', $url); $newArray = ""; switch (count($fullArray)) { case 1: $newArray = $url; break; case 2: $newArray = array("string1" => $fullArray[0], "string2" => $fullArray[1]); break; default: break; } return $newArray; } print_r(get_last_dot_occurence("test.com"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uWbXk
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'get_last_dot_occurence'
          2        SEND_VAL                                                 'test.com'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function get_last_dot_occurence:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
filename:       /in/uWbXk
function name:  get_last_dot_occurence
number of ops:  25
compiled vars:  !0 = $url, !1 = $fullArray, !2 = $newArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '.'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    4     6        ASSIGN                                                   !2, ''
    5     7        COUNT                                            ~6      !1
    6     8        CASE                                                     ~6, 1
          9      > JMPNZ                                                    ~7, ->13
   10    10    >   CASE                                                     ~6, 2
         11      > JMPNZ                                                    ~7, ->15
         12    > > JMP                                                      ->21
    7    13    >   ASSIGN                                                   !2, !0
    8    14      > JMP                                                      ->22
   11    15    >   FETCH_DIM_R                                      ~9      !1, 0
         16        INIT_ARRAY                                       ~10     ~9, 'string1'
         17        FETCH_DIM_R                                      ~11     !1, 1
         18        ADD_ARRAY_ELEMENT                                ~10     ~11, 'string2'
         19        ASSIGN                                                   !2, ~10
   12    20      > JMP                                                      ->22
   15    21    > > JMP                                                      ->22
         22    >   FREE                                                     ~6
   17    23      > RETURN                                                   !2
   18    24*     > RETURN                                                   null

End of function get_last_dot_occurence

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.37 ms | 1403 KiB | 18 Q