3v4l.org

run code in 300+ PHP versions simultaneously
<?php $datasets = array( // less than 10 entries array('127.0.0.1'=>45, '10.0.0.9'=>32, '172.16.0.4'=>'16'), // more than 10 entries array( '10.0.0.1'=>45, '10.0.0.2'=>44, '10.0.0.3'=>43, '10.0.0.4'=>42, '10.0.0.5'=>41, '10.0.0.6'=>40, '10.0.0.7'=>39, '10.0.0.8'=>38, '10.0.0.9'=>37, '10.0.0.10'=>36, '10.0.0.11'=>35, '10.0.0.12'=>34, '10.0.0.13'=>33, '10.0.0.14'=>32, '10.0.0.15'=>31, '10.0.0.16'=>30 ) ); foreach ($datasets as $all_ips) { arsort($all_ips); $top10 = array_slice($all_ips, 0, 10); var_export($top10); echo "\r\n-----\r\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 17
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/VfLcP
function name:  (null)
number of ops:  19
compiled vars:  !0 = $datasets, !1 = $all_ips, !2 = $top10
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   15     1      > FE_RESET_R                                       $4      !0, ->17
          2    > > FE_FETCH_R                                               $4, !1, ->17
   16     3    >   INIT_FCALL                                               'arsort'
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
   17     6        INIT_FCALL                                               'array_slice'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 0
          9        SEND_VAL                                                 10
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !2, $6
   19    12        INIT_FCALL                                               'var_export'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
   20    15        ECHO                                                     '%0D%0A-----%0D%0A'
   15    16      > JMP                                                      ->2
         17    >   FE_FREE                                                  $4
   21    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.16 ms | 1395 KiB | 19 Q