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) { var_dump($a[$x]); // 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/mkg7E
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%2Fmkg7E%3A4%240'
          4        BIND_LEXICAL                                             ~2, !0
   16     5        SEND_VAL                                                 ~2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.31 ms | 1400 KiB | 17 Q