3v4l.org

run code in 300+ PHP versions simultaneously
<?php $Hand = array("05h", "02h", "03c", "02s", "04h"); $Hand2 = array("05h", "02h", "03c", "02s", "03h"); $Hand3 = array("03s", "02h", "03c", "02s", "03h"); function sortMyArray(&$arr){ usort($arr, function($a,$b) { if(intval($a) == intval($b)){ return 0; } return 1; }); return $arr; } print_R(sortMyArray($Hand)); print_R(sortMyArray($Hand2)); print_R(sortMyArray($Hand3));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gCfIJ
function name:  (null)
number of ops:  22
compiled vars:  !0 = $Hand, !1 = $Hand2, !2 = $Hand3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
   19     3        INIT_FCALL                                               'print_r'
          4        INIT_FCALL                                               'sortmyarray'
          5        SEND_REF                                                 !0
          6        DO_FCALL                                      0  $6      
          7        SEND_VAR                                                 $6
          8        DO_ICALL                                                 
   20     9        INIT_FCALL                                               'print_r'
         10        INIT_FCALL                                               'sortmyarray'
         11        SEND_REF                                                 !1
         12        DO_FCALL                                      0  $8      
         13        SEND_VAR                                                 $8
         14        DO_ICALL                                                 
   21    15        INIT_FCALL                                               'print_r'
         16        INIT_FCALL                                               'sortmyarray'
         17        SEND_REF                                                 !2
         18        DO_FCALL                                      0  $10     
         19        SEND_VAR                                                 $10
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function sortmyarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gCfIJ
function name:  sortMyArray
number of ops:  8
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~1      [0]
   15     4        SEND_VAL                                                 ~1
    8     5        DO_ICALL                                                 
   16     6      > RETURN                                                   !0
   17     7*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gCfIJ
function name:  {closure}
number of ops:  9
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        CAST                                          4  ~2      !0
          3        CAST                                          4  ~3      !1
          4        IS_EQUAL                                                 ~2, ~3
          5      > JMPZ                                                     ~4, ->7
   10     6    > > RETURN                                                   0
   13     7    > > RETURN                                                   1
   15     8*     > RETURN                                                   null

End of Dynamic Function 0

End of function sortmyarray

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.73 ms | 1019 KiB | 18 Q