3v4l.org

run code in 500+ PHP versions simultaneously
<?php $photos = [ 'photo-Bname_0333.jpg', 'photo-Bname_0222.jpg', 'photo-Aname_0333.jpg', 'photo-Cname_0111.jpg', 'photo-Cname_0222.jpg', 'photo-Aname_0112.jpg', ]; usort($photos, function ($a, $b) { return array_reverse(explode('_', $a, 2)) <=> array_reverse(explode('_', $b, 2)); }); var_export($photos);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v8jDD
function name:  (null)
number of ops:  10
compiled vars:  !0 = $photos
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   11     1        INIT_FCALL                                                   'usort'
          2        SEND_REF                                                     !0
          3        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
   13     4        SEND_VAL                                                     ~2
   11     5        DO_ICALL                                                     
   14     6        INIT_FCALL                                                   'var_export'
          7        SEND_VAR                                                     !0
          8        DO_ICALL                                                     
          9      > 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/v8jDD
function name:  {closure:/in/v8jDD:11}
number of ops:  21
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   12     2        INIT_FCALL                                                   'array_reverse'
          3        INIT_FCALL                                                   'explode'
          4        SEND_VAL                                                     '_'
          5        SEND_VAR                                                     !0
          6        SEND_VAL                                                     2
          7        DO_ICALL                                             $2      
          8        SEND_VAR                                                     $2
          9        DO_ICALL                                             $3      
         10        INIT_FCALL                                                   'array_reverse'
         11        INIT_FCALL                                                   'explode'
         12        SEND_VAL                                                     '_'
         13        SEND_VAR                                                     !1
         14        SEND_VAL                                                     2
         15        DO_ICALL                                             $4      
         16        SEND_VAR                                                     $4
         17        DO_ICALL                                             $5      
         18        SPACESHIP                                            ~6      $3, $5
         19      > RETURN                                                       ~6
   13    20*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.34 ms | 2181 KiB | 17 Q