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) { if (!isset($a[$x])) { throw new Exception("Key X ('{$x}') not found."); } else {var_dump($x, $a[$x]);} if (!isset($a[$y])) { throw new Exception("Key Y ('{$y}') not found."); } return $x < $y; });
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6323h
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%2F6323h%3A4%240'
          4        BIND_LEXICAL                                             ~2, !0
   14     5        SEND_VAL                                                 ~2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F6323h%3A4%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 29
Branch analysis from position: 22
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6323h
function name:  {closure}
number of ops:  32
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        ISSET_ISEMPTY_DIM_OBJ                         0  ~3      !2, !0
          4        BOOL_NOT                                         ~4      ~3
          5      > JMPZ                                                     ~4, ->14
    6     6    >   NEW                                              $5      'Exception'
          7        ROPE_INIT                                     3  ~7      'Key+X+%28%27'
          8        ROPE_ADD                                      1  ~7      ~7, !0
          9        ROPE_END                                      2  ~6      ~7, '%27%29+not+found.'
         10        SEND_VAL_EX                                              ~6
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $5
         13*       JMP                                                      ->19
    7    14    >   INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !0
         16        FETCH_DIM_R                                      ~10     !2, !0
         17        SEND_VAL                                                 ~10
         18        DO_ICALL                                                 
    9    19        ISSET_ISEMPTY_DIM_OBJ                         0  ~12     !2, !1
         20        BOOL_NOT                                         ~13     ~12
         21      > JMPZ                                                     ~13, ->29
   10    22    >   NEW                                              $14     'Exception'
         23        ROPE_INIT                                     3  ~16     'Key+Y+%28%27'
         24        ROPE_ADD                                      1  ~16     ~16, !1
         25        ROPE_END                                      2  ~15     ~16, '%27%29+not+found.'
         26        SEND_VAL_EX                                              ~15
         27        DO_FCALL                                      0          
         28      > THROW                                         0          $14
   13    29    >   IS_SMALLER                                       ~19     !0, !1
         30      > RETURN                                                   ~19
   14    31*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.96 ms | 1405 KiB | 17 Q