3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sortByLength($a, $b) { $lenA = strlen($a); $lenB = strlen($b); if ($lenA == $lenB) { return 0; } return $lenA > $lenB ? 1 : 0; } $values = array( 'ccc', 'a', 'eeeeee', 'dddd', 'bb', 'fffff' ); usort($values, 'sortByLength'); echo $values[5];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HKf1g
function name:  (null)
number of ops:  8
compiled vars:  !0 = $values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   21     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'sortByLength'
          4        DO_ICALL                                                 
   22     5        FETCH_DIM_R                                      ~3      !0, 5
          6        ECHO                                                     ~3
          7      > RETURN                                                   1

Function sortbylength:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HKf1g
function name:  sortByLength
number of ops:  16
compiled vars:  !0 = $a, !1 = $b, !2 = $lenA, !3 = $lenB
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        STRLEN                                           ~4      !0
          3        ASSIGN                                                   !2, ~4
    5     4        STRLEN                                           ~6      !1
          5        ASSIGN                                                   !3, ~6
    7     6        IS_EQUAL                                                 !2, !3
          7      > JMPZ                                                     ~8, ->9
          8    > > RETURN                                                   0
    9     9    >   IS_SMALLER                                               !3, !2
         10      > JMPZ                                                     ~9, ->13
         11    >   QM_ASSIGN                                        ~10     1
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~10     0
         14    > > RETURN                                                   ~10
   10    15*     > RETURN                                                   null

End of function sortbylength

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.92 ms | 1388 KiB | 15 Q