3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum AgeRangeType { case UNSPECIFIED; // Not specified. case UNKNOWN; // Used for return value only. Represents value unknown in this version. case AGE_RANGE_18_24; // Between 18 and 24 years old. case AGE_RANGE_25_34; // Between 25 and 34 years old. case AGE_RANGE_35_44; // Between 35 and 44 years old. case AGE_RANGE_45_54; // Between 45 and 54 years old. case AGE_RANGE_55_64; // Between 55 and 64 years old. case AGE_RANGE_65_UP; // 65 years old and beyond. case AGE_RANGE_UNDETERMINED; // Undetermined age range. } $ageRanges = [ AgeRangeType::AGE_RANGE_18_24->name => ['min' => 18, 'max' => 24], AgeRangeType::AGE_RANGE_25_34->name => ['min' => 25, 'max' => 34], AgeRangeType::AGE_RANGE_35_44->name => ['min' => 35, 'max' => 44], AgeRangeType::AGE_RANGE_45_54->name => ['min' => 45, 'max' => 54], AgeRangeType::AGE_RANGE_55_64->name => ['min' => 55, 'max' => 64], AgeRangeType::AGE_RANGE_65_UP->name => ['min' => 65, 'max' => 135] ]; $min_age = 20; $max_age = 60; $result = []; foreach ($ageRanges as $enum => ['min' => $min, 'max' => $max]) { if ($max >= $min_age && $min <= $max_age) { $result[] = $enum; } elseif ($result) { break; } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 42
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 42
Branch analysis from position: 25
2 jumps found. (Code = 46) Position 1 = 33, Position 2 = 35
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 39
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 41
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
Branch analysis from position: 35
Branch analysis from position: 42
Branch analysis from position: 42
filename:       /in/ZjG9a
function name:  (null)
number of ops:  47
compiled vars:  !0 = $ageRanges, !1 = $min_age, !2 = $max_age, !3 = $result, !4 = $min, !5 = $max, !6 = $enum
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'agerangetype'
   17     1        FETCH_CLASS_CONSTANT                             ~7      'AgeRangeType', 'AGE_RANGE_18_24'
          2        FETCH_OBJ_R                                      ~8      ~7, 'name'
          3        INIT_ARRAY                                       ~9      <array>, ~8
   18     4        FETCH_CLASS_CONSTANT                             ~10     'AgeRangeType', 'AGE_RANGE_25_34'
          5        FETCH_OBJ_R                                      ~11     ~10, 'name'
   17     6        ADD_ARRAY_ELEMENT                                ~9      <array>, ~11
   19     7        FETCH_CLASS_CONSTANT                             ~12     'AgeRangeType', 'AGE_RANGE_35_44'
          8        FETCH_OBJ_R                                      ~13     ~12, 'name'
   17     9        ADD_ARRAY_ELEMENT                                ~9      <array>, ~13
   20    10        FETCH_CLASS_CONSTANT                             ~14     'AgeRangeType', 'AGE_RANGE_45_54'
         11        FETCH_OBJ_R                                      ~15     ~14, 'name'
   17    12        ADD_ARRAY_ELEMENT                                ~9      <array>, ~15
   21    13        FETCH_CLASS_CONSTANT                             ~16     'AgeRangeType', 'AGE_RANGE_55_64'
         14        FETCH_OBJ_R                                      ~17     ~16, 'name'
   17    15        ADD_ARRAY_ELEMENT                                ~9      <array>, ~17
   22    16        FETCH_CLASS_CONSTANT                             ~18     'AgeRangeType', 'AGE_RANGE_65_UP'
         17        FETCH_OBJ_R                                      ~19     ~18, 'name'
   17    18        ADD_ARRAY_ELEMENT                                ~9      <array>, ~19
   16    19        ASSIGN                                                   !0, ~9
   25    20        ASSIGN                                                   !1, 20
   26    21        ASSIGN                                                   !2, 60
   28    22        ASSIGN                                                   !3, <array>
   29    23      > FE_RESET_R                                       $24     !0, ->42
         24    > > FE_FETCH_R                                       ~30     $24, $25, ->42
         25    >   FETCH_LIST_R                                     $26     $25, 'min'
         26        ASSIGN                                                   !4, $26
         27        FETCH_LIST_R                                     $28     $25, 'max'
         28        ASSIGN                                                   !5, $28
         29        FREE                                                     $25
         30        ASSIGN                                                   !6, ~30
   30    31        IS_SMALLER_OR_EQUAL                              ~32     !1, !5
         32      > JMPZ_EX                                          ~32     ~32, ->35
         33    >   IS_SMALLER_OR_EQUAL                              ~33     !4, !2
         34        BOOL                                             ~32     ~33
         35    > > JMPZ                                                     ~32, ->39
   31    36    >   ASSIGN_DIM                                               !3
         37        OP_DATA                                                  !6
   30    38      > JMP                                                      ->41
   32    39    > > JMPZ                                                     !3, ->41
   33    40    > > JMP                                                      ->42
   29    41    > > JMP                                                      ->24
         42    >   FE_FREE                                                  $24
   37    43        INIT_FCALL                                               'var_export'
         44        SEND_VAR                                                 !3
         45        DO_ICALL                                                 
         46      > RETURN                                                   1

Class AgeRangeType: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.18 ms | 1007 KiB | 14 Q