3v4l.org

run code in 500+ PHP versions simultaneously
<?php namespace App\Controllers\Redis; class getArray{ public function sortArray(){ $sortMe = [100, 1, 10, 1000]; function cmp($a, $b) { static $example = [1, 1000, 100, 10]; return array_search($a, $example) - array_search($b, $example); } uasort($sortMe, 'App\Controllers\Redis\cmp'); var_export($sortMe); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Kmoq
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                       1

Class App\Controllers\Redis\getArray:
Function sortarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Kmoq
function name:  sortArray
number of ops:  10
compiled vars:  !0 = $sortMe
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                       !0, <array>
    8     1        DECLARE_FUNCTION                                             'app%5Ccontrollers%5Credis%5Ccmp'
   13     2        INIT_NS_FCALL_BY_NAME                                        'App%5CControllers%5CRedis%5Cuasort'
          3        SEND_VAR_EX                                                  !0
          4        SEND_VAL_EX                                                  'App%5CControllers%5CRedis%5Ccmp'
          5        DO_FCALL                                          0          
   14     6        INIT_NS_FCALL_BY_NAME                                        'App%5CControllers%5CRedis%5Cvar_export'
          7        SEND_VAR_EX                                                  !0
          8        DO_FCALL                                          0          
   15     9      > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Kmoq
function name:  App\Controllers\Redis\cmp
number of ops:  14
compiled vars:  !0 = $a, !1 = $b, !2 = $example
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    9     2        BIND_STATIC                                                  !2
   10     3        INIT_NS_FCALL_BY_NAME                                        'App%5CControllers%5CRedis%5Carray_search'
          4        SEND_VAR_EX                                                  !0
          5        SEND_VAR_EX                                                  !2
          6        DO_FCALL                                          0  $3      
          7        INIT_NS_FCALL_BY_NAME                                        'App%5CControllers%5CRedis%5Carray_search'
          8        SEND_VAR_EX                                                  !1
          9        SEND_VAR_EX                                                  !2
         10        DO_FCALL                                          0  $4      
         11        SUB                                                  ~5      $3, $4
         12      > RETURN                                                       ~5
   11    13*     > RETURN                                                       null

End of Dynamic Function 0

End of function sortarray

End of class App\Controllers\Redis\getArray.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
153.37 ms | 1481 KiB | 16 Q