3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); error_reporting(-1); ini_set('display_errors', 'On'); interface Transip_DomainService { public const AVAILABILITY_INYOURACCOUNT = 'inyouraccount'; public const AVAILABILITY_UNAVAILABLE = 'unavailable'; public const AVAILABILITY_FREE = 'free'; public const AVAILABILITY_NOTFREE = 'notfree'; } $priority = [ Transip_DomainService::AVAILABILITY_FREE => 0, Transip_DomainService::AVAILABILITY_NOTFREE => 1, Transip_DomainService::AVAILABILITY_UNAVAILABLE => 2, Transip_DomainService::AVAILABILITY_INYOURACCOUNT => 3, ]; $domainCheckResults = [ (object) ['domainName' => 'a', 'status' => Transip_DomainService::AVAILABILITY_NOTFREE], (object) ['domainName' => 'b', 'status' => Transip_DomainService::AVAILABILITY_UNAVAILABLE], (object) ['domainName' => 'c', 'status' => Transip_DomainService::AVAILABILITY_INYOURACCOUNT], (object) ['domainName' => 'd', 'status' => Transip_DomainService::AVAILABILITY_FREE], (object) ['domainName' => 'e', 'status' => Transip_DomainService::AVAILABILITY_INYOURACCOUNT], (object) ['domainName' => 'f', 'status' => Transip_DomainService::AVAILABILITY_FREE], ]; usort($domainCheckResults, function ($a, $b) use ($priority) { return $priority[$a->status] <=> $priority[$b->status]; }); print_r($domainCheckResults);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j24rM
function name:  (null)
number of ops:  31
compiled vars:  !0 = $priority, !1 = $domainCheckResults
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                                   'error_reporting'
          1        SEND_VAL                                                     -1
          2        DO_ICALL                                                     
    5     3        INIT_FCALL                                                   'ini_set'
          4        SEND_VAL                                                     'display_errors'
          5        SEND_VAL                                                     'On'
          6        DO_ICALL                                                     
   15     7        ASSIGN                                                       !0, <array>
   23     8        CAST                                              8  ~5      <array>
          9        INIT_ARRAY                                           ~6      ~5
         10        CAST                                              8  ~7      <array>
         11        ADD_ARRAY_ELEMENT                                    ~6      ~7
         12        CAST                                              8  ~8      <array>
         13        ADD_ARRAY_ELEMENT                                    ~6      ~8
         14        CAST                                              8  ~9      <array>
         15        ADD_ARRAY_ELEMENT                                    ~6      ~9
         16        CAST                                              8  ~10     <array>
         17        ADD_ARRAY_ELEMENT                                    ~6      ~10
         18        CAST                                              8  ~11     <array>
         19        ADD_ARRAY_ELEMENT                                    ~6      ~11
   22    20        ASSIGN                                                       !1, ~6
   31    21        INIT_FCALL                                                   'usort'
         22        SEND_REF                                                     !1
         23        DECLARE_LAMBDA_FUNCTION                              ~13     [0]
         24        BIND_LEXICAL                                                 ~13, !0
   33    25        SEND_VAL                                                     ~13
   31    26        DO_ICALL                                                     
   35    27        INIT_FCALL                                                   'print_r'
         28        SEND_VAR                                                     !1
         29        DO_ICALL                                                     
         30      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j24rM
function name:  {closure:/in/j24rM:31}
number of ops:  10
compiled vars:  !0 = $a, !1 = $b, !2 = $priority
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   31     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        BIND_STATIC                                                  !2
   32     3        FETCH_OBJ_R                                          ~3      !0, 'status'
          4        FETCH_DIM_R                                          ~4      !2, ~3
          5        FETCH_OBJ_R                                          ~5      !1, 'status'
          6        FETCH_DIM_R                                          ~6      !2, ~5
          7        SPACESHIP                                            ~7      ~4, ~6
          8      > RETURN                                                       ~7
   33     9*     > RETURN                                                       null

End of Dynamic Function 0

Class Transip_DomainService: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.19 ms | 2430 KiB | 17 Q