3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmls = [6, 3, 2, 5, 4, 1]; echo memory_get_usage() . "\n\n"; usort($xmls, function($a, $b) { static $documents = array(); if (!isset($documents[$a])) { $documents[$a] = true; } if (!isset($documents[$b])) { $documents[$b] = true; } echo memory_get_usage() . "\n" . print_r($documents, true) . "\n"; if ($documents[$a] == $documents[$b]) { return 0; } return $documents[$a] < $documents[$b] ? -1 : 1; }); echo memory_get_usage() . "\n" . print_r($xmls, true) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vWlom
function name:  (null)
number of ops:  21
compiled vars:  !0 = $xmls
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'memory_get_usage'
          2        DO_ICALL                                         $2      
          3        CONCAT                                           ~3      $2, '%0A%0A'
          4        ECHO                                                     ~3
    7     5        INIT_FCALL                                               'usort'
          6        SEND_REF                                                 !0
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FvWlom%3A7%240'
   23     8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
   25    10        INIT_FCALL                                               'memory_get_usage'
         11        DO_ICALL                                         $6      
         12        CONCAT                                           ~7      $6, '%0A'
         13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $8      
         17        CONCAT                                           ~9      ~7, $8
         18        CONCAT                                           ~10     ~9, '%0A'
         19        ECHO                                                     ~10
         20      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FvWlom%3A7%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 28
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 8
filename:       /in/vWlom
function name:  {closure}
number of ops:  37
compiled vars:  !0 = $a, !1 = $b, !2 = $documents
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        BIND_STATIC                                              !2
   10     3        ISSET_ISEMPTY_DIM_OBJ                         0  ~3      !2, !0
          4        BOOL_NOT                                         ~4      ~3
          5      > JMPZ                                                     ~4, ->8
   11     6    >   ASSIGN_DIM                                               !2, !0
          7        OP_DATA                                                  <true>
   13     8    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~6      !2, !1
          9        BOOL_NOT                                         ~7      ~6
         10      > JMPZ                                                     ~7, ->13
   14    11    >   ASSIGN_DIM                                               !2, !1
         12        OP_DATA                                                  <true>
   17    13    >   INIT_FCALL                                               'memory_get_usage'
         14        DO_ICALL                                         $9      
         15        CONCAT                                           ~10     $9, '%0A'
         16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !2
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $11     
         20        CONCAT                                           ~12     ~10, $11
         21        CONCAT                                           ~13     ~12, '%0A'
         22        ECHO                                                     ~13
   19    23        FETCH_DIM_R                                      ~14     !2, !0
         24        FETCH_DIM_R                                      ~15     !2, !1
         25        IS_EQUAL                                                 ~14, ~15
         26      > JMPZ                                                     ~16, ->28
   20    27    > > RETURN                                                   0
   22    28    >   FETCH_DIM_R                                      ~17     !2, !0
         29        FETCH_DIM_R                                      ~18     !2, !1
         30        IS_SMALLER                                               ~17, ~18
         31      > JMPZ                                                     ~19, ->34
         32    >   QM_ASSIGN                                        ~20     -1
         33      > JMP                                                      ->35
         34    >   QM_ASSIGN                                        ~20     1
         35    > > RETURN                                                   ~20
   23    36*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FvWlom%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.47 ms | 1400 KiB | 19 Q