3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ['foo-test' => [1], '-' => [2], 'bar-test' => [3]]; uksort($a, function($x, $y) use (&$a) { echo $a[$x], PHP_EOL; // var_dump($a); if (!isset($a[$x])) { throw new Exception("Key '{$x}' not found."); } if (!isset($a[$y])) { throw new Exception("Key '{$y}' not found."); } return $x < $y; });
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Fet1J
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'uksort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFet1J%3A4%240'
          4        BIND_LEXICAL                                             ~2, !0
   16     5        SEND_VAL                                                 ~2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FFet1J%3A4%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 26
Branch analysis from position: 19
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Fet1J
function name:  {closure}
number of ops:  29
compiled vars:  !0 = $x, !1 = $y, !2 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
    5     3        FETCH_DIM_R                                      ~3      !2, !0
          4        ECHO                                                     ~3
          5        ECHO                                                     '%0A'
    7     6        ISSET_ISEMPTY_DIM_OBJ                         0  ~4      !2, !0
          7        BOOL_NOT                                         ~5      ~4
          8      > JMPZ                                                     ~5, ->16
    8     9    >   NEW                                              $6      'Exception'
         10        ROPE_INIT                                     3  ~8      'Key+%27'
         11        ROPE_ADD                                      1  ~8      ~8, !0
         12        ROPE_END                                      2  ~7      ~8, '%27+not+found.'
         13        SEND_VAL_EX                                              ~7
         14        DO_FCALL                                      0          
         15      > THROW                                         0          $6
   11    16    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~11     !2, !1
         17        BOOL_NOT                                         ~12     ~11
         18      > JMPZ                                                     ~12, ->26
   12    19    >   NEW                                              $13     'Exception'
         20        ROPE_INIT                                     3  ~15     'Key+%27'
         21        ROPE_ADD                                      1  ~15     ~15, !1
         22        ROPE_END                                      2  ~14     ~15, '%27+not+found.'
         23        SEND_VAL_EX                                              ~14
         24        DO_FCALL                                      0          
         25      > THROW                                         0          $13
   15    26    >   IS_SMALLER                                       ~18     !0, !1
         27      > RETURN                                                   ~18
   16    28*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FFet1J%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.11 ms | 1400 KiB | 15 Q