3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array('2013-02-01','2000-02-01','2016-02-17','0000-00-00','0000-00-00','0000-00-00'); sort( $arr ); usort( $arr, function( $a, $b ) { if ( $a === $b ) return 0; if ( strpos( $b, '0000' ) !== false ) return -1; return ( $a < $b ) ? -1 : 1; }); print_r( $arr );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Tvlm
function name:  (null)
number of ops:  13
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'sort'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                                 
    5     4        INIT_FCALL                                               'usort'
          5        SEND_REF                                                 !0
          6        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
   10     7        SEND_VAL                                                 ~3
    5     8        DO_ICALL                                                 
   12     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
         12      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
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 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Tvlm
function name:  {closure}
number of ops:  19
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        IS_IDENTICAL                                             !0, !1
          3      > JMPZ                                                     ~2, ->5
          4    > > RETURN                                                   0
    8     5    >   INIT_FCALL                                               'strpos'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 '0000'
          8        DO_ICALL                                         $3      
          9        TYPE_CHECK                                  1018          $3
         10      > JMPZ                                                     ~4, ->12
         11    > > RETURN                                                   -1
    9    12    >   IS_SMALLER                                               !0, !1
         13      > JMPZ                                                     ~5, ->16
         14    >   QM_ASSIGN                                        ~6      -1
         15      > JMP                                                      ->17
         16    >   QM_ASSIGN                                        ~6      1
         17    > > RETURN                                                   ~6
   10    18*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.36 ms | 1014 KiB | 17 Q