3v4l.org

run code in 500+ PHP versions simultaneously
<?php const PERMANENT = -1; function mergeMaxAges() { $max_ages = func_get_args(); $min = FALSE; foreach ($max_ages as $age) { if ($age !== PERMANENT && ($min === FALSE || $age < $min)) { $min = $age; } } return $min !== FALSE ? $min : PERMANENT; } for ($i = 0; $i < 10000; $i++) { mergeMaxAges(0, 60); mergeMaxAges(0, 0); mergeMaxAges(0, PERMANENT); mergeMaxAges(PERMANENT, 60); mergeMaxAges(PERMANENT, PERMANENT); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 3
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 3
Branch analysis from position: 30
Branch analysis from position: 3
filename:       /in/EYE5S
function name:  (null)
number of ops:  31
compiled vars:  !0 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CONST                                                'PERMANENT', -1
   15     1        ASSIGN                                                       !0, 0
          2      > JMP                                                          ->28
   16     3    >   INIT_FCALL                                                   'mergemaxages'
          4        SEND_VAL                                                     0
          5        SEND_VAL                                                     60
          6        DO_FCALL                                          0          
   17     7        INIT_FCALL                                                   'mergemaxages'
          8        SEND_VAL                                                     0
          9        SEND_VAL                                                     0
         10        DO_FCALL                                          0          
   18    11        INIT_FCALL                                                   'mergemaxages'
         12        SEND_VAL                                                     0
         13        FETCH_CONSTANT                                       ~4      'PERMANENT'
         14        SEND_VAL                                                     ~4
         15        DO_FCALL                                          0          
   19    16        INIT_FCALL                                                   'mergemaxages'
         17        FETCH_CONSTANT                                       ~6      'PERMANENT'
         18        SEND_VAL                                                     ~6
         19        SEND_VAL                                                     60
         20        DO_FCALL                                          0          
   20    21        INIT_FCALL                                                   'mergemaxages'
         22        FETCH_CONSTANT                                       ~8      'PERMANENT'
         23        SEND_VAL                                                     ~8
         24        FETCH_CONSTANT                                       ~9      'PERMANENT'
         25        SEND_VAL                                                     ~9
         26        DO_FCALL                                          0          
   15    27        PRE_INC                                                      !0
         28    >   IS_SMALLER                                                   !0, 10000
         29      > JMPNZ                                                        ~12, ->3
   21    30    > > RETURN                                                       1

Function mergemaxages:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 47) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
Branch analysis from position: 12
Branch analysis from position: 13
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/EYE5S
function name:  mergeMaxAges
number of ops:  25
compiled vars:  !0 = $max_ages, !1 = $min, !2 = $age
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   FUNC_GET_ARGS                                        ~3      
          1        ASSIGN                                                       !0, ~3
    5     2        ASSIGN                                                       !1, <false>
    6     3      > FE_RESET_R                                           $6      !0, ->16
          4    > > FE_FETCH_R                                                   $6, !2, ->16
    7     5    >   FETCH_CONSTANT                                       ~7      'PERMANENT'
          6        IS_NOT_IDENTICAL                                     ~8      !2, ~7
          7      > JMPZ_EX                                              ~8      ~8, ->13
          8    >   TYPE_CHECK                                        4  ~9      !1
          9      > JMPNZ_EX                                             ~9      ~9, ->12
         10    >   IS_SMALLER                                           ~10     !2, !1
         11        BOOL                                                 ~9      ~10
         12    >   BOOL                                                 ~8      ~9
         13    > > JMPZ                                                         ~8, ->15
    8    14    >   ASSIGN                                                       !1, !2
    6    15    > > JMP                                                          ->4
         16    >   FE_FREE                                                      $6
   12    17        TYPE_CHECK                                      1018          !1
         18      > JMPZ                                                         ~12, ->21
         19    >   QM_ASSIGN                                            ~13     !1
         20      > JMP                                                          ->23
         21    >   FETCH_CONSTANT                                       ~14     'PERMANENT'
         22        QM_ASSIGN                                            ~13     ~14
         23    > > RETURN                                                       ~13
   13    24*     > RETURN                                                       null

End of function mergemaxages

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
148.43 ms | 2969 KiB | 18 Q