3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($firstValue, $secondValue) { if ($firstValue > $secondValue) { return 1; } if ($firstValue < $secondValue) { return -1; } return 0; } $array = array('a', 'b', 'a', 'b', 'c'); usort($array, 'test'); echo print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0sTAW
function name:  (null)
number of ops:  10
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'test'
          4        DO_ICALL                                                 
   14     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8        ECHO                                                     $3
          9      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0sTAW
function name:  test
number of ops:  10
compiled vars:  !0 = $firstValue, !1 = $secondValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        IS_SMALLER                                               !1, !0
          3      > JMPZ                                                     ~2, ->5
    5     4    > > RETURN                                                   1
    7     5    >   IS_SMALLER                                               !0, !1
          6      > JMPZ                                                     ~3, ->8
    8     7    > > RETURN                                                   -1
   10     8    > > RETURN                                                   0
   11     9*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.35 ms | 1395 KiB | 17 Q