3v4l.org

run code in 300+ PHP versions simultaneously
<?php $notifications = array(); function add($type){ $notify = array( 'text' => $text , 'link' => $link , 'img' => $img , 'context' => $context ); if ( $notifications && count($notifications[$type]) <= 4 && count($notifications[$type]) ) { array_unshift($notifications[$type], $notify); } elseif ( $notifications && count($notifications[$type]) > 4 ) { array_pop($notifications[$type]); array_unshift($notifications[$type], $notify); } else { $notifications[$type] = []; array_unshift($notifications[$type], $notify); } } for($i = 0; $i< 10; $i++){ add($i); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 3
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 3
Branch analysis from position: 9
Branch analysis from position: 3
filename:       /in/5FbWK
function name:  (null)
number of ops:  10
compiled vars:  !0 = $notifications, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   32     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->7
   34     3    >   INIT_FCALL                                               'add'
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0          
   32     6        PRE_INC                                                  !1
          7    >   IS_SMALLER                                               !1, 10
          8      > JMPNZ                                                    ~6, ->3
   36     9    > > RETURN                                                   1

Function add:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 46) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 38
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
Branch analysis from position: 15
Branch analysis from position: 11
filename:       /in/5FbWK
function name:  add
number of ops:  46
compiled vars:  !0 = $type, !1 = $notify, !2 = $text, !3 = $link, !4 = $img, !5 = $context, !6 = $notifications
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_ARRAY                                       ~7      !2, 'text'
    6     2        ADD_ARRAY_ELEMENT                                ~7      !3, 'link'
    7     3        ADD_ARRAY_ELEMENT                                ~7      !4, 'img'
    8     4        ADD_ARRAY_ELEMENT                                ~7      !5, 'context'
    4     5        ASSIGN                                                   !1, ~7
   11     6      > JMPZ_EX                                          ~9      !6, ->11
          7    >   FETCH_DIM_R                                      ~10     !6, !0
          8        COUNT                                            ~11     ~10
          9        IS_SMALLER_OR_EQUAL                              ~12     ~11, 4
         10        BOOL                                             ~9      ~12
         11    > > JMPZ_EX                                          ~9      ~9, ->15
         12    >   FETCH_DIM_R                                      ~13     !6, !0
         13        COUNT                                            ~14     ~13
         14        BOOL                                             ~9      ~14
         15    > > JMPZ                                                     ~9, ->22
   13    16    >   INIT_FCALL                                               'array_unshift'
         17        FETCH_DIM_W                                      $15     !6, !0
         18        SEND_REF                                                 $15
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
         21      > JMP                                                      ->45
   16    22    > > JMPZ_EX                                          ~17     !6, ->27
         23    >   FETCH_DIM_R                                      ~18     !6, !0
         24        COUNT                                            ~19     ~18
         25        IS_SMALLER                                       ~20     4, ~19
         26        BOOL                                             ~17     ~20
         27    > > JMPZ                                                     ~17, ->38
   18    28    >   INIT_FCALL                                               'array_pop'
         29        FETCH_DIM_W                                      $21     !6, !0
         30        SEND_REF                                                 $21
         31        DO_ICALL                                                 
   19    32        INIT_FCALL                                               'array_unshift'
         33        FETCH_DIM_W                                      $23     !6, !0
         34        SEND_REF                                                 $23
         35        SEND_VAR                                                 !1
         36        DO_ICALL                                                 
         37      > JMP                                                      ->45
   24    38    >   ASSIGN_DIM                                               !6, !0
         39        OP_DATA                                                  <array>
   25    40        INIT_FCALL                                               'array_unshift'
         41        FETCH_DIM_W                                      $26     !6, !0
         42        SEND_REF                                                 $26
         43        SEND_VAR                                                 !1
         44        DO_ICALL                                                 
   30    45    > > RETURN                                                   null

End of function add

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.25 ms | 1394 KiB | 18 Q