3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum E: string { case A = 'a'; case B = 'b'; case C = 'c'; case D = 'd'; } var_dump( 'a' > 'b', 'a' < 'b', E::A > E::B, E::A < E::B, E::A <=> E::B, E::B <=> E::A, ); $x = [ E::D, E::C, E::A, E::B, ]; usort($x, fn ($a, $b) => $a <=> $b); var_dump($x); usort($x, fn ($a, $b) => $a <=> $b); var_dump($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dHZuS
function name:  (null)
number of ops:  47
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'e'
   10     1        INIT_FCALL                                               'var_dump'
   11     2        SEND_VAL                                                 <false>
   12     3        SEND_VAL                                                 <true>
   13     4        FETCH_CLASS_CONSTANT                             ~1      'E', 'A'
          5        FETCH_CLASS_CONSTANT                             ~2      'E', 'B'
          6        IS_SMALLER                                       ~3      ~2, ~1
          7        SEND_VAL                                                 ~3
   14     8        FETCH_CLASS_CONSTANT                             ~4      'E', 'A'
          9        FETCH_CLASS_CONSTANT                             ~5      'E', 'B'
         10        IS_SMALLER                                       ~6      ~4, ~5
         11        SEND_VAL                                                 ~6
   15    12        FETCH_CLASS_CONSTANT                             ~7      'E', 'A'
         13        FETCH_CLASS_CONSTANT                             ~8      'E', 'B'
         14        SPACESHIP                                        ~9      ~7, ~8
         15        SEND_VAL                                                 ~9
   16    16        FETCH_CLASS_CONSTANT                             ~10     'E', 'B'
         17        FETCH_CLASS_CONSTANT                             ~11     'E', 'A'
         18        SPACESHIP                                        ~12     ~10, ~11
         19        SEND_VAL                                                 ~12
   10    20        DO_ICALL                                                 
   20    21        FETCH_CLASS_CONSTANT                             ~14     'E', 'D'
         22        INIT_ARRAY                                       ~15     ~14
   21    23        FETCH_CLASS_CONSTANT                             ~16     'E', 'C'
         24        ADD_ARRAY_ELEMENT                                ~15     ~16
   22    25        FETCH_CLASS_CONSTANT                             ~17     'E', 'A'
         26        ADD_ARRAY_ELEMENT                                ~15     ~17
   23    27        FETCH_CLASS_CONSTANT                             ~18     'E', 'B'
         28        ADD_ARRAY_ELEMENT                                ~15     ~18
   19    29        ASSIGN                                                   !0, ~15
   26    30        INIT_FCALL                                               'usort'
         31        SEND_REF                                                 !0
         32        DECLARE_LAMBDA_FUNCTION                          ~20     [0]
         33        SEND_VAL                                                 ~20
         34        DO_ICALL                                                 
   27    35        INIT_FCALL                                               'var_dump'
         36        SEND_VAR                                                 !0
         37        DO_ICALL                                                 
   29    38        INIT_FCALL                                               'usort'
         39        SEND_REF                                                 !0
         40        DECLARE_LAMBDA_FUNCTION                          ~23     [1]
         41        SEND_VAL                                                 ~23
         42        DO_ICALL                                                 
   30    43        INIT_FCALL                                               'var_dump'
         44        SEND_VAR                                                 !0
         45        DO_ICALL                                                 
         46      > 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/dHZuS
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        SPACESHIP                                        ~2      !0, !1
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dHZuS
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        SPACESHIP                                        ~2      !0, !1
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of Dynamic Function 1

Class E: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.91 ms | 980 KiB | 15 Q