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; } if ($documents[$a] == $documents[$b]) { $result = 0; } else { $result = $documents[$a] < $documents[$b] ? -1 : 1; } echo "a = {$a}, b = {$b}, result = {$result}\n" , memory_get_usage() , "\n" , print_r($documents, true) , "\n"; return $result; }); 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/omReZ
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%2FomReZ%3A7%240'
   26     8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
   28    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%2FomReZ%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 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 8
filename:       /in/omReZ
function name:  {closure}
number of ops:  47
compiled vars:  !0 = $a, !1 = $b, !2 = $documents, !3 = $result
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  ~4      !2, !0
          4        BOOL_NOT                                         ~5      ~4
          5      > JMPZ                                                     ~5, ->8
   11     6    >   ASSIGN_DIM                                               !2, !0
          7        OP_DATA                                                  <true>
   13     8    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~7      !2, !1
          9        BOOL_NOT                                         ~8      ~7
         10      > JMPZ                                                     ~8, ->13
   14    11    >   ASSIGN_DIM                                               !2, !1
         12        OP_DATA                                                  <true>
   17    13    >   FETCH_DIM_R                                      ~10     !2, !0
         14        FETCH_DIM_R                                      ~11     !2, !1
         15        IS_EQUAL                                                 ~10, ~11
         16      > JMPZ                                                     ~12, ->19
   18    17    >   ASSIGN                                                   !3, 0
         18      > JMP                                                      ->27
   20    19    >   FETCH_DIM_R                                      ~14     !2, !0
         20        FETCH_DIM_R                                      ~15     !2, !1
         21        IS_SMALLER                                               ~14, ~15
         22      > JMPZ                                                     ~16, ->25
         23    >   QM_ASSIGN                                        ~17     -1
         24      > JMP                                                      ->26
         25    >   QM_ASSIGN                                        ~17     1
         26    >   ASSIGN                                                   !3, ~17
   23    27    >   ROPE_INIT                                     7  ~20     'a+%3D+'
         28        ROPE_ADD                                      1  ~20     ~20, !0
         29        ROPE_ADD                                      2  ~20     ~20, '%2C+b+%3D+'
         30        ROPE_ADD                                      3  ~20     ~20, !1
         31        ROPE_ADD                                      4  ~20     ~20, '%2C+result+%3D+'
         32        ROPE_ADD                                      5  ~20     ~20, !3
         33        ROPE_END                                      6  ~19     ~20, '%0A'
         34        ECHO                                                     ~19
         35        INIT_FCALL                                               'memory_get_usage'
         36        DO_ICALL                                         $24     
         37        ECHO                                                     $24
         38        ECHO                                                     '%0A'
         39        INIT_FCALL                                               'print_r'
         40        SEND_VAR                                                 !2
         41        SEND_VAL                                                 <true>
         42        DO_ICALL                                         $25     
         43        ECHO                                                     $25
         44        ECHO                                                     '%0A'
   25    45      > RETURN                                                   !3
   26    46*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.38 ms | 1392 KiB | 19 Q