3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ( 0 => (object)array( 'tenure' => '1 year to less than 2 years' ), 1 => (object)array( 'tenure' => '10 years to less than 15 years' ), 2 => (object)array( 'tenure' => '15 years or more' ), 3 => (object)array( 'tenure' => '2 years to less than 5 years' ), 4 => (object)array( 'tenure' => '5 years to less than 10 years' ) ); usort($array, function ($a, $b) { return (int)$a->tenure - (int)$b->tenure; }); print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2QJPO
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   CAST                                          8  ~1      <array>
          1        INIT_ARRAY                                       ~2      ~1, 0
   10     2        CAST                                          8  ~3      <array>
          3        ADD_ARRAY_ELEMENT                                ~2      ~3, 1
   14     4        CAST                                          8  ~4      <array>
          5        ADD_ARRAY_ELEMENT                                ~2      ~4, 2
   18     6        CAST                                          8  ~5      <array>
          7        ADD_ARRAY_ELEMENT                                ~2      ~5, 3
   22     8        CAST                                          8  ~6      <array>
          9        ADD_ARRAY_ELEMENT                                ~2      ~6, 4
    3    10        ASSIGN                                                   !0, ~2
   25    11        INIT_FCALL                                               'usort'
         12        SEND_REF                                                 !0
         13        DECLARE_LAMBDA_FUNCTION                          ~8      [0]
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
   26    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
         19      > 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/2QJPO
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        FETCH_OBJ_R                                      ~2      !0, 'tenure'
          3        CAST                                          4  ~3      ~2
          4        FETCH_OBJ_R                                      ~4      !1, 'tenure'
          5        CAST                                          4  ~5      ~4
          6        SUB                                              ~6      ~3, ~5
          7      > RETURN                                                   ~6
          8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.21 ms | 1002 KiB | 15 Q