3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = json_decode('[{"first_name":"Rebecca"},{"first_name":"amy"},{"first_name":"Amy"},{"first_name":"stacy"}]', true); usort( $data, fn($a, $b) => strcasecmp($a['first_name'], $b['first_name']) ?: strcmp($a['first_name'], $b['first_name']) ); var_export($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l3NY2
function name:  (null)
number of ops:  14
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%5B%7B%22first_name%22%3A%22Rebecca%22%7D%2C%7B%22first_name%22%3A%22amy%22%7D%2C%7B%22first_name%22%3A%22Amy%22%7D%2C%7B%22first_name%22%3A%22stacy%22%7D%5D'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
    5     5        INIT_FCALL                                               'usort'
    6     6        SEND_REF                                                 !0
    7     7        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
    9     8        SEND_VAL                                                 ~3
    5     9        DO_ICALL                                                 
   10    10        INIT_FCALL                                               'var_export'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
         13      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l3NY2
function name:  {closure}
number of ops:  18
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'strcasecmp'
          3        FETCH_DIM_R                                      ~2      !0, 'first_name'
          4        SEND_VAL                                                 ~2
          5        FETCH_DIM_R                                      ~3      !1, 'first_name'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8        JMP_SET                                          ~5      $4, ->16
    8     9        INIT_FCALL                                               'strcmp'
         10        FETCH_DIM_R                                      ~6      !0, 'first_name'
         11        SEND_VAL                                                 ~6
         12        FETCH_DIM_R                                      ~7      !1, 'first_name'
         13        SEND_VAL                                                 ~7
         14        DO_ICALL                                         $8      
         15        QM_ASSIGN                                        ~5      $8
         16      > RETURN                                                   ~5
    9    17*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.61 ms | 1003 KiB | 18 Q