3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array( array('id' => 1, 'price' => 100), array('id' => 7, 'price' => 100.3), array('id' => 5, 'price' => 100.2), ); uasort($data, function ($a, $b) { return $a['price'] - $b['price']; }); var_dump($data); uasort($data, function ($a, $b) { return $a['price'] <=> $b['price']; }); var_dump($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YTYP8
function name:  (null)
number of ops:  18
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    7     1        INIT_FCALL                                               'uasort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYTYP8%3A7%240'
    9     4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   10     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   12     9        INIT_FCALL                                               'uasort'
         10        SEND_REF                                                 !0
         11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYTYP8%3A12%241'
   14    12        SEND_VAL                                                 ~5
         13        DO_ICALL                                                 
   15    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FYTYP8%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YTYP8
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        FETCH_DIM_R                                      ~2      !0, 'price'
          3        FETCH_DIM_R                                      ~3      !1, 'price'
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
    9     6*     > RETURN                                                   null

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

Function %00%7Bclosure%7D%2Fin%2FYTYP8%3A12%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YTYP8
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        FETCH_DIM_R                                      ~2      !0, 'price'
          3        FETCH_DIM_R                                      ~3      !1, 'price'
          4        SPACESHIP                                        ~4      ~2, ~3
          5      > RETURN                                                   ~4
   14     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FYTYP8%3A12%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.93 ms | 1396 KiB | 17 Q