3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dataPoints = array( array('1' => '33','2' => 'dave','3' => '367'), array('1' => '168','2' => 'susan','3' => '56788'), array('1' => '99','2' => 'tim','3' => '6') ); function cmp($a, $b){ return strcmp($a[2], $b[2]); } usort($dataPoints, "cmp"); print_r($dataPoints);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s8mUv
function name:  (null)
number of ops:  9
compiled vars:  !0 = $dataPoints
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'cmp'
          4        DO_ICALL                                                 
   14     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

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

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.64 ms | 1395 KiB | 19 Q