3v4l.org

run code in 300+ 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/DioRf
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
   16     1        ASSIGN                                                   !0, 0
          2      > JMP                                                      ->28
   17     3    >   INIT_FCALL                                               'mergemaxages'
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 60
          6        DO_FCALL                                      0          
   18     7        INIT_FCALL                                               'mergemaxages'
          8        SEND_VAL                                                 0
          9        SEND_VAL                                                 0
         10        DO_FCALL                                      0          
   19    11        INIT_FCALL                                               'mergemaxages'
         12        SEND_VAL                                                 0
         13        FETCH_CONSTANT                                   ~4      'PERMANENT'
         14        SEND_VAL                                                 ~4
         15        DO_FCALL                                      0          
   20    16        INIT_FCALL                                               'mergemaxages'
         17        FETCH_CONSTANT                                   ~6      'PERMANENT'
         18        SEND_VAL                                                 ~6
         19        SEND_VAL                                                 60
         20        DO_FCALL                                      0          
   21    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          
   16    27        PRE_INC                                                  !0
         28    >   IS_SMALLER                                               !0, 10000
         29      > JMPNZ                                                    ~12, ->3
   22    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/DioRf
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
-------------------------------------------------------------------------------------
    5     0  E >   FUNC_GET_ARGS                                    ~3      
          1        ASSIGN                                                   !0, ~3
    6     2        ASSIGN                                                   !1, <false>
    7     3      > FE_RESET_R                                       $6      !0, ->16
          4    > > FE_FETCH_R                                               $6, !2, ->16
    8     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
    9    14    >   ASSIGN                                                   !1, !2
    7    15    > > JMP                                                      ->4
         16    >   FE_FREE                                                  $6
   13    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
   14    24*     > RETURN                                                   null

End of function mergemaxages

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.92 ms | 1403 KiB | 18 Q