3v4l.org

run code in 300+ PHP versions simultaneously
<?php $abc = array( 'rec_1' => array('fn'=>'Aron','ln'=>'Michaelson'), 'rec_2' => array('fn'=>'Abbey','ln'=>'Drake'), 'rec_3' => array('fn'=>'Alice','ln'=>'Peterson')); function SortByLname($a,$b) { return strcmp( $a['ln'], $b['ln'] ); } usort($abc, "SortByLname"); foreach ($abc as $item) { echo strtoupper($item['ln']) . ', ' . $item['fn'] . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 17
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 17
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/QYt9S
function name:  (null)
number of ops:  19
compiled vars:  !0 = $abc, !1 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'SortByLname'
          4        DO_ICALL                                                 
   16     5      > FE_RESET_R                                       $4      !0, ->17
          6    > > FE_FETCH_R                                               $4, !1, ->17
   17     7    >   INIT_FCALL                                               'strtoupper'
          8        FETCH_DIM_R                                      ~5      !1, 'ln'
          9        SEND_VAL                                                 ~5
         10        DO_ICALL                                         $6      
         11        CONCAT                                           ~7      $6, '%2C+'
         12        FETCH_DIM_R                                      ~8      !1, 'fn'
         13        CONCAT                                           ~9      ~7, ~8
         14        CONCAT                                           ~10     ~9, '%0A'
         15        ECHO                                                     ~10
   16    16      > JMP                                                      ->6
         17    >   FE_FREE                                                  $4
   18    18      > RETURN                                                   1

Function sortbylname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QYt9S
function name:  SortByLname
number of ops:  10
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        INIT_FCALL                                               'strcmp'
          3        FETCH_DIM_R                                      ~2      !0, 'ln'
          4        SEND_VAL                                                 ~2
          5        FETCH_DIM_R                                      ~3      !1, 'ln'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
   11     9*     > RETURN                                                   null

End of function sortbylname

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.69 ms | 1396 KiB | 19 Q