3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array("A","BC","AA","C","BB", "B"); function lensort($a,$b){ $la = strlen( $a); $lb = strlen( $b); if( $la == $lb) { return strcmp( $a, $b); } return $la - $lb; } usort($array,'lensort');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/or4cd
function name:  (null)
number of ops:  6
compiled vars:  !0 = $array
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                                                 'lensort'
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

Function lensort:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/or4cd
function name:  lensort
number of ops:  16
compiled vars:  !0 = $a, !1 = $b, !2 = $la, !3 = $lb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        STRLEN                                           ~4      !0
          3        ASSIGN                                                   !2, ~4
          4        STRLEN                                           ~6      !1
          5        ASSIGN                                                   !3, ~6
    6     6        IS_EQUAL                                                 !2, !3
          7      > JMPZ                                                     ~8, ->13
    7     8    >   INIT_FCALL                                               'strcmp'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $9      
         12      > RETURN                                                   $9
    9    13    >   SUB                                              ~10     !2, !3
         14      > RETURN                                                   ~10
   10    15*     > RETURN                                                   null

End of function lensort

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.83 ms | 1395 KiB | 17 Q